A simple configuration example of a Web site in CentOS6:
1. Install httpd:
~]# Yum install-y httpd httpd-manual httpd-tools//Required documentation files for installing HTTPD applications
2. Ensure that the SELinux and iptables firewalls do not interfere with the provision of httpd services:
SELinux configuration:
~]# Getenforce//view selinux status
Enforcing
~]# Setenforce 0//Set SELinux to
Firewall:
~]# IPTABLES-VNL//view host for firewall status
If there is a firewall rule in its execution result
, the following processing is required:
~]# service iptables stop//stops firewall services, limited to lab environment shutdown
~]# chkconfig iptables off//Set Firewall service on start-up shutdown
~]# iptables-f
3. Add an HTML document:/var/www/html/index.html
4. Start the HTTPD service
~]# Service httpd Start
5. Monitoring service startup is normal:
~]# SS-TNL | grep httpd//Listener port number, check whether the httpd service is turned on, the general default is 80
~]# PS aux | grep httpd//See if the process has httpd process enabled
~]# Service httpd Status//view state of HTTPD services
6. Set the HTTPD service to boot automatically:
~]# Chkconfig httpd on
7. Access the created IP address on the local client host:
Second, the CentOS7 simple Web site Configuration example:
1. Install httpd:
Yum install-y httpd httpd-manual httpd-tools
2. Ensure that the SELinux and iptables firewalls do not interfere with the provision of httpd services:
SELinux configuration:
~]# Getenforce
Enforcing
~]# Setenforce 0
Firewall:
~]# IPTABLES-VNL
If there is a firewall rule in its execution result, the following processing is required:
~]# systemctl Disable Firewalld.service
~]# Systemctl Stop Firewalld.service
~]# iptables-f
3. Add an HTML document:/var/www/html/index.html
4. Start the HTTPD service:
~]# systemctl Start httpd
5. Monitoring service startup is normal:
~]# SS-TNL | grep httpd
~]# PS aux | grep httpd
~]# systemctl Status Httpd.service
6. Set the HTTPD service to boot automatically:
~]# Systemctl Enable Httpd.service
7. Accessing the created IP address on the local client host is OK.
Configuration steps for simple Web sites in CentOS6 and CentOS7