apache userdir subdomains
okay...running apache 1.3.31 as a test server right now(might open it up in the future)
i have added 'www.darkstar.net' as an alias to localhost in /etc/host [* i went ahead and did this because i remember having problems with cookies and session information in xp using 'localhost' as server] http://www.darkstar.net brings up the "it worked!" page in /var/www/htdocs i have read that using userdirs can be dangerous. currently, my permissions are: 755 root:root /home 755 user1:root /home/user1 755 user1:root /home/user1/public_html thinking perhaps these should be: 751 root:root /home 711 user1:root /home/user1 700 user1:root /home/user1/* 755 user1:root /home/user1/public_html i did enable userdirs: <IfModule mod_userdir.c> UserDir disabled root UserDir public_html </IfModule> #[what is the difference between 'UserDir public_html' and "UserDir /home/*/public_html'?] and http://www.darkstar.net/~user1 brings up the index in /home/user1/public_html, BUT i would like to set it up so that http://user1.darkstar.net will access /home/user1/public_html ...and i am not sure if AliasMatch, RewriteRule, or subdomains through VirtualHost would be the best way to achieve this. Does anyone know how production sites deal with this? |
I might recomend virtualhosts. Then all you do is set up a new docs dir, and apache sends all requests for that name to that dir. Much easier and you don't have to screw w/ users home directory permissions. It appears though that you've block your apache user from gaining access to the home directory of the user. If apache can't go there, then it can't go to any subdirectory of that. I might just change the permissions to 750 and change the group of the home directories to that of apache. Personally though, I'd rather use virtualhosts...
|
i just ran across VirtualDocumentRoot in the docs [mod_vhost_alias]
looks promising |
Hmmm, I've never used that, might be promising. Please keep me informed on your results;)
|
UseCanonicalName Off
NameVirtualHost *:80 <VirtualHost *:80> ServerName www.darkstar.net VirtualDocumentRoot /home/%1/public_html </VirtualHost> --------------------------------------------------------- this is working right now for me...i probably will move everything to one folder (eg /usr/local/apache/htdocs/user) where i would just have to change the value of VirtualDocumentRoot. however, i did have to put each site in the /etc/hosts file: 127.0.0.1 localhost 127.0.0.1 darkstar.localhost darkstar 127.0.0.1 www.darkstar.net 127.0.0.1 kodon.darkstar.net is there any way to use a wildcard such as: 127.0.0.1 *.darkstar.net |
Quote:
|
after minor tweaks (trial and error) i now have:
Code:
UseCanonicalName Off |
kondon,
Sorry about the error, I missed the * after the / in your permissions;) Looks good to me though:-D |
All times are GMT -5. The time now is 05:52 PM. |