|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
1) If some one tries to access http://domain.com then apache looks in
/www/docs/domain.com If someone wants www.domain.com then looks for /www/docs/www.domain.com I'd like it to use /www/docs/domain.com is this possible, and how? Using mod rewrite? 2) Using mod_vhost_alias prevents me from providing logs to different log files. Is there a script that will read the log file each day and split it into files for each domain name? Thanks |
|
#2
|
|||
|
|||
|
1) Start here -> http://www.apache.org/docs/mod/core.html#serveralias
2) Start here -> http://www.apache.org/docs/mod/mod_log_config.html#customlog You need to place it within <VirtualHost> block. You haven't RTFM enough. |
|
#3
|
|||
|
|||
|
Are you sure that you read my question? I'm using mod_vhost_alias, and the documentation on that says that it isn't possible to direct loging to individual files.
Both of your links deal with features that as far as the documentation on the apache mod_vhost_alias is concerned isn't available. As I'm not in a position with this to use name based virtual hosts. |
|
#4
|
|||
|
|||
|
This is the entry in httpd.conf
<VirtualHost 212.69.205.32> VirtualDocumentRoot /www/vhtdocs/%0/ </VirtualHost> Using the mod_vhost_alias this will be the only entry required to serve any number of domain names. A request to www.domain.com would come from /www/vhtdocs/www.domain.com whereas http://domain.com would return a 404 error. I'd like domains to work both with and without the www. while using the mod_vhost_alias module. |
|
#5
|
|||
|
|||
|
If you want www.domain.com and domain.com to have the same content you can do one of two things. For both, you'll need to create the directory domain.com alongside www.domain.com. Then you can either have an index in domain.com that redirects to www.domain.com or set up symbolic links for the entire directory structure.
Redirection is, IMHO, the best solution since you don't want to have to re do the links every time you add a new file or sub-directory. |
|
#6
|
|||
|
|||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by rod k:
If you want www.domain.com and domain.com to have the same content you can do one of two things. For both, you'll need to create the directory domain.com alongside www.domain.com. Then you can either have an index in domain.com that redirects to www.domain.com or set up symbolic links for the entire directory structure. Redirection is, IMHO, the best solution since you don't want to have to re do the links every time you add a new file or sub-directory.[/quote] Try VirtualDocumentRoot /usr/www/%-2.0.%-1/htdocs VirtualScriptAlias /usr/www/%-2.0.%-1/cgi-bin/ That will take the last part and second to last part of www.domain.com. |
|
#7
|
|||
|
|||
|
hi, does anyone have an answer to the first question in this thread:
2) Using mod_vhost_alias prevents me from providing logs to different log files. Is there a script that will read the log file each day and split it into files for each domain name? i could really use such a script... Andy Nash |
|
#8
|
|||
|
|||
|
I have it setup with /home/vhosts and in the vhosts I have symbolic links
ln -s /home/username domain.com In the home directorys I have a web directory and a logs directory. You can use :- LogFormat "%V|%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"" TransferLog |/usr/sbin/logger UseCanonicalName Off VirtualDocumentRoot /home/vhosts/%-2.0.%-1/web VirtualScriptAlias /home/vhosts/%-2.0.%-1/web/cgi-bin/ /usr/sbin/logger would contain #!/usr/bin/perl $|=1; while (<STDIN> ) { ($user, $the_info) = split(/|/,$_); if ($user ne "-") { $log_file = "/home/vhosts/$user/logs/access_log"; if (open(LOG_FILE,">>$log_file")) { print LOG_FILE "$the_info"; close(LOG_FILE); } } } You still don't get the error logs but you do get a real time access log for all users ------------------ Regards Darren -- http://www.php4hosting.com/ $ http://www.php4hosting.co.uk/ £ PHP/MySQL Enabled Hosting/Dedicated Servers, Reseller Accounts |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > mod_vhost_alias |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|