Operating System - Linux
1828031 Members
1770 Online
109973 Solutions
New Discussion

apache virtual hosts question

 
Sriram Rajan
Occasional Contributor

apache virtual hosts question

Version: apache 2.0.46
System: Linux

I have a vitual host


Documentroot /home
ServerName www.myname.edu
ErrorLog /var/log/default.log
CustomLog /var/log/error.log



# other directives




I want httpd to log requests and errors from "/home/*/*/public_html" to
different files

Can I do this by creating another virtual host ??
The server name has to be the same so whatever I tried doesn't work.
I am using the NameVirtualHost directive.

Any other way to do it ?

Thanks,
Sriram

3 REPLIES 3
Stuart Browne
Honored Contributor

Re: apache virtual hosts question

From what I can tell in the documentation, there's nothing stopping you from doing:


# other directives
CustomLog /var/log/home-access.log
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: apache virtual hosts question



ServerAdmin sprotter@investmenttool.com
DocumentRoot /home/webusers/loweslaw/htdocs
ServerName loweslaw.com
ScriptAlias /cgi-bin/ "/home/webusers/loweslaw/cgi-bin/"
ErrorLog logs/loweslaw.com.error_log
CustomLog logs/loweslaw.com.access_log common



Thats a working Virtual Host entry, note that error logs and access log is redirected to the location of my choice.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Avinoam
Frequent Advisor

Re: apache virtual hosts question

if i understand correctly you would like to enable the users web-sites from the public_html directory in their home folders .
so .. you cannot do that by virtual host decleration . what you need to do is that :

1. creat the folder public_html in your user home folder

2. comment out the line : UserDir disable
in your /etc/httpd/conf/httpd.conf
3. uncomment (enable )the following line : UserDir public_html in your /etc/httpd/conf/httpd.conf file

4. change the permmision of the home folder that contain the public_html to 711

5. change the permmision for the public_html and the docs in it to 755

6. restart your httpd service and have fun.
Sababa