Before installing Lighttpd we need to enable the EPEL repository on our system and update our software packages once again using the following commands:<\/p>\n
yum -y install epel-release\r\nyum -y update<\/pre>\nOnce the EPEL repository has been enabled, we can install the Lighttpd web server by running the following command:<\/p>\n
yum install lighttpd<\/pre>\nOnce the Lighttpd packages have been installed, we can start and enable the service to automatically start at boot.<\/p>\n
systemctl start lighttpd\r\nsystemctl enable lighttpd<\/pre>\nTo check the status of the service run the following command:<\/p>\n
systemctl status lighttpd<\/pre>\nIf everything is fine you should get the following output:<\/p>\n
\u25cf lighttpd.service - Lightning Fast Webserver With Light System Requirements\r\n\u00a0 \u00a0 \u00a0 \u00a0Loaded: loaded (\/usr\/lib\/systemd\/system\/lighttpd.service; disabled; vendor preset: disabled)\r\n \u00a0 \u00a0 Active: active (running) since Tue 2019-07-02 12:52:11 CDT; 2s ago\r\n\u00a0Main PID: 11445 (lighttpd)\r\n\u00a0 \u00a0 \u00a0 CGroup: \/system.slice\/lighttpd.service\r\n\u00a0 \u00a0 \u00a0 \u00a0\u2514\u250011445 \/usr\/sbin\/lighttpd -D -f \/etc\/lighttpd\/lighttpd.conf<\/pre>\nIf you see any network errors in the status, open the \/etc\/lighttpd\/lighttpd.conf<\/code> configuration file and change the line that says\u00a0server.use-ipv6<\/code> from enable<\/code> to disable<\/code>.<\/p>\nNow, we need to restart the Lighttpd web server and everything should work fine.<\/p>\n
systemctl restart lighttpd<\/pre>\nNext, you can open your favorite web browser and enter your server’s IP Address. It will load the default Lighttpd web page.<\/p>\n
The default document root for Lighttpd is \/var\/www\/lighttpd\/<\/code> and the main configuration file is at \/etc\/lighttpd\/lighttpd.conf<\/code>.<\/p>\n<\/span>Step 3: Installing MariaDB support for Lighttpd<\/span><\/span><\/h2>\nIf you need database support with your Lighttpd setup, this step can be very useful.<\/p>\n
We can install the MariaDB database server using the following commands:<\/p>\n
yum -y install mariadb mariadb-server<\/pre>\nOnce the installation has been completed, we can start and enable the service with these following commands:<\/p>\n
systemctl start mariadb.service\r\nsystemctl enable mariadb.service<\/pre>\nWe can then check the status of the service by running the following command:<\/p>\n
systemctl status mariadb.service<\/pre>\nIf everything is fine you should get the following output:<\/p>\n
\u25cf mariadb.service - MariaDB database server\r\n\u00a0 \u00a0 \u00a0 \u00a0Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: disabled)\r\n\u00a0 \u00a0 \u00a0 \u00a0Active: active (running) since Tue 2019-07-02 11:44:39 CDT; 1h 29min ago\r\n\u00a0 \u00a0Main PID: 776 (mysqld_safe)\r\n\u00a0 \u00a0 \u00a0 CGroup: \/system.slice\/mariadb.service\r\n\u00a0 \u00a0 \u00a0\u251c\u2500 776 \/bin\/sh \/usr\/bin\/mysqld_safe --basedir=\/usr\r\n\u00a0 \u00a0 \u00a0 \u2514\u25001076 \/usr\/libexec\/mysqld --basedir=\/usr --datadir=\/var\/lib\/mysql<\/pre>\nWe can connect to the MariaDB command line with the following command:<\/p>\n
mysql -u root -p<\/pre>\nIf you logged in successfully, you will get the following output:<\/p>\n
Welcome to the MariaDB monitor. Commands end with ; or \\g.\r\nYour MariaDB connection id is 5\r\nServer version: 5.5.60-MariaDB MariaDB Server<\/pre>\nWe have successfully installed and connected to the MariaDB database server. You can type ‘exit’ to exit the interface.<\/p>\n