Author |
|
Ctechinfo
Joined: 09 Mar 2013 Posts: 3 Location: Augusta, ME
|
Posted: Sun 10 Mar '13 5:04 Post subject: Multiple vhosts 2 work/2 dont |
|
|
I have several sites I am working on, and to do the intial coding/testing I have my desktop and laptop setup with server software so I can get things tweaked without reeking havoc on the live sites (as bad).
When I was using XAMPP for Windows, the domains (actually subdomains of localhost) all worked as intended. But since switching over to Apache/PHP/MySQL, two work and two don't... (The two that don't fallback to the first site's content but has the correct name in the address bar..
Code: |
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/ctechinfoNEW"
ServerName ctechinfo.localhost
ServerAlias ctechinfo.localhost
ErrorLog "logs/ctechinfo.localhost-error.log"
CustomLog "logs/ctechinfo.localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/dslwebserverNew"
ServerName domain4.localhost
ServerAlias dslwebserver.localhost
ErrorLog "logs/domain4.localhost-error.log"
CustomLog "logs/domain4.localhost-access.log" combined
</VirtualHost>
//The following two are the ones that fallback and show the content for the first in the list.
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/timberindustryinformationNEW"
ServerName timberindustryinfo.localhost
ServerAlias timberindustryinfo.localhost
ErrorLog "logs/timberindustryinfo.localhost-error.log"
CustomLog "logs/timberindustryinfo.localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/emachineupgraders"
ServerName emachineupgraders.localhost
ServerAlias emachineupgraders.localhost
ErrorLog "logs/emachineupgraders.localhost-error.log"
CustomLog "logs/emachineupgraders.localhost-access.log" combined
</VirtualHost>
|
Any help would be grately appreciated..
Mod note: removed config comments added code tags |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 11 Mar '13 17:33 Post subject: |
|
|
Which hosts do works, which don't? We are not that good in guessing. |
|
Back to top |
|
pstimpel
Joined: 09 Mar 2013 Posts: 4 Location: DE
|
Posted: Mon 11 Mar '13 17:39 Post subject: |
|
|
James Blond wrote: | Which hosts do works, which don't? We are not that good in guessing. | He pointed it out in the comments |
|
Back to top |
|
Ctechinfo
Joined: 09 Mar 2013 Posts: 3 Location: Augusta, ME
|
Posted: Tue 12 Mar '13 12:15 Post subject: |
|
|
pstimpel wrote: | James Blond wrote: | Which hosts do works, which don't? We are not that good in guessing. | He pointed it out in the comments | Correct..
The timberindustry domain and the emachineupgraders domain are the two that do not work.. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Tue 12 Mar '13 23:09 Post subject: |
|
|
I'm assuming the main host (in httpd.conf) has a document root of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs. If not, change this to match.
I would add a default (fallback) vhost as the first vhost in my config. It only needs a docroot since it will catch everything not configured later.
NameVirtualHost *:80
<VirtualHost _default_:80>
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/ctechinfoNEW"
ServerName ctechinfo.localhost
... |
|
Back to top |
|
Ctechinfo
Joined: 09 Mar 2013 Posts: 3 Location: Augusta, ME
|
Posted: Wed 13 Mar '13 14:59 Post subject: |
|
|
hmm tried that, didn't work either..
will mess with it again later today/tonight when I wake up (work nights/sleep most of the day) |
|
Back to top |
|