Some help with apache..

javajenius

New Member
Messages
258
Reaction score
0
Points
0
I have my own virtual linux server up and running and i came across a problem.
I created a couple of users, and I need to make each user have his/her own apache web directory root.
Is there anyway to do this automatically or will I have to write my own script?

Like here:

Code:
Listen 80
NameVirtualHost *

<VirtualHost *>
ServerName www.domain.com
DocumentRoot /home/httpd/user1/htdocs/
</VirtualHost>

<VirtualHost *>
ServerName subdomain.domain.com
DocumentRoot /home/httpd/user2/htdocs/subdomain/
</VirtualHost>
 
Last edited:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
* Moved to computers and technology forum, this thread is more about computer configuration than actually programming.
 

javajenius

New Member
Messages
258
Reaction score
0
Points
0
^Actually I think i said that i need to create a script to do this automatically, but its fine.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Looking over the documentation for DocumentRoot (and <VirtualHost>), it looks like your options are to write a script to create the configuration (as you mentioned) or write a module if you want to automatically set DocumentRoot. If you're using Apache 1.3, the source for mod_example may be helpful in writing a module.

Alternatively, if you don't have many users and create new ones infrequently, automatic configuration may not be worth the effort.
 

javajenius

New Member
Messages
258
Reaction score
0
Points
0
Actually, i need do to it automatically (for a project im working on), so i will try to work on it. Thanks for your reply.
 
Last edited:
Top