赞
踩
cd /etc/httpd/conf
cp httpd.conf httpd.conf.bak
vim httpd.conf
可以在普通模式下搜索Listen关键字
:/Listen
按n键继续向后搜索
touch /etc/httpd/conf.d/port.conf
echo "Listen 81" > /etc/httpd/conf.d/port.conf
或
touch /etc/httpd/conf.d/port.conf
echo "Listen 192.168.209.137:81" > /etc/httpd/conf.d/port.conf
systemctl reload httpd
firewall-cmd --zone=public --add-port=81/tcp --permanent
firewall-cmd --reload
curl 127.0.0.1:81
或
curl 192.168.209.137:81 #换成自己的IP
cd /var/www/html
rm -rf index.html
echo "hello,openEuler" > index.html
cat index.html
curl 127.0.0.1:81
mkdir /home/source
mv /var/www/html/index.html /home/source/
echo 'DocumentRoot "/home/source"'> /etc/httpd/conf.d/source.conf
vim /etc/httpd/conf.d/source.conf
添加如下内容:
<Directory "/home/source">
AllowOverride None
#Allow open access:
Require all granted
</Directory>
systemctl reload httpd
curl 127.0.0.1:81
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。