Build httpd-2.4 on CentOS7.2

Source: Internet
Author: User
<span id="Label3"></p><p><p>Build httpd-2.4 on CcentOS7.2<br><br>1. Experimental requirements:<br><br>1, the establishment of httpd services, requirements:<br>(1) provide two name-based virtual host www1, www2; There are separate error logs and access logs;<br>(2) provide status information through WWW1 's/server-status, and only allow Tom user access;<br>(3) WWW2 does not allow access to any host in the 192.168.0.0/24 network;<br>2. Provide HTTPS service for the 2nd virtual host above<br><br>2. Experimental environment:<br><br>Linux Server OS version: CentOS release 7.2 (Final) ip:172.16.250.60<br>WIN7 system Client: ip:172.16.250.100<br><br>3. Experimental prerequisites:<br>1) Turn off firewall and SELinux<br>~]# Systemctl Stop Iptables<br>~]# Setenforce 0<br><br>4. Experimental Process:<br><br>1. Provide two name-based virtual host www1, www2; There are separate error logs and access logs<br><br>first, Installation Services<br><br>1) Yum Installation httpd-2.4<br>~]# Yum Install httpd-y</p></p><p><p>~]# Rpm-qa httpd</p></p><p><p>~]# RPM-QL httpd<br>/etc/httpd<br>/var/log/httpd<br>/var/www/html</p></p><p><p>~]# RPM-QC httpd<br>/etc/httpd/conf/httpd.conf<br>/etc/sysconfig/httpd<br>/etc/httpd/conf.d/welcome.conf</p></p><p>~]# systemctl Restart Httpd.service<br>~]# SS-LNT<br>LISTEN 0:: £ º::*<br><br>second, Create a virtual host<br><br>~]# cat/etc/httpd/conf.d/www1.conf<br><virtualhost 172.16.250.60:80><br>ServerName www1.magedu.com<br>Documentroot/data/vhosts/www1<br>Errorlog Logs/www1-error_log<br>Customlog Logs/www1-access_log combined<br><directory "/data/vhosts/www1" ><br>Options None<br>AllowOverride None<br>Require all granted<br></Directory></p><p><p></VirtualHost></p></p><p><p>~]# cat/etc/httpd/conf.d/www2.conf<br></p></p><p><virtualhost 172.16.250.60:80><br>ServerName www2.magedu.com<br>Documentroot/data/vhosts/www2<br>Errorlog Logs/www2-error_log<br>Customlog Logs/www2-access_log Combiend<br><directory "/data/vhosts/www2" ><br>Options None<br>AllowOverride None<br>Require all granted<br></Directory><br></VirtualHost><br><br>third, Modify the configuration parameters:<br><br>Note: fqdn-based Virtual hosts no longer require specialized directives Namevirtualhost<br><br>1) back up the original configuration file<br>~]# cp-p httpd.conf Httpd.conf.bak<br> <br>2) Create the site directory:<br>~]# mkdir-pv/data/vhosts/www{1,2}<br><br>3) Create Access Home page<br>~]# echo "

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.