Question

I use tomcat 7.0.42 on Ubuntu Linux 12.10. I point my browser to http://localhost:8080/myapp Can I create a virtual host in ubuntu which would allow me to hit the same address as

http://myapp.com

Basically creating an alias for localhost:8080/myapp as myapp.com?

Was it helpful?

Solution

open file

/etc/hosts

and add those lines:

127.0.0.1 myapp.com

127.0.0.1 www.myapp.com

this will tell the operation system not to look for myapp.com IP address but to use localhost instead.

OTHER TIPS

Another solution:

open a new file, with .pac extention, those files are used by firefox to determine proxies, copy this to the content of the file:

function FindProxyForURL(url, host) {
    if (host=='www.myapp.com'){
        return 'PROXY 127.0.0.1:8080';
    }
    // All other domains should connect directly without a proxy
    return "DIRECT";
}

go to FF proxy settings under "url for automatic proxy configuration" and enter the path to that file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top