the problem:
I am running a Windows Vserver and on this server I'm running a standalone Grails app on port 8081, which means that when I open
localhost:8081 (local)
or domain:8081
in the browser, I see the interface of the Grails app.
What I am looking for is a way to type
subdomain.domain
that forwards me to
domain:port
I have read that this can be done using a virtual host on Apache. I used the XAMPP Apache because I'm running XAMPP MySQL anyway. I added this line to the WIndows host file:
127.0.0.1 subdomain.domain
and this part to apache/conf/extra/httpd-vhosts.conf:
<VirtualHost *:80>
ServerName http://localhost
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerName http://subdomain.localhost
Redirect / http://localhost:8081
</VirtualHost>
What I expected:
when I open
domain
I see the xampp admin interfacewhen I open
subdomain.domain
I see the Grails app (asdomain:port
)
What happens:
- no matter wheather I open
domain
odersubdomain.domain
I'm always forwarded todomain:port
What am I doing wrong?
Regards H