Configuring And Running Linux Services


It's very simple to run a Linux server program. All you have to do is edit the configuration file to suit your needs, and then run the startup script at the command line. This method is much more flexible than running and configuring a service via a graphical user interface. And it makes remote access and control a snap.


Configuration

Linux server programs are configured by editing the settings in the program's configuration file. All Linux configuration files are found somewhere under the /etc directory, either directly, or in an aptly named sub-directory. The configuration file will have a .conf or .cf extension, usually preceeded by the name of the service. The files are generally heavily commented, guiding the user to selecting the right settings.

A note of caution: If you edit the file remotely, make sure that it's saved in Unix format, not Windows. Some scripts get confused with the carriage returns that Windows uses. If you've changed the configuration file and your application acts strangely, even when you've returned to the original setting, then this could be the culprit. A good editor such as Ultra Edit can save in either format.


Running Services

Linux server programs are controlled by script files. On Debian Linux, these are found in the /etc/init.d directory. Simply run the script with the appropriate argument to start or stop the program, or to reload new settings if the configuration file has been modified. For example, to start the Postfix mail server, type the following at the command line:

/etc/init.d/postfix start

Note that the script is run using the full path name.

Most Linux server programs are configured to start up automatically when the computer boots. You can check if the service is running by using the ps command (process status). This command will return a list of running processes. Pipe it into grep to filter for the process you're looking for. For example:

ps -ef | grep postfix


Manuals

Linux is very well documented, and help is easily accessed from the command line using the man commmand followed by the name of the program. For example:

man man

The above command will give you the manual for man. An alternative is to google for the man page from your favourite web browser. Makes searching and scrolling just a little bit easier.