CentOS Stream 9 Apache httpd Install examples

Apache httpd : Install

Install Apache httpd to configure Web Server.[1]Install httpd.

[[email protected] ~]# dnf -y install httpd 
# rename or remove welcome page
[[email protected] ~]# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/

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

[[email protected] ~]# vi /etc/httpd/conf/httpd.conf 

# line 91 : change to admin's email address
ServerAdmin [email protected] # line 100 : change to your server's name
ServerName # line 149 : change (remove [Indexes])
Options FollowSymLinks # line 156 : change
AllowOverride All # line 169 : add file name that it can access only with directory's name
DirectoryIndex index.html index.php index.cgi # add follows to the end
# server's response header
ServerTokens Prod [[email protected] ~]# systemctl enable --now httpd

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

[[email protected] ~]# firewall-cmd --add-service=http 
[[email protected] ~]# firewall-cmd --runtime-to-permanent

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

[[email protected] ~]# vi /var/www/html/index.html 

<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page
CentOS Stream 9 Apache httpd Install examples


Leave a Reply

Your email address will not be published. Required fields are marked *