Install HTTPD

Install Apache httpd to configure Web Server.

[1] Install Apache httpd.

[[email protected] ~]# dnf install httpd -y

# remove welcome page
[[email protected] ~]# rm -f /etc/httpd/conf.d/welcome.conf

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

[[email protected] ~]# 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
ServerName futurelinux.org:80

# 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

[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service β†’ /usr/lib/systemd/system/httpd.service.

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

[[email protected] ~]# firewall-cmd --permanent --add-service=http
success
[[email protected] ~]# firewall-cmd --reload
success

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

[[email protected] ~]# echo "Test Page" > /var/www/html/index.html