I'm trying to setup a web development testing server on a LAMP system and I'm having some problems. I'd like to configure the machine to be able to produce a web page if I access it via it's LAN IP, ex: 192.168.111.7 and then supply a username like so: /~user. I'm rather new to Apache, but my understanding is that supplying the /~user at the end of the URL (in this case the local IP) will instruct Apache to direct the request to the /public_html/ directory of the corresponding user. No problem. This seems to work, sorta, and this is where my problem arises.
First off, I can sucessfully bring up a web page on the SERVER using "localhost", which gives me my Default Server page, and then I can also use "localhost/~user" and I'm brought to whatever page I've placed into the public_html. THe problems begin whenever I try clicking on a link; it would appear that access to the /~user directory is not being "jailed", and so when I click a link it seems that instead of using /public_html/ as the root for the site, it's trying to go up further into the users directory, and thus I get a 404 error. I suspect that this is the problem, as I have no issues with this page on it's "live" server, but then again I am using relative linking in my code so that might be something I'll have to take a look at. However, if anyone with more expertise suspects otherwise, I'd love to hear some possible solutions.
Then, my second problem arises when trying to access my web server from another machine. I can access the "home" IP without a problem, so for example typing 192.168.111.7 brings me to whatever I have in /var/www/html just fine, but it's when I try adding a /~user to the end that I'm given a connection refused error when trying to contact 127.0.0.1. So, for some reason, when I try to access the /public_html/ resources on the local web server, I'm rerouted to the home ip address of the machine I'm trying to connect with.
So, I really have no idea what is going on. Like I said, I'm new to Apache (as well as Linux, for the most part), so please bear with me and be as "stupid friendly" as possible. Thanks in advance for all of your time.
(note the trailing slash).
If this works, just to Apache FAQ : http://httpd.apache.org/docs/misc/FAQ.html
Specific to your problem: http://httpd.apache.org/docs/misc/FAQ.html#set-servername