Forum Moderators: phranque

Message Too Old, No Replies

VirtualHosts problem, not pointing to the right place

         

yaba

11:54 am on Sep 20, 2010 (gmt 0)

10+ Year Member



My current setup:
/etc/apache2/conf.d/virtual.conf
NameVirtualHost *
And one of the conf files is:

<VirtualHost *>
ServerAdmin polido@gmail.com
ServerName buxstats.com
ServerAlias buxstats.com
DocumentRoot "/var/www/buxstats"
<Directory "/var/www/buxstats">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

/var/www/index.php <- should NEVER show this
/var/www/buxstats <- to domain www.buxstats.com
/var/www/underworld <- to dyndns underworld.ath.cx
/var/www/diaspora/public <- to Diaspora seed (diasporapt.com)

And I have 3 conf files at sites-available, 1 for each domain.

My problem is...
if a user types: [my_ip_address...] it goes to buxstats.com page :| I want this to point at diasporapt.com

if a user types: www.diasporapt.com I want it to redirect to diasporapt.com (because of Diaspora settings and usernames)
however is going to /var/www/buxstats and i don't know why

however, I want to maintain underworld.ath.cx going to /var/www/underworld and leave the www root alone.

Basically what I need is as simple as:
IP_address -> diasporapt.com
www.diasporapt.com -> diasporapt.com
underworld.ath.cx -> page of underworld as defined in docroot
buxstats.com -> www.buxstats.com
www.buxstats.com -> page of buxstats as defined in docroot

Hope I made it clear, otherwise, i'll give further explainations.
Sorry my bad english.
Any help is welcome :D
THANKS

yaba

7:59 pm on Sep 20, 2010 (gmt 0)

10+ Year Member



SOLVED.
Please ignore.
I didn't knew that apache takes by alphabetic order in sites-enabled. (ip default site)
And used rewrite to remove the www
Thanks anyway

jdMorgan

4:12 pm on Sep 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad you got it fixed, yaba!

Jim