Configuration steps for simple Web sites in CentOS6 and CentOS7

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.