How to Change the Default Port Number of Lighttpd Web Server 1.4.54 on CentOS 7.6

Change the default port number of Lighttpd 1.4.54

Information

Document root Directory /var/www

Main COnfiguration file /etc/lighttpd/lighttpd.conf

Customised Configuration file /etc/lighttpd/conf.d/<*>.conf

Log /var/log/lighttpd

Default port number 80

Procedure:

Check the version of lighttpd as follows

root@linuxhelp ~]# lighttpd -version
lighttpd/1.4.54 (ssl) - a light and fast webserver

Check the status of lighttpd service

root@linuxhelp ~]# systemctl status lighttpd
● lighttpd.service - Lightning Fast Webserver With Light System Requirements
   Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-06-19 15:46:16 IST; 1h 19min ago
 Main PID: 559 (lighttpd)
    Tasks: 1
   CGroup: /system.slice/lighttpd.service
           └─559 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

Check the listening port number of lighttpd using netstat

[root@linuxhelp ~]# netstat -tulpn | grep lighttpd
tcp6       0      0 :::80                   :::*                    LISTEN      559/lighttpd        

Edit the configuration file of lighttpd

[root@linuxhelp ~]# vim /etc/lighttpd/lighttpd.conf
Server port=8989

Restart the service of Lighttpd as follows

[root@linuxhelp ~]# systemctl restart lighttpd.service

Verify the listening port number of lighttpd

[root@linuxhelp ~]# netstat -tulpn | grep lighttpd
tcp6       0      0 :::8989                 :::*                    LISTEN      3708/lighttpd       

Open the browser and type “localhost:8989” as follows. Verify the lighttpd with port number 80 With this,Default port number of Lighttpd web server 1.4.54 version has been changed successfully and the process ends here.

FAQ
Q
What does CGI mean in lighttpd?
A
The Common gateway Interface is a standard way for a web server which passes web user's request to an application program and gets the data from the application to the user in lighttpd.
Q
What does CGI mean in lighttpd?
A
The COmmon gateway Interface is a standard way for a web server which passes web user's request to an application program and gets the data from the application to the user in lighttpd.
Q
What does FASTCGI server in lighttpd?
A
FASTCGI program manages multiple CGI requests within a single proccess which saves program instructions for each request in lighttpd.
Q
How to change the port number of lighttpd?
A
Edit the line "server port= in the /etc/lighttpd/lighttpd.conf and save the file to change the port number of lighttpd by restarting the service of lighttpd.
Q
Where could i access the logs of lighttpd?
A
Under /var/log/lighttpd ,you could access the logs of lighttpd