要求搭建web服务器通过端口10000能够访问到页面内容为“小胖,你怎么这么胖呢!”
第一步:创建网站目录,将文件放在/www/10000下
[root@catyuan ~]# mkdir /www/10000
第二步:修改配置文件
[root@catyuan ~]# vim /etc/httpd/conf.d/vhosts.conf
LISTEN 10000
<VirtualHost 192.168.198.10:10000>
DocumentRoot "/www/10000"
ServerName 192.168.198.10
ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common
</VirtualHost>
第三步:写入内容
[root@catyuan ~]# echo 小胖你怎么这么胖! > /www/10000/index.html
第四步:重启测试
[root@catyuan ~]# systemctl restart httpd.service