LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-06-2003, 12:13 AM   #1
notstrider
Member
 
Registered: Nov 2002
Distribution: Debian
Posts: 35

Rep: Reputation: 15
apache config and seperate vhost help..


yeah, hey, my question is, i set up all my virtual hosts to goto seperate domains, but the second virtual host, the index file, is getting redirected to the first virtual host.. is there anyway around this? (i hope that makes sense)

also, i need some help on having separate log files for each domain, just on how to do it, thanks.
 
Old 02-06-2003, 12:55 AM   #2
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
check your DocumentRoot entries.
 
Old 02-06-2003, 01:30 AM   #3
notstrider
Member
 
Registered: Nov 2002
Distribution: Debian
Posts: 35

Original Poster
Rep: Reputation: 15
my DocumentRoots' are all correct..
 
Old 02-06-2003, 02:04 AM   #4
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
are all sites set up as virtual host? even your 'main site' should be set up as a vhost. if not, all vhosts will point to the index file of the main site.
 
Old 02-06-2003, 02:26 AM   #5
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Re: apache config and seperate vhost help..

Quote:
Originally posted by notstrider
yeah, hey, my question is, i set up all my virtual hosts to goto seperate domains, but the second virtual host, the index file, is getting redirected to the first virtual host.. is there anyway around this? (i hope that makes sense)
I take it that you've made sure that the DNS side of things is working? Post the vhost(s) section(s) of httpd.conf so we can see what you've got there.

Quote:
Originally posted by notstrider
also, i need some help on having separate log files for each domain, just on how to do it, thanks.
Try something like this...
Code:
<VirtualHost www.servername.net>
    ServerAdmin webmaster@servername.net
    DocumentRoot /httproot/www.servername.net
    ServerName www.servername.net
    ErrorLog /var/log/www.servername.net-error_log
    CustomLog /var/log/www.servername.net-access_log common
</VirtualHost>
HTH

Jamie...
 
Old 02-06-2003, 03:24 AM   #6
notstrider
Member
 
Registered: Nov 2002
Distribution: Debian
Posts: 35

Original Poster
Rep: Reputation: 15
<VirtualHost IP.Address.here>
ServerAdmin webmaster@xxxxx
DocumentRoot /httproot/web1
ServerName www.firstdomain.tld
# ErrorLog logs/host.some_domain.com-error.log
# CustomLog logs/host.some_domain.com-access.log common
</VirtualHost>

<VirtualHost IP.Address.here>
ServerAdmin webmaster@xxxxx
DocumentRoot /httproot/web2
ServerName www.seconddomain.tld
# ErrorLog logs/host.some_domain.com-error.log
# CustomLog logs/host.some_domain.com-access.log common
</VirtualHost>

the logs are directed to /var/log/apache/ , but i want them to be directed to the folder where each domain is, like /web/domain1/logs (for domain one) and /web/domain2/logs (for domain two)
i hope that makes sense.. hehe
 
Old 02-06-2003, 03:32 AM   #7
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
To get the logs to /web/domain1/logs you simply need to have ErrorLog /web/domain1/logs/some_access-log and ensure that whatever user httpd runs as has the ability to write to this directory.

I've also only played with named virtualhosts not IP addressed based virtual hosts. In which case I'm using
Code:
NameVirtualHost www.mainserver.net

<VirtualHost www.mainserver.net>
    ServerAdmin webmaster@mainserver.net
    DocumentRoot /raid/htdocs
    ServerName www.mainserver.net
</VirtualHost>

<VirtualHost www.virtualdomain.net>
    ServerAdmin virtual@virtualdomain.net
    DocumentRoot /raid/virtualdomian.net
    ServerName www.virtualdomain.net
    ErrorLog /var/log/virtualdomain-error_log
    CustomLog /var/log/virtualdomain-access_log common
</VirtualHost>
Remember to apachectl restart or (if you want to be nice) apachectl graceful after any changes.

HTH

Jamie...
 
Old 02-06-2003, 11:34 AM   #8
notstrider
Member
 
Registered: Nov 2002
Distribution: Debian
Posts: 35

Original Poster
Rep: Reputation: 15
i had changed the IP address' to the actual virtual host, it restarts fine, but it's not reading seperate log files for the domains, and the second web domain is reading the index file for the first domain.. heh

*had to edit a word out, since it made no sense* heh.

Last edited by notstrider; 02-06-2003 at 12:00 PM.
 
Old 02-07-2003, 01:08 AM   #9
notstrider
Member
 
Registered: Nov 2002
Distribution: Debian
Posts: 35

Original Poster
Rep: Reputation: 15
ah, nevermind, it's working all good now, i guess i had to wait for my name server to update or something.. hehe, thanks a lot guys.. helped me a lot.
 
Old 02-07-2003, 02:09 AM   #10
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
I've had to wait for DNS records to propagate in the past. Glad its working.

Jamie...
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache ssl on only *one* vhost belorion Linux - Networking 1 12-01-2005 03:59 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
vhost in apache jelgavchik Linux - Networking 3 02-07-2005 06:41 PM
Apache 2 vhost and permissions basse- Linux - Software 1 04-05-2004 07:48 AM
apache 1.3 vhost z4Rilla Linux - Software 0 08-03-2003 06:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration