I am working with a web development framework which publish its applications in apache server ports:8080, 8081, 8082, etc.
For instance MyApp1 runs in localhost:808
To make sure I understand what you meant: You want -
http://mydomain1.com
(port 80) - then go to port 8080 on your server;http://mydomain2.com
(port 80) - then go to port 8081 on your server.The only reasonable way (that I know of) you can achieve this in Apache is by using what's called a Reverse Proxy, explained here: http://httpd.apache.org/docs/current/mod/mod_proxy.html
In a nutshell: Define two name-based virtual hosts listening on port 80, each reverse-proxying requests to the "hidden" server. The two definitions would be almost exactly the same.... here's a sketch of one of them, you should be able to conclude the other one.
<NameVirtualHost *:80>
ServerName mydomain1.com
ServerAlias www.domain1.com
... *other aliases as you wish* ...
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</NameVirtualHost>
The above definition causes all HTTP requests coming in on port 80, having "mydomain1.com
" in their "Server path" header (that's standard behavior when someone types in a URL containing a server name; don't worry about it) or any of the mentioned aliases, to be reverse-proxied to "localhost:8080".
Try this and let us know how it went. Good luck!