[1]Install Httpd for Centos7-mediaphp
# yum --enablerepo=centos7-media -y install httpd Installed: httpd.x86_64 0:2.4.6-18.el7.centos
[2]start httpd,開機啓動html
# systemctl start httpd.service # systemctl enable httpd.service ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[3]Test Access httpdlinux
http://$ip/
centos
# rm -f /etc/httpd/conf.d/welcome.conf #刪除默認歡迎界面 # vi /etc/httpd/conf/httpd.conf 86 ServerAdmin linux_zcy@163.com 95 ServerName mariadb.carso.cn:80 151 AllowOverride All 164 DirectoryIndex index.html index.cgi index.php 配置文件最後添加: ServerTokens Prod # 禁止顯示或發送Apache版本號 KeepAlive On
# systemctl restart httpd.service
# vi /var/www/html/index.html <html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> Welcom to Carson Space! </div> </body> </html>
[5]訪問測試
編輯器
Welcom to Carson Space!ide