- systemctl stop firewalld
- setenforce 0
- cd /etc/httpd/conf.d/
- vim openlab.conf
- **
- <VirtualHost 192.168.170.100:80>
- DocumentRoot /www/openlab
- ServerName 192.168.170.100
- </VirtualHost>
- <Directory /www>
- AllowOverride none
- Require all granted
- </Directory>
- **
- vim /etc/hosts
- **
- 192.168.170.100 www.openlab.com
- **
实现的结果:
修改 cd /etc/httpd/conf.d/配置文件即可
具体步骤:
- vim openlab.conf
- **
- <VirtualHost 192.168.170.100:80>
- DocumentRoot /www/openlab
- ServerName 192.168.170.100
- </VirtualHost>
- <Directory /www>
- AllowOverride none
- Require all granted
- </Directory>
- <Directory /www/openlab/data>
- allowOverride none
- Require all granted
- </Directory>
- <Directory /www/openlab/student>
- allowOverride none
- Require all granted
- </Directory>
- <Directory /www/openlab/money>
- allowOverride none
- Require all granted
- </Directory>
- **
- mkdir -p /www/student
- mkdir -p /www/data
- mkdir -p /www/money
- echo this is student > /www/student/index.html
- echo this is ziliao > /www/data/index.html
- echo this is money > /www/money/index.html
-
实现结果:
(1)
(2)