Install HTTPD

Install Apache httpd to configure Web Server.

[1] Install Apache httpd.

[root@futurelinux ~]# dnf install httpd -y

# remove welcome page
[root@futurelinux ~]# rm -f /etc/httpd/conf.d/welcome.conf

[2] Configure httpd. Replace server name to your own environment.

[root@futurelinux ~]# vi /etc/httpd/conf/httpd.conf

# line 89: change to admin's email address
ServerAdmin [email protected]

# line 98: change to your server's name

# line 147: change (remove [Indexes])
Options FollowSymLinks

# line 154: change
AllowOverride All

# line 167: add file name that it can access only with directory's name
DirectoryIndex index.html index.cgi index.php

# add follows to the end
# server's response header
ServerTokens Prod

[root@futurelinux ~]# systemctl start httpd
[root@futurelinux ~]# systemctl enable httpd
Created symlink /etc/systemd/system/ β†’ /usr/lib/systemd/system/httpd.service.

[3] If Firewalld is running, allow HTTP service. HTTP uses 80/TCP.

[root@futurelinux ~]# firewall-cmd --permanent --add-service=http
[root@futurelinux ~]# firewall-cmd --reload

[4] Create a HTML test page and access to it from client PC with web browser. It's OK if following page is shown.

[root@futurelinux ~]# echo "Test Page" > /var/www/html/index.html