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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
![Reply](https://www.linuxquestions.org/questions/images/buttons/reply.gif) |
01-29-2005, 01:10 AM
|
#1
|
Member
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244
Rep:
|
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!?)
|
|
|
01-30-2005, 10:41 AM
|
#2
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
My guess would be since you have everything served out of that webapps directory, its mixing them up.
|
|
|
03-20-2005, 09:46 PM
|
#3
|
Member
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244
Original Poster
Rep:
|
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..
|
|
|
03-20-2005, 11:42 PM
|
#4
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
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.
|
|
|
03-22-2005, 08:51 AM
|
#5
|
Member
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244
Original Poster
Rep:
|
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?
|
|
|
All times are GMT -5. The time now is 11:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|