LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-29-2005, 01:10 AM   #1
viniosity
Member
 
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244

Rep: Reputation: 30
strange vhosts prob w/ apache2


Ok, virtual hosts is working for me. But the problem is that the search engines (yahoo, google) are picking up pages that are for domain1 with domain2. For example, let's say domain1 is a petstore like petstore.com and domain2 is a car store like cars.com. When you do a search on yahoo for car parts one of the hits comes out as http://petstore.com/carparts.html when it should be http://cars.com/carparts.html. That's confusing and I'd like to stop it...

Here is my apache2 vhosts section:

<VirtualHost *>
ServerName www.cars.com
ServerAlias cars.com
ServerPath /cars/
DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/cars
ErrorLog logs/cars.com-error_log
</VirtualHost>
<VirtualHost *>
#ServerAdmin webmaster@petstore.com
ServerPath /petstore/
ServerName www.petstore.com
ServerAlias store.petstore.com petstore.com
DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/petstore
ErrorLog logs/petstore.com-error_log
#CustomLog logs/petstore.com_log common

Is the error above somewhere or maybe somewhere else in my apache2 httpd.conf file? There are some other suspicious parts of my httpd.conf file that I haven't changed for fear of breaking something that works. One is a line that shows the serverroot to be:

ServerRoot "/usr/local/apache2"

I also have these two lines that are suspect:
DocumentRoot "/usr/local/apache2/htdocs"
DocumentRoot "/usr/local/jakarta-tomcat-3.3.1/webapps"

Am I way off base? Anyone have any ideas? (maybe it's just the wrong html!?)
 
Old 01-30-2005, 10:41 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
My guess would be since you have everything served out of that webapps directory, its mixing them up.
 
Old 03-20-2005, 09:46 PM   #3
viniosity
Member
 
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244

Original Poster
Rep: Reputation: 30
Just for grins I changed the DocumentRoot for one of the sites but I'm still having the same problem:

www.petstore.com gives me the right site
www.cars.com gives me the right site

but

www.petstore.com/cars/ gives me the cars.com site
www.petstore.com/petstore/ gives me the petstore site
www.cars.com/petstore/ gives me the petstore site
www.cars.com/cars/ gives me the cars site

I am just absolutely confused. Ready to blast the server and try all over again..
 
Old 03-20-2005, 11:42 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
You need to set the DocumentRoot of each vhost to the top level directory of each site. These should be separate directories and should not have any hard or symbolic links between them. That ServerPath directive you have may be what's giving you problems -- I've never seen it used (just the DocumentRoot). Are you using Tomcat? I know Tomcat does some strange things with paths, but I haven't played around with it enough to know the exact details.
 
Old 03-22-2005, 08:51 AM   #5
viniosity
Member
 
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244

Original Poster
Rep: Reputation: 30
I am using tomcat..

Quote:
You need to set the DocumentRoot of each vhost to the top level directory of each site.
I thought I was? Do you mean something different than this:
Code:
 DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/cars
Also, I tried it without the ServerPath statement but unfortunately it didn't make a difference. Any other ideas?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange prob Pr_009 Fedora 5 03-01-2006 09:53 PM
debian, apache2, ipcop and vhosts not working TheSpork Linux - Networking 1 06-04-2005 06:01 PM
Apache2 & SSL, strange behaviour [GOD]Anck SUSE / openSUSE 2 03-29-2005 03:49 AM
Strange cdbakeoven prob! Braveheart1980 Linux - Software 4 02-05-2004 05:57 PM
strange install prob spooge Linux - General 2 04-07-2003 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:58 PM.

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