清理所有緩存
yum clean all
安裝apache
yum -y install httpd
啟動apache
systemctl start httpd
進入apache的根目錄,創建自己一個新的主頁
cd /var/www/html
vim index.html
網址打開服務器公網ip即可顯示相應內容
119.23.147.159
--------------------------------------------------------------------------------------------------
在主頁顯示名字方法2
systemctl stop firewalld.service
system start httpd
創建用戶
useradd
passwd
chmod 777 /home/用戶名
mkdir /home/用戶名/public_html
cd /home/用戶名/public_html
echo “顯示的內容” >>index.html
vim /etc/httpd/conf.d/userdir.conf
將17行的UserDir disable注釋
24行的UserDir public_html注釋去掉
systemctl restart httpd
http://ip/~用戶名
浙公網安備 33010602011771號