HTTP Service uses
first, the basic settings of HTTP
1) Install the HTTP service
Yum Install Httpd-y
2) View the default settings for HTTP
164|index.html/* is the default publishing file for HTTP
119|/var/www/html/* is the default
42| Listen/* Default port
3) If you do not turn off the firewall you need to modify the SELinux sticker (ls-zd can see the HTTP Stickers)
Mkdir/www/westos-p
Semanage fcontext-a-t httpd_sys_content_t '/www/westos (/.*)? '
restorecon-rvvf/www/
4) Replace the default publishing directory to restrict IP access
Vim/etc/httpd/conf/httpd.conf
120| DocumentRoot "/www/westos"
121|<directory "/www/westos" >
122| require all granted
</Directory>
121|<directory "/www/westos" >
Require all granted
Order Allow,deny
Allow from all
Deny from 172.25.254.150
126|</directory>
second, set the user landing page
1) Establish user and password
Cd/etc/httpd
HTPASSWD-CM Htpasswdfile Admin
Htpasswd-m Htpasswdfile Westos
121|<directory "/www/westos" >
AllowOverride All
Authuserfile/etc/httpd/htpasswdfile
AuthName "please input username and password"
AuthType Basic
Require Valid-user
</Directory>
2) Create multiple access pages
Mkdir/var/www/virtual/news.linux.com/html-p
Mkdir/var/www/virtual/music.linux.com/html-p
Cd/var/www/virtual/news.linux.com/html
Vim index.html
News.linux.com
Cd/var/www/virtual/music.linux.com/html
Vim index.html
Music.linux.com
cd/etc/httpd/conf.d/
Vim default.conf
<virtualhost_default_:80>
Documentroot/var/www/html
Customlog "logs/default.log" combined
</virtualhost>
<directory "/var/www/html" >
Required all granted
</Directory>
Vim music.conf
<virtualhost *:80>
Servername music.linux.com
Documentroot/var/www/virtual/music.linux.com
Customlog "logs/music.log" combined
</virtualhost>
<directory "/var/www/virtual/music.linux.com/html" >
Required all granted
</Directory>
Vim news.conf
<virtualhost *:80>
Servername news.linux.com
Documentroot/var/www/virtual/news.linux.com
Customlog "logs/news.log" combined
</virtualhost>
<directory "/var/www/virtual/news.linux.com/html" >
Required all granted
</Directory>
Vim/etc/resolv.conf
172.25.254.150 music.linux.com news.linux.com www.linux.com
third, Safe Landing HTTPS
Yum Install Mod_ssl-y
Yum Install Crypto-utils-y
Cd/etc/httpd/conf.d
5| Listen 443 HTTPS
Genkey www.linux.com
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8B/5F/wKiom1hKpt_zP_3ZAASB7n3duUQ556.png-wh_500x0-wm_3 -wmp_4-s_3685986921.png "title=" screenshot from 2016-12-04 16_20_37.png "alt=" WKIOM1HKPT_ZP_3ZAASB7N3DUUQ556.PNG-WH _50 "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8B/5B/wKioL1hKpwSwVnV4AAHzCNspLpE260.png-wh_500x0-wm_3 -wmp_4-s_117116284.png "title=" screenshot from 2016-12-04 16_23_53.png "alt=" wkiol1hkpwswvnv4aahzcnsplpe260.png-wh_ "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8B/5B/wKioL1hKpy-ilE4UAAWRYL6dhJ8253.png-wh_500x0-wm_3 -wmp_4-s_2033047587.png "title=" screenshot from 2016-12-04 16_24_03.png "alt=" WKIOL1HKPY-ILE4UAAWRYL6DHJ8253.PNG-WH _50 "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8B/5F/wKiom1hKp1ryFu_JAAT5W2Ai5OU455.png-wh_500x0-wm_3 -wmp_4-s_4060344143.png "title=" screenshot from 2016-12-04 16_25_02.png "alt=" WKIOM1HKP1RYFU_JAAT5W2AI5OU455.PNG-WH _50 "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8B/5C/wKioL1hKp5GBG3KQAAkyhDMGbu0355.png-wh_500x0-wm_3 -wmp_4-s_3624847321.png "title=" screenshot from 2016-12-04 16_26_40.png "alt=" WKIOL1HKP5GBG3KQAAKYHDMGBU0355.PNG-WH _50 "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8B/5C/wKioL1hKqAjgH8fYAAXIE1wY3Co709.png-wh_500x0-wm_3 -wmp_4-s_4182602902.png "title=" screenshot from 2016-12-04 16_32_03.png "alt=" WKIOL1HKQAJGH8FYAAXIE1WY3CO709.PNG-WH _50 "/>
HTTP and HTTPS simple to use