2

Hi all I am very new to this. I have a local intranet running an apache server. To access the web application, I am using the URL localhost:2130/app/. I would like to change it to something like www.app.com. Is this even possible?

well, if I edit my local hosts file to say "localhost:2130/app/ app", i can go to the page by just typing "app" in the URL address but this only works on my local machine. If I want to access it on other computers, I have to update the hosts file on those computer too. I don't want to update the file on every computer. And is wondering if you can do this on the server.

onesith
  • 123
  • 4

2 Answers2

1

The hosts file will allow you to point a name to an IP, but it won't go any further than that.

Do you run an internal DNS server for your network? Do you have a local domain for your local network? If you run a local domain for your local network you can add entries in there to point the IP for the name to that host, which would mean you don't need to apply it to all your local servers.

As for the Apache side, you may want to look at virtual hosts. An example might be something like this:

<VirtualHost 1.2.3.4:2130>
    DocumentRoot    /path/to/yourapp
    ServerName      yourapphostname
</VirtualHost>

There are plenty of examples in the Apache documentation on how to set that up.

Jon Angliss
  • 1,782
  • 10
  • 8
  • Thank you. I tried to implement this but didn't think about the missing ingredient, the DNS server. – onesith May 12 '10 at 19:58
0

This question may have a better answer here:

https://stackoverflow.com/a/12089724/463994

This can be achieved by using Alias or AliasMatch directive. More details can be found here:

http://httpd.apache.org/docs/2.2/mod/mod_alias.html

Alias /first_url/ /var/www/first_url_resources
MountainX
  • 681
  • 3
  • 12
  • 25