how do I configure virtual hosts

Problems with the Windows version of XAMPP, questions, comments, and anything related.

how do I configure virtual hosts

Postby anwoke8204 » 07. October 2006 00:53

HI I am trying to set up virtual hosts for my site, and when I edit the httpd-vhosts.conf with my first virtual host, no one can see the website now, the address is htto://rooksystems.no-ip.biz

here is a copy of what I am I have configured so far:
<Virtualhost rooksystems.no-ip.biz> # primary domain name
ServerAdmin admin@rooksystems.no-ip.bix # webmasters email address
DocumentRoot d:\xampp\htdocs\rooksystems # root for your 'www' content
ServerName rooksystems.no-ip.biz # your full domain name
ServerAlias rooksystems.no-ip.biz # the 'www' virtual host
ErrorLog d:\xampp\htdocs\rooksystems\errorlog # error log file
TransferLog d:\xampp\htdocs\rooksystems\accesslog # access log file
</Virtualhost>
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Re: how do I configure virtual hosts

Postby Izzy » 07. October 2006 01:23

anwoke8204 wrote:HI I am trying to set up virtual hosts for my site, and when I edit the httpd-vhosts.conf with my first virtual host, no one can see the website now, the address is htto://rooksystems.no-ip.biz

here is a copy of what I am I have configured so far:
<Virtualhost rooksystems.no-ip.biz> # primary domain name
ServerAdmin admin@rooksystems.no-ip.bix # webmasters email address
DocumentRoot d:\xampp\htdocs\rooksystems # root for your 'www' content
ServerName rooksystems.no-ip.biz # your full domain name
ServerAlias rooksystems.no-ip.biz # the 'www' virtual host
ErrorLog d:\xampp\htdocs\rooksystems\errorlog # error log file
TransferLog d:\xampp\htdocs\rooksystems\accesslog # access log file
</Virtualhost>


It would help if you pasted your httpd-vhosts.conf here so it can be analysed properly and corrections, if any, can be given.

Is this your IP: 71.219.77.7

This is what I get when I check your domain name:
Service scan
FTP - 21 220-FileZilla Server version 0.9.18 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
SMTP - 25 220 rooksystems.no-ip.biz ESMTP
HTTP - 80 Error: ConnectionRefused
POP3 - 110 +OK POP3
IMAP - 143 * OK IMAPrev1

Which looks like a firwall or your ISP perhaps is blocking port 80.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby anwoke8204 » 07. October 2006 01:48

yeah, that is my ip to my modem, and I know that my isp isn't blocking port 80 becasue the site was running till I tried to configure the virtual host for it( I run 3 sites on my server and inorder to get the e-mail server I had to get rid of the url redirect of http://71.219.77.7/rooksystems(folder under htdocs where the site is located)
here is my config file


#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host2.example.com
## DocumentRoot /www/docs/dummy-host2.example.com
## ServerName dummy-host2.example.com
## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>

<Virtualhost rooksystems.no-ip.biz> # primary domain name
ServerAdmin admin@rooksystems.no-ip.biz # webmasters email address
DocumentRoot d:\xampp\htdocs\rooksystems # root for your 'www' content
ServerName rooksystems.no-ip.biz # your full domain name
ServerAlias rooksystems.no-ip.biz # the 'www' virtual host
ErrorLog d:\xampp\htdocs\rooksystems\errorlog # error log file
TransferLog d:\xampp\htdocs\rooksystems\accesslog # access log file
</Virtualhost>
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Postby Izzy » 07. October 2006 02:05

Still check your firewall (Windows Firewall) if you have it activated.

Your entries needed some modifications. Try this and see if it helps:
Code: Select all
#

# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host2.example.com
## DocumentRoot /www/docs/dummy-host2.example.com
## ServerName dummy-host2.example.com
## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>

<VirtualHost 127.0.0.1:80>
ServerName localhost
DocumentRoot "D:/xampp/htdocs"
</VirtualHost>

NameVirtualHost *:80

<VirtualHost *:80>
ServerName rooksystems.no-ip.biz
ServerAlias www.rooksystems.no-ip.biz
ServerAdmin admin@rooksystems.no-ip.biz
DocumentRoot "D:/xampp/htdocs/rooksystems"
<Directory "D:/xampp/htdocs/rooksystems" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
CustomLog D:/xampp/htdocs/rooksystems/accesslog combined
ErrorLog D:/xampp/htdocs/rooksystems/error.log
</VirtualHost>

You need to set up a subdomain at no-ip for the ServerAlias www..rooksystems.no-ip.biz in your control panel to have it work from the Internet.
Or just delete the ServerAlias line completely if you dont require to use http://www.rooksystems.no-ip.biz
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby anwoke8204 » 07. October 2006 02:40

seems to be working thanks
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Postby anwoke8204 » 07. October 2006 05:53

next question, how do I get my browsers to take me to my website now, so I don't have to keep on changing the domain name to the local ip address of my server? ie. to see http://rooksystems.no-ip.biz I have to type in 192.168.1.10/rooksystems now with the virtual hosts set up I type in the url, and it takes me to my modem config page, but lets others on the outside of the modem see the site. does any of this make any sense?
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Postby Izzy » 07. October 2006 05:58

What does your windows host file have in it?
Paste it here so we can take a look.

Clear your browser cache.

Configure your network.

you can add IPs to your virtual host container to make it IP based instead of name based.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby anwoke8204 » 07. October 2006 06:07

will do, I also have another problem, since going to the hosts( I have 3) can post the host config file with all 3 hosts, I type in the ip address of the server, then the folder for the site, and when I just type in the ip address it defaults to the main site, I can't access the other 2 sites anymore, ie 192.168.1.10/rooksystems, 192.168.1.10/onebyte, or 192.168.1.10/stories, It defaults to the rooksystems site and I can't access any of the other 2 atm.


here is the hosts file:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
192.168.1.10/rooksystems rooksystems.no-ip.biz
192.168.1.10/stories superstories.no-ip.biz
192.168.1.10/onebyte onebyte.no-ip.biz
this is for the other machines on my network, for the server instead of 192.168.1.10 it is 127.0.0.1



and here is the virtual hosts file:


#

# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host2.example.com
## DocumentRoot /www/docs/dummy-host2.example.com
## ServerName dummy-host2.example.com
## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>

<VirtualHost 127.0.0.1:80>
ServerName localhost
DocumentRoot "D:/xampp/htdocs"
</VirtualHost>

NameVirtualHost *:80

<VirtualHost *:80>
ServerName rooksystems.no-ip.biz
ServerAlias www.rooksystems.no-ip.biz
ServerAdmin admin@rooksystems.no-ip.biz
DocumentRoot "D:/xampp/htdocs/rooksystems"
<Directory "D:/xampp/htdocs/rooksystems" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
CustomLog D:/xampp/htdocs/rooksystems/accesslog combined
ErrorLog D:/xampp/htdocs/rooksystems/error.log
</VirtualHost>

<VirtualHost *:80>
ServerName superstories.no-ip.biz
ServerAlias www.superstories.no-ip.biz
ServerAdmin admin@superstories.no-ip.biz
DocumentRoot "D:/xampp/htdocs/stories"
<Directory "D:/xampp/htdocs/stories" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
CustomLog D:/xampp/htdocs/stories/accesslog combined
ErrorLog D:/xampp/htdocs/stories/error.log
</VirtualHost>

<VirtualHost *:80>
ServerName onebyte.no-ip.biz
ServerAlias www.onebyte.no-ip.biz
ServerAdmin admin@onebyte.no-ip.biz
DocumentRoot "D:/xampp/htdocs/onebyte"
<Directory "D:/xampp/htdocs/onebyte" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
CustomLog D:/xampp/htdocs/onebyte/accesslog combined
ErrorLog D:/xampp/htdocs/onebyte/error.log
</VirtualHost>

as I am usning I don't use www. in my addresses, you just use http://rooksystems.no-ip.biz or similar depending on what site
so do I need to take the www. parts out of the virtual config


as far as the networking goes, I have the network all configured via static, unless someone uses vpn to connect to my network, then they are dhcp. I know how to do networking, have been doing it for a few years now, but this is the first time I have ever done anything like this, tried clearing the cash didn't work, and I only have 1 ip address to my server so how would I bind the container to the ip address if my modem is on dynamic addressing?
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Postby Izzy » 07. October 2006 06:19

Before I sort it I need to know if you have a dynamic IP or a dedicated IP for your Internet Access?

Also you can try removing the entries other than 127.0.0.1 localhost. If that does not work then you can always put them back.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby anwoke8204 » 07. October 2006 06:22

I have dynamic ip, that is why I am using no-ip because they have a program that I can run on my server and it will automatically check my wan ip address for my modem and automatically update my no-ip account dns hosts to the new ip address when it changes
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Postby Izzy » 07. October 2006 06:35

Then we keep the wild card in the virtualhost containers - *:80

I don't have a network set up so I can't really help you with that.

A poster that had similar issues to you eventually sorted it out but he had a dedicated set of IPs:
http://community.apachefriends.org/f/viewtopic.php?p=84230

I just spotted this in your host file:
192.168.1.10/rooksystems rooksystems.no-ip.biz
192.168.1.10/stories superstories.no-ip.biz
192.168.1.10/onebyte onebyte.no-ip.biz

Try this instead:
192.168.1.10 rooksystems.no-ip.biz
192.168.1.10 superstories.no-ip.biz
192.168.1.10 onebyte.no-ip.biz
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby anwoke8204 » 07. October 2006 06:50

I made the change in both my host file on my server, and on my main computer, and no luck, it still doesn't work. I need to be able to access those sites. any ideas? I can now see the live help online/offline pictures/links now though, where as before I couldn't but the outside world could
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Postby Izzy » 07. October 2006 07:10

anwoke8204 wrote:as I am usning I don't use www. in my addresses, you just use http://rooksystems.no-ip.biz or similar depending on what site
so do I need to take the www. parts out of the virtual config

Yes you can drop the ServerAlias www.blah.blah entries.

As always save and restart apache.

You will have to wait now and see if there is a knowlegable member who can spot what you need to progress to settling this issue. We have made some headway though, which must have been satifying for you.

I only have a very poor dialup connection (Outback Aus) with a dynamic IP so networking is futile. I just keep one machine for the Internet with XP Pro and my other machine is a Linux box with Centos 4. I just peer to peer them with a single crossover cable and so I don't have the issues you have to contend with.
:)
Good luck!
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby anwoke8204 » 07. October 2006 07:18

I will do that, I do thank you for your help izzy, now lets hope there is someone here that can help me with that last problem? and yes I am glad to get those pictures back, as well as the not having to have a seperate dns host for my sites, now that I have the virtual hosts. can you see the other sites, http://superstories.no-ip.biz and http://onebyte.no-ip.biz
anwoke8204
 
Posts: 47
Joined: 23. September 2006 02:16

Postby Izzy » 07. October 2006 07:28

anwoke8204 wrote:I will do that, I do thank you for your help izzy, now lets hope there is someone here that can help me with that last problem? and yes I am glad to get those pictures back, as well as the not having to have a seperate dns host for my sites, now that I have the virtual hosts. can you see the other sites, http://superstories.no-ip.biz and http://onebyte.no-ip.biz


http://onebyte.no-ip.biz/ gives a directory listing. You need an index page in there quick smart.

http://superstories.no-ip.biz/ gives me a similar page to your main domain.

Use this address to test your connections from the Internet so you can see for yourself if they are working or not. Select what ever tick boxes you want to test. Usually the service scan is all you need.
http://70.84.211.98/co/DomainDossier.aspx
You can also visit their main site centralops.net from a link in the Tick box area.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 60 guests