linux安装配置apache服务(httpd)

1. 安装 httpd.
[root@linuxprobe ~]# yum -y install httpd
2. 删除默认欢迎页面
[root@linuxprobe ~]# rm -f /etc/httpd/conf.d/welcome.conf
3. 配置httpd,将服务器名称替换为您自己的环境
[root@linuxprobe ~]# vi /etc/httpd/conf/httpd.conf
4. line 86: 改变管理员的邮箱地址
ServerAdmin root@linuxprobe.org
5. line 95: 改变域名信息
ServerName www.linuxprobe.org:80
6. line 151: none变成All
AllowOverride All
7. line 164: 添加只能使用目录名称访问的文件名
DirectoryIndex index.html index.cgi index.php
[root@linuxprobe ~]# systemctl start httpd [root@linuxprobe ~]# systemctl enable httpd 8. 如果Firewalld正在运行,请允许HTTP服务。,HTTP使用80 / TCP [root@linuxprobe ~]# firewall-cmd --add-service=http --permanent success [root@linuxprobe ~]# firewall-cmd --reload success 9. 创建一个HTML测试页,并使用Web浏览器从客户端PC访问它。如果显示以下页面,是正确的 [root@linuxprobe ~]# vi /var/www/html/index.html <html> <body> <div style=" 100%; font-size: 40px; font-weight: bold; text-align: center;"> Welcome access LinuxProbe.org,This is Test Page! </div> </body> </html>
原文地址:https://www.cnblogs.com/herc/p/7280900.html