一定查看日志,根据日志来排除问题 website-error.log
httpd.conf 注释放开
ServerName localhost:80防火墙
a.查看已开放的端口(默认不开放任何端口)
firewall-cmd --list-ports
b.开启80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent静态文件加权限
chmod +755 *环境变更至指定环境
chcon -R -t httpd_sys_content_t /cqdata/website/
静态页面
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/cqdata/website"
DirectoryIndex index.html
<Directory "/cqdata/website">
Options -Indexes +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "/var/log/httpd/website-error.log"
CustomLog "/var/log/httpd/website.log" common
</VirtualHost>
反向代理
<VirtualHost *:80>
ServerName www.abc.com
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ErrorLog "/etc/httpd/logs/error_log"
CustomLog "/etc/httpd/logs/access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerName abc.com
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ErrorLog "/etc/httpd/logs/error_log"
CustomLog "/etc/httpd/logs/access_log" common
</VirtualHost>
<virtualHost *:80>
ServerName image.abc.com
DocumentRoot /alidata/imageserver/decoration
<Directory "/alidata/imageserver/decoration">
Options Indexes FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "/etc/httpd/logs/image_error_log"
CustomLog "/etc/httpd/logs/image_log" common
</VirtualHost>