Forum Moderators: phranque

Message Too Old, No Replies

Strange Problem. Help PLease. httpd.conf weirdness!

httpd.conf problem

         

and1c

9:45 pm on Apr 16, 2007 (gmt 0)

10+ Year Member



ok guys, Ive got a significant problem at the moment which has become apparent since I set up an SSL virtual host.
At present I have say 6 sites on my server and all are virtual hosts.
I have two IPs on the server and only one of them is used for my sites at present. I have recently done a lot of work to my php/mysql based site to make it much more SE friendly so I checked google index for "my domain.com" as its not well ranked enough yet to find for my main keywords.
To my horror I got a load of other site names showing in google all with my main sites content! These domains are mine! and are parked (doing nothing) with my Hosting Provider. After investigation they are pointing to my primary IP that I use for webserving but there are no virtual hosts for them or aliases?!

What could be the problem here? I never had this problem before I setup an SSL enabled virtual host for the payment section of my site (could be coincidence though). This SSL payment gateway all works fine.
I have temporarily reset the DNS on all of the duplicating domain names but its too late to stop my site being multi indexed by the mighty googlebot!

What is weird though is my apache setup only works when my internal IP is used for the virtual hosts? Is this correct? When I change it to my actual external IP none of my sites work?

Heres how my httpd.conf is setup**********************

NameVirtualHost 192.168.**.**:80

<VirtualHost 192.168.**.**:80>
ServerAdmin webmaster@mysite1.com
DocumentRoot /var/www/html/mysite1.com
ServerName mysite1.com
ServerAlias www.mysite1.com mysite1.com
ErrorLog /var/log/httpd/mysite1.com/mysite1.com -errorlog
CustomLog /var/log/httpd/mysite1.com/mysite1.com-accesslog combined
#Options ALL
</VirtualHost>

<VirtualHost 192.168.**.**:80>
ServerAdmin webmaster@mysite2.com
DocumentRoot /var/www/html/mysite2.com
ServerName mysite2.com
ServerAlias www.mysite2.com mysite2.com
ErrorLog /var/log/httpd/mysite2.com/mysite2.com -errorlog
CustomLog /var/log/httpd/mysite2.com/mysite2.com-accesslog combined
#Options ALL
</VirtualHost>

<VirtualHost 192.168.**.**:443>
#SSL (start)
SSLEngine on
SSLOptions +StrictRequire
<Directory />
SSLRequireSSL
</Directory>

SSLProtocol -all +TLSv1 +SSLv3

# Support only for strong cryptography
#and more config options I cant really list :)
# SSL (Ends)
ServerAdmin webmaster@mainsite.com
DocumentRoot /var/www/html/mainsite.com
ServerName secure.mainsite.com
ErrorLog /var/log/httpd/mainsite.com/mainsite-ssl-errorlog
CustomLog /var/log/httpd/mainsite.com/mainsite-ssl-accesslog combined
#Options ALL
</VirtualHost>

Phew! Sorry for the length of this post!
If anyone can help I would be very grateful. thanks

jdMorgan

10:28 pm on Apr 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Apache's default behaviour is to serve the first VirtualHost as the default for any named host that doesn't have it's own VirtualHost container. So ideally, you want to have a 'default/catch-all domain' VirtualHost for those 'parked' domains so that they don't land on your real sites.

See the penultimate paragraph (with bolded text) in the Using Name-based Virtual Hosts section of the Apache Name-based Virtual Hosts [httpd.apache.org] document.

I'm not sure that this had anything to do with SSL -- More likely, it had to do with changes to your VirtualHost containers that you made at the same time as implementing SSL.

Your server works with the 'real' hardware address of the NIC plugged into it, and has no knowledge of the IP address(es) port-forwarded by your modem/router.

Jim

and1c

1:00 am on Apr 19, 2007 (gmt 0)

10+ Year Member



Ahh..gotcha!

many thanks for the info JD
Much appreciated :)