more then one domain with xampp program

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

more then one domain with xampp program

Postby numb » 06. August 2006 12:31

i have 3 domain names registered cybercon.ws is one it shows using xampp also have two others it shows cybercon.ws index.html is their away to run more one domain seperate index pages to each one with xampp?
numb
 
Posts: 22
Joined: 03. August 2006 05:26

Postby Izzy » 06. August 2006 12:36

This post might be of help if you can follow it:

http://community.apachefriends.org/f/viewtopic.php?t=19525

Also try a forum search and use the key word vhost. That should return some useful reading as this is a popular question on the forums and has been answered several times even over the last few days IIRC.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

more then one domain with xampp program

Postby numb » 06. August 2006 13:11

i have 2 domain names they both show same thing how can serprate anbd make each show deferent pages www.cybercon.ws and xandesignz.or i looked at that you gave above and dont know much bout it can give simplar detail instruction please
numb
 
Posts: 22
Joined: 03. August 2006 05:26

more then one domain with xampp program

Postby numb » 06. August 2006 13:18

numb
 
Posts: 22
Joined: 03. August 2006 05:26

Postby Izzy » 07. August 2006 02:34

The links below might help you get an understanding of what XAMPP can do and how to effectively configure most things.

After doing some reading on the Virtual Host subject or any other subject and after having a go at configuring your server yourself, post back if you have any errors and include a copy/paste of the *.conf files that are giving you issues.

It is easy for someone here to help you if you have a basic knowledge of the server and the way it functions and how to use configuration files.

http://community.apachefriends.org/f/viewtopic.php?t=14173

numb wrote:sorry www.xandesignz.org

Also you should address this issue as a matter of urgency and it should usually be done before posting your IP address or domain name address on a forum ;) :
These XAMPP pages are accessible by network for everyone UNSECURE
Every XAMPP demo page you are right now looking at is accessible for everyone over network. Everyone who knows your IP address can see these pages.
Last edited by Izzy on 28. August 2006 06:05, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby Izzy » 08. August 2006 12:57

numb wrote:got it to working thank you for patients and help greatly apriciated but the vhost i still do not under stand or can get to work with apache xampp guess i am lame in that department lol
It is not hard really.

I will put here the entries you need to put in the xampp/apache/conf/extra/httpd-vhosts.conf file.
Just replace the details with your own.
Then if it works that's fine.
If it don't work, copy and paste the httpd-vhosts.conf file that you edited here.
Always make a backup of the original.conf file before you make any changes, you can then revert to the original again if it does not work and get your server working again.
Code: Select all
ADD YOUR ENTRIES AFTER THIS LAST LINE:
##</VirtualHost>


NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost:80
DocumentRoot "Path:/to/your/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName domain1.com
ServerAlias www.domain1.com
DocumentRoot "Path:/to/your/domain1/websitefiles"
<Directory "Path:/to/your/domain1/websitefiles">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName domain2.com
ServerAlias www.domain2.com
DocumentRoot "Path:/to/your/domain2/websitefiles"
<Directory "Path:/to/your/domain2/websitefiles">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName domain3.com
ServerAlias www.domain3.com
DocumentRoot "Path:/to/your/domain3/websitefiles"
<Directory "Path:/to/your/domain3/websitefiles">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

After you have made the changes to the paths and domain names you must restart Apache.

If it won't start revert to the backup of the original then restart Apache. Then paste the file here that wont start.

Or at a command prompt within the apache/bin directory issue this command:
apache -S
It will tell you what is wrong and what line(s) numbers need fixing.
If all is well it will issue:
Syntax OK

domain 1, 2 and 3 must be accessable from the Internet.

That means the DNS must point to your IP. So that if I or any one else types domain1.com in the address bar of their browser the DNS servers must know where domain1.com's web server is.

You can do this by using a domain name zone file service like zoneedit.com or noip.com etc.

Not sure if domain forwarding will work like at your registrar Godaddy but I know for sure that the other way works as I use zoneedit for my needs and I have 5 domains serving from my XAMPP installation and my domains are registered at Godaddy.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

re:

Postby numb » 09. August 2006 01:57

here what i got is it right?
#
# 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>

NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost:80
DocumentRoot "/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName cybercon.ws
ServerAlias www.cybercon.ws
DocumentRoot "/xampp/htdocs/cybercon"
<Directory "/xampp/htdocs/cybercon">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName xandesignz.org
ServerAlias www.XANDESIGNZ.ORG
DocumentRoot "/xampp/htdocs/xandesignz"
<Directory "/xampp/htdocs/XANDESIGNZ">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
numb
 
Posts: 22
Joined: 03. August 2006 05:26

Postby Izzy » 09. August 2006 02:04

Use full paths to your directories and files including the localhost container.

If uppercase is not a requirement then drop to lowercase except for the apache .conf file directives and commands. This will help prevent later confusion if you forget the proper case, as in scripts and other path configurations.

I do not answer forum questions via PM. Please ask all question on the forum so others may benefit from the replies.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby grutz » 10. August 2006 07:15

Installed four web sites on my personal machine. WinXP SP2 computer with xampp. Followed your instructions above and it works great.

However I'd like to point out that I had shit loads of problems before being successful. I'll try and relate these so that maybe others following in my path wont have so much trouble. Originally I used the installer download but apache was flaky starting. Most of the time I got errors in my event viewer...here is some of them for the clever people to ponder over.

The Apache service named reported the following error:
>>> no listening sockets available, shutting down

The Apache service named reported the following error:
>>> (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80

The Apache service named reported the following error:
>>> apache.exe: Could not open configuration file C:/WebServer/xampp/apache/conf/httpd.conf: The system cannot find the file specified.
BTW, the file was there too!!!

The Apache service named reported the following error:
>>> Unable to open logs

I had edited the httpd.conf as suggested in one of the tutorial on vhost.

Find:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>

and replace it with:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
Save and Exit

Also had editing the httpd-vhosts.conf as below with no luck.
This is what we will be deleting:
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

Once you have done that replace the following code with:
<VirtualHost *:80>
DocumentRoot /xampp/xampp/htdocs
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /srv/www/yourdomain1
ServerName localhost.main.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /srv/www/yourdomain2
ServerName localhost.main.com
</VirtualHost>

I uninstalled and reinstalled many times, sometimes apache would work for awhile and other times not at all. Only once did I edit the httpd.conf so I don't think it was the only reason why I was having trouble. Biggest problem I had was apache failing to start. I think this was mostly due to port 80 access denied. I had disabled my firewall, microsoft's firewall is disabled by default and also made sure that Microsoft's Internet Information Services was not installed. Made sure before I uninstalled that all xampp processes in task manager was shut down.

Finally after giving up read an articule that said to use the 7-zip executable download. Worked far better, this download doesn't put anything into windows registry. Had to manually start xampp control panel appication and changed the settings to have apache start as a service. But I can start and stop apache every time successfully now.

So a big thankyou to Izzy for the code above that works fine when copied into httpd-vhosts.conf. I didn't need to edit httpd.conf.

Another point to mention, I had installed the installer download only the day before on a schools web server running WinXP SP2 and it worked fine. They are running only the one web site so didn't need to edit httpd-vhosts.conf file.
grutz
 
Posts: 18
Joined: 07. August 2006 06:00

Found the problem

Postby grutz » 20. August 2006 22:09

Hi everyone

Found the problem that causes the problem with apache not starting up. Have also read that many other people have the same problem. Also if apache starts up OK after a reboot but you stop it in the "xampp control panel" it will not start again. In the event viewer you find the error problem listed as: "make_sock: could not bind to address 0.0.0.0:80" For me the problem was Skype as it lisens on port 80. Close it down and you will have no problem unless you also have WinXP iis service installed and running. You will need to uninstall iis through the "add and remove program" in the control panel, choosing "add and remove windows components" Untick internet information services (iis).
grutz
 
Posts: 18
Joined: 07. August 2006 06:00


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests