[1]Install Httpd for Centos7-media
# yum --enablerepo=centos7-media -y install httpd Installed: httpd.x86_64 0:2.4.6-18.el7.centos
[2]start httpd,开机启动
# 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 httpd
http://$ip/
[4]configure httpd server
# rm -f /etc/httpd/conf.d/welcome.conf #删除默认欢迎界面 # vi /etc/httpd/conf/httpd.conf 86 ServerAdmin [email protected] 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!
centos7 install httpd
时间: 2024-10-13 18:38:41