Chapter 5 Linux Services CSNB113 SYSTEM ADMINISTRATION College of Information Technology Universiti Tenaga Nasional (UNITEN) SN 2017
Objectives Know the services running on the server SN 2017
Introduction A Linux service is an application (or set of applications) that runs in the background waiting to be used, or carrying out essential tasks. Please remember that services is a application, so that that a lot of application can be used for some certain services. SN 2017
Types of common services A lot of services running But we will only focus 5 services related to Linux server. Web server Database server Email server FTP server SSH server SN 2017
Webserver Webserver services is a services that that sends the web browser the code to display a web page. So me of the example of the webserver application that can be run is Apache, Nginx, Tomcat and lighthttpd. We will use the Apache web server for our class. SN 2017
Webserver To start the services, use this command: To install the apache, use this command sudo apt-get install apache2 To start the services, use this command: sudo /etc/init.d/apache2 start To stop the services, use this command: sudo /etc/init.d/apache2 stop SN 2017
Webserver /var/www The webserver configuration file is “httpd.conf” This conf file is located at /etc/apache2. It stores information on various functions of the server, which can be edited by removing or adding a number sign "#" at the beginning of the line, thus setting values for each directive. The root directories for Apache is at /var/www SN 2017
Database server Dedicated host to run and serve up the resources, typically one or more software applications. There are also several clients who can connect to the server and use the resources offered and hosted by this server. Most of the Database servers works with the base of Query Language. Each Database understands its query language and converts it to Server readable form and executes it to retrieve the results. Ubuntu provides two popular database servers: MySQL PostgreSQL SN 2017
Database server To start the services, use this command: To install the mysql, use this command sudo apt-get install mysql-server To start the services, use this command: sudo service mysql start /etc/init.d/mysql start To stop the services, use this command: sudo service mysql stop /etc/init.d/mysql stop SN 2017
Database server This file is located at /etc/mysql/my.cnf The database server configuration file is “my.cnf” This file is located at /etc/mysql/my.cnf Phpmyadmin also must be install along with mysql. Phpmyadmin is specifically written for administering MySQL servers. Written in PHP, and accessed through a web browser, phpMyAdmin provides a graphical interface for database administration tasks SN 2017
Database server To install and link the apache and phpmyadmin to the mysql server, use this command: sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin sudo ln-s /usr/share/phpmyadmin /var/www/phpmyadmin SN 2017
Email server E-mail server is a services that works as your virtual post office. A mail server usually consists of: Storage area - where e-mail is stored for local users. User definable rules - determine how the mail server should react to the destination of a specific message Database of user accounts - mail server recognizes and will deal with locally Communications modules - components that actually handle the transfer of messages to and from other mail servers and email clients. Ubuntu provides two popular email servers which is sendmail dan postfix SN 2017
Email server To start the services, use this command: To install the postfix, use this command sudo apt-get install postfix To start the services, use this command: sudo postfix start To stop the services, use this command: sudo postfix stop SN 2017
Email server /etc/postfix The email server configuration file is “main.cf” This conf file is located at /etc/postfix. The Postfix main.cf configuration file specifies a very small subset of all the parameters that control the operation of the Postfix mail system. Parameters not explicitly specified are left at their default values. The root directories for Postfix is at /etc/postfix SN 2017
Email server To reconfigure the email server sudo dpkg-reconfigure postfix This configuration has been save at main.cf file. It can be change by editing the main.cf file. Administering a Postfix server can be a very complicated task. At some point you may need to turn to the Ubuntu community for more experienced help SN 2017
FTP server FTP is an acronym for File Transfer Protocol. FTP is used to transfer files between computers on a network. FTP is use to exchange files between computer accounts, transfer files between an account and a desktop computer, or access online software archives. The popular FTP server in Ubuntu is vsftpd, wu-ftpd, proftpd, SN 2017
FTP server To start the ftp services, use this command: To install the ftp server , use this command sudo apt-get install vsftpd To start the ftp services, use this command: sudo /etc/init.d/vsftpd start To stop the ftp services, use this command: sudo /etc/init.d/vsftpd stop SN 2017
FTP server The email server configuration file is “vsftpd.conf” This conf file is located at /etc/vsftpd.conf The vsftpd.cont configuration file may be used to control various aspects of vsftpd's behavior. This behaviour is useful because you may wish to use an advanced inetd such as xinetd to launch vsftpd with different configuration files on a per virtual host basis. SN 2017
SSH server SSH server is a software program which uses the secure shell protocol to accept connections from remote computers. SSH is actually a suite of three utilities - slogin, ssh, and scp - that are secure versions of the earlier UNIX utilities, rlogin, rsh, and rcp. SSH commands are encrypted and secure in several ways. Both ends of the client/server connection are authenticated using a digital certificate, and passwords are protected by being encrypted. SSH allows you to connect to your server securely and perform Linux command-line operations SFTP/SCP file transfers and remote terminal connections are popular use cases for an SSH server SN 2017
SSH server To start the ssh services, use this command: To install the ssh server, use this command sudo apt-get install openssh-server To start the ssh services, use this command: sudo service sshd start To stop the ssh services, use this command: sudo service sshd stop SN 2017
SSH server The ssh server configuration file is “sshd_config” The main sshd configuration file is located at /etc/ssh/sshd_config SN 2017
References Das, S. (2012). Your UNIX/LINUX The Ultimate Guide: Third Edition. McGraw-Hill Hahn, H. (2008). Harley Hahn's Guide to Unix and Linux. California: McGraw-Hill Higher Education SN 2017