Lỗi 500 proxy vhost Apache

Table of Contents

Lỗi 500 proxy vhost Apache

Nhận dạng

Báo lỗi 500

image

NameVirtualHost *:80

<Directory "D:/web_folder/main.domain/">
    AllowOverride All
    Order Deny,Allow
    Allow from all
</Directory>

<VirtualHost *:80>
    DocumentRoot "D:/web_folder/main.domain/"
    ServerName main.domain
    ErrorLog "logs/main.domain-error.log"
    CustomLog "logs/main.domain-access.log" combined
    <Directory "D:/web_folder/main.domain/">
        AllowOverride All
        # Order Allow,Deny
        Allow from all
        # --New way of doing it
        Require all granted 
    </Directory>
</VirtualHost>

# my_domain.com
<VirtualHost *:80>
    ServerName my_domain.com
    ErrorLog "logs/my_domain.com-error.log"
    CustomLog "logs/my_domain.com-access.log" combined
	<Proxy *>
		Order deny,allow
		Allow from all
	</Proxy>
	ProxyPreserveHost On
	ProxyPass / http://172.0.0.1:8080/
	ProxyPassReverse / http://172.0.0.1:8080/
</VirtualHost>

<VirtualHost *:443>
    ServerName my_domain.com
	SSLEngine On
	SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
	SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
    ErrorLog "logs/my_domain.com-error.log"
    CustomLog "logs/my_domain.com-access.log" combined
    <Proxy *>
		Order deny,allow
		Allow from all
	</Proxy>
	ProxyPreserveHost On
	ProxyPass / http://172.0.0.1:8080/
	ProxyPassReverse / http://172.0.0.1:8080/
</VirtualHost>

Fix lỗi

Lỗi này không phải do cấu hình vhost lỗi mà do chưa LoadModule proxy_http_module

C:\xampp\apache\conf\httpd.conf

LoadModule proxy_http_module modules/mod_proxy_http.so

Đồng thời kiểm tra xem bật vhost chưa

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Leave a Reply

Your email address will not be published. Required fields are marked *