You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by dasgud <p....@gmail.com> on 2010/11/01 02:58:03 UTC
[users@httpd] I can't get apache to direct to my virtual hosts
I have installed a web server on a localhost with xampp. the apache server is
ver 2.2 on a win xp pro (sp3) desktop. I've been reading the documentation
and forums for 2 days and follow all the directions I found to modify my
httpd-vhosts.conf file but it still doesn't work as I wish it to. I have 2
domains on the localhost with very different content, when I type either
url, only one of the sites displays.
my folders are set up like: c:/xampp/site1 and c:/xampp/site1/site2. I think
this may be the issue, and if so, then I need to go to another forum for
installation answers.
This is how I have configured httpd-vhosts file:
<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/server/xampp/site1/"
ServerName site1.com
ServerAlias www.site1.com
##ErrorLog "logs/dummy-host.localhost-error.log"
##CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host2.localhost
##DocumentRoot "C:/server/xampp/site1/site2"
ServerName site2.com
ServerAlias www.site2.com
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
since I've been trying for 2 days to make something apparently simple work,
unsuccessfully, with many changes, I'm just befuddled now. I hope someone
can help me with this.
Thank you
--
View this message in context: http://old.nabble.com/I-can%27t-get-apache-to-direct-to-my-virtual-hosts-tp30100782p30100782.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] I can't get apache to direct to my virtual hosts
Posted by dasgud <p....@gmail.com>.
oops. you are right. After two days of struggling I needed fresh eyes.
Sadly, after fixing that and refreshing apache server I had almost the same
problem. Almost because the domain in the folder under the site1.com folder
is the one that displays now. It doesn't matter which URL I enter in the
browser.
Other than the path being commented out :blush:, the v-hosts containers
looked correct?
--
View this message in context: http://old.nabble.com/I-can%27t-get-apache-to-direct-to-my-virtual-hosts-tp30100782p30103091.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] I can't get apache to direct to my virtual hosts
Posted by dasgud <p....@gmail.com>.
I did finally work out the last bug and now apache is pointing to the correct
vhosts. I never heard the idiom "third day is the charm" but hey, if it
works... Below is he httpd-vhosts.conf file that is working
<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:/server/xampp/htdocs/"
ServerName site1.com
ServerAlias www.site1.com
##ErrorLog "logs/dummy-host.localhost-error.log"
##CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host2.localhost
DocumentRoot "C:/server/xampp/htdocs/site2"
ServerName site2.com
ServerAlias www.site2.com
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
The problem was that the vhost container for site1 started like <VirtualHost
localhost:80> and for site2 it was <VirtualHost *:80>. I changed site1 to
be <VirtualHost *:80> and when I did that I knew right away that was causing
my grief. Both sites worked correctly right away.
I want to thank you for replying so fast and taking interest to help noobs
like me. I hope to gain enough experience and knowledge to help someone down
the road too.
Thanks again and take care :)
--
View this message in context: http://old.nabble.com/I-can%27t-get-apache-to-direct-to-my-virtual-hosts-tp30100782p30108298.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] I can't get apache to direct to my virtual hosts
Posted by John List <jo...@gulfbridge.net>.
On 10/31/2010 09:58 PM, dasgud wrote:
> I have installed a web server on a localhost with xampp. the apache server is
> ver 2.2 on a win xp pro (sp3) desktop. I've been reading the documentation
> and forums for 2 days and follow all the directions I found to modify my
> httpd-vhosts.conf file but it still doesn't work as I wish it to. I have 2
> domains on the localhost with very different content, when I type either
> url, only one of the sites displays.
> my folders are set up like: c:/xampp/site1 and c:/xampp/site1/site2. I think
> this may be the issue, and if so, then I need to go to another forum for
> installation answers.
> This is how I have configured httpd-vhosts file:
> <VirtualHost *:80>
> ##ServerAdmin postmaster@dummy-host.localhost
> DocumentRoot "C:/server/xampp/site1/"
> ServerName site1.com
> ServerAlias www.site1.com
> ##ErrorLog "logs/dummy-host.localhost-error.log"
> ##CustomLog "logs/dummy-host.localhost-access.log" combined
> </VirtualHost>
>
> <VirtualHost *:80>
> ##ServerAdmin postmaster@dummy-host2.localhost
> ##DocumentRoot "C:/server/xampp/site1/site2"
> ServerName site2.com
> ServerAlias www.site2.com
> ##ErrorLog "logs/dummy-host2.localhost-error.log"
> ##CustomLog "logs/dummy-host2.localhost-access.log" combined
> </VirtualHost>
>
It looks like you have the DocumentRoot directive commented out for
site2.com
> since I've been trying for 2 days to make something apparently simple work,
> unsuccessfully, with many changes, I'm just befuddled now. I hope someone
> can help me with this.
>
> Thank you
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org