一定查看日志,根據(jù)日志來排除問題 website-error.log
httpd.conf 注釋放開
ServerName localhost:80防火墻
a.查看已開放的端口(默認(rèn)不開放任何端口)
firewall-cmd --list-ports
b.開啟80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent靜態(tài)文件加權(quán)限
chmod +755 *環(huán)境變更至指定環(huán)境
chcon -R -t httpd_sys_content_t /cqdata/website/
靜態(tài)頁面
<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>