I have two sub domains that are located on different ports.
- www.myexample.com locates on port 83
- blog.myexample.com locates on port 82
I have done the following to my Apache configuration file:
httpd.conf I incude three conf files, proxyserver.conf, mainhtml.conf and sidehtml.conf
The content of proxyserver.conf is
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.myexample.com
ProxyPass / http://localhost:83/
ProxyPassReverse / http://localhost:83/
</VirtualHost>
<VirtualHost *:80>
ServerName blog.myexample.com
ProxyPass / http://localhost:82/
ProxyPassReverse / http://localhost:82/
</VirtualHost>
The content of mainhtml.conf is
Listen *:83
NameVirtualHost *:83
<VirtualHost *:83 >
ServerName www.myexample.com
DocumentRoot "C:\Documents and Settings\test\My Documents\mainhtml"
DirectoryIndex index.html index.php
<Directory "C:\Documents and Settings\test\My Documents\mainhtml">
AddDefaultCharset UTF-8
AllowOverRide none
Options FollowSymlinks
Order allow,deny
Allow from all
RewriteEngine on
RewriteRule ^.*/(.*)$ sysGeneric.php [NC,L]
</Directory>
</VirtualHost>
The content of sidehtml.conf is
Listen *:82
NameVirtualHost *:82
<VirtualHost *:82 >
ServerName blog.myexample.com
DocumentRoot "C:\Documents and Settings\test\My Documents\sidehtml"
DirectoryIndex index.html index.php
<Directory "C:\Documents and Settings\test\My Documents\sidehtml">
AddDefaultCharset UTF-8
AllowOverRide none
Options FollowSymlinks
Order allow,deny
Allow from all
RewriteEngine on
RewriteRule ^.*/(.*)$ sysGeneric.php [NC,L]
</Directory>
</VirtualHost>
Besides that, I also enable the following in my httpd.conf file:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
And also include the following line in my c:/windows/system32/drivers/etc/hosts file:
*my_ip_address* *.myexample.com
But after I restart my computer, when I type in www.myexample.com, I got directed to port 83, which means that the content of blog.myexample.com is shown. When I type in blog.myexample.com, I got redirected to an external websites.
What did I do wrong?