Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old October 22nd, 2000, 05:03 PM
JGLyons JGLyons is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Rhyl, UK
Posts: 3 JGLyons User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old October 22nd, 2000, 08:38 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #3  
Old October 23rd, 2000, 03:56 AM
JGLyons JGLyons is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Rhyl, UK
Posts: 3 JGLyons User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old October 23rd, 2000, 04:33 AM
JGLyons JGLyons is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Rhyl, UK
Posts: 3 JGLyons User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #5  
Old October 23rd, 2000, 07:33 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 12
Send a message via AIM to 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.

Reply With Quote
  #6  
Old November 22nd, 2000, 08:01 AM
BillCarr BillCarr is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 1 BillCarr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<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.

Reply With Quote
  #7  
Old November 23rd, 2000, 07:16 AM
kourou kourou is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 1999
Location: London UK
Posts: 7 kourou User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #8  
Old November 29th, 2000, 06:35 AM
Carpe Diem
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > mod_vhost_alias


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway