LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Virtual Host acting funny (https://www.linuxquestions.org/questions/linux-newbie-8/virtual-host-acting-funny-298429/)

eckertc1 03-06-2005 03:39 PM

Virtual Host acting funny
 
hello,

i have done the following:

set up apache 2 server correctly.
added virtual hosts and tested them (they work!!)
added vsftp so i could upload my pages (working great)

then i simply ran through and tested everything one last time and went to bed for the night. the problem is, when i woke up this morning, both mysite1 and mysite2 URLs default to mysite1 page.

how could this change on its own over night. and what could have changed. i checked my httpd.conf file with the back up i made after i had all working and they match perfectly.

here is a look at my httpd.conf. hope someone can help me out with this confusing problem.

### Section 3: Virtual Hosts

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.mysite1.com
ServerAlias mysite1.com *.mysite1.com
DocumentRoot /var/www/mysite1
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/mysite1">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.html
</VirtualHost>

<VirtualHost *:80>
ServerName www.mysite2.com
ServerAlias mysite2.com *.mysite2.com
DocumentRoot /var/www/mysite2
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/mysite2">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.html
</VirtualHost>

eckertc1 03-06-2005 04:22 PM

bump

eckertc1 03-06-2005 05:20 PM

bump 2

KimVette 03-06-2005 05:30 PM

Just FYI you should not ever bump any thread within 24 hours of the last post. It's bad netiquette not to mention against the rules here. I figured I'd warn you before the mods spank you.

Anyway: Just to cover the basics to make sure you tested properly:

1. Is the DNS external to this box and do both domains resolve correctly?
2. Does your browser support and is it configured for http 1.1 and not http 1.0? (some browsers still allow you to force it to http 1.0 for compatibility testing purposes)
3. Did you restart httpd? (on some distros you run apachectl restart and on others you run /etc/init.d/apache2 restart and yet others require you to run httpd restart in order to reload httpd.conf

Now don't get me wrong; you did state it was working last night but I'm asking these to cover the basics. e.g., if you were testing from an IDE like Quanta or Eclipse, you may have been testing via the filesystem and not via http.

Edit: Also, check for trailing spaces, and be sure the file is saved as raw ASCII if you used a richtext-capable editor. In GUI environments, especially OS/X for example, saving config files as richtext or unicode is a common user error. Everything "looks" OK until you view it with a tool like cat, pico, or vi.

eckertc1 03-06-2005 05:41 PM

thank you for the reply, and the warning about bumps, i did not realize that was a no no. ill try suggestions you offered and see if that helps out. :)


All times are GMT -5. The time now is 12:20 AM.