Your Own WebServer on Centos 7

in #webserver7 years ago (edited)

Install httpd to configure Web Server. HTTP uses 80/TCP.
[1] Install httpd.
[root@centos7apacheserver ~]# yum -y install httpd

remove welcome page

[root@centos7apacheserver ~]# rm -f /etc/httpd/conf.d/welcome.conf
[2] Configure httpd. Replace server name to your own environment.
[root@centos7apacheserver ~]# vi /etc/httpd/conf/httpd.conf

line 86: change to admin's email address

ServerAdmin [email protected]

line 95: change to your server's name

ServerName centos7apache.example.com:80

line 151: change

AllowOverride All

line 164: 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

keepalive is ON

KeepAlive On
[root@centos7apacheserver ~]# systemctl start httpd
[root@centos7apacheserver ~]# systemctl enable httpd
[3] If Firewalld is running, allow HTTP service. HTTP uses 80/TCP.
[root@centos7apacheserver ~]# firewall-cmd --add-service=http --permanent
success
[root@centos7apacheserver ~]# 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.
[root@centos7apacheserver ~]#
[root@centos7apacheserver ~]# echo "STEEMIT WEB SERVER" >> /var/www/html/index.html
[root@centos7apacheserver ~]#

Sort:  

thanks! It is helpful!

anytime if you have any request topics. Please feel free to ask