View previous topic :: View next topic |
Author |
Message |
Retriever II Tux's lil' helper
Joined: 07 Sep 2003 Posts: 93 Location: Northampton, MA, USA
|
Posted: Sun Oct 05, 2003 6:47 pm Post subject: Apache and the Document Root |
|
|
This problem is probably a bit different than you thought when you looked at the title.
Basicly, I have my public directory that I set my document root to, which I can access just fine by typing int my ip or hostname. Peachy. Moving on then. In addition, I traditionally had several userdirs (when I ran apache under windows) for different script sets I was working on. These also work, with one exception. The document root points to the document root set in the config file, but I don't know how to get it to point to the user directory instead (which it did under windows).
For example:
http://h0050BF78AF35.ne.client2.attbi.com
points to: /home/www/www
Document root: /home/www/www
http://h0050BF78AF35.ne.client2.attbi.com/~hocuspocus
points to /home/hocuspocus/www
Document root: /home/www/www
I want the document root to match the user, but for the life of me I can't seem to get it to work. I've also been experimenting with vHosts to do this, and I've been able to do it, but I can't resolve the names without adding them to my hosts file, so I havea feeling I'd need to rely on an external service to accomplish this.
Now, to sum up what I'm looking to do, I don't care if I have to use the userdir method, or vhosts, as long as the document root is set correctly, and I don't need to rely on an external service, like a dns service. All I've got to work with that I know for fact will not change is my hostname. Any ideas what I could do to get the document root correct for userdirs, or if I can accomplish vHosts without relying on an external service (which I'm doubting)? |
|
Back to top |
|
|
sschlueter Guru
Joined: 26 Jul 2002 Posts: 578 Location: Dortmund, Germany
|
Posted: Sun Oct 05, 2003 7:39 pm Post subject: |
|
|
Mh, maybe I'm missing something but it seems to be that this can easily be done using the mod_userdir module. "~hocuspocus" would then point to "/home/hocuspocus/public_html/". And if it's "public_html" that bothers you, you can change that. See /etc/apache2/conf/commonapache2.conf:
Code: |
###
### UserDir: The name of the directory which is appended onto a user's home
### directory if a ~user request is received.
###
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
|
|
|
Back to top |
|
|
Retriever II Tux's lil' helper
Joined: 07 Sep 2003 Posts: 93 Location: Northampton, MA, USA
|
Posted: Sun Oct 05, 2003 10:55 pm Post subject: |
|
|
I am doing that, and it does point to /home/hocuspocus/www
BUT
I need the document root that apache reports when viewing pages to also point to that, and this is the first time I've had this kind of problem before. As I said, in Windows the document root changed with the user specified instead of pointing to the 'default' directory. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|