Author |
|
gannina
Joined: 13 Oct 2006 Posts: 4
|
Posted: Fri 13 Oct '06 22:13 Post subject: Having trouble setting up Virtual Host |
|
|
Hi, I am trying to setup 2 different domains on my computer, one to develope my website, and the other to test stuff. I am behind a router so all my IP addresses are the same. All the domain are on the same machine.
I have tried reading many tutorials and have viewed the apache 2.0 docs, but I can't get it to go to any of those two domains. Any help is appreciated, thanks.
Code: | NameVirtualHost 192.168.1.102:560
<VirtualHost 192.168.1.102:560>
DocumentRoot C:/Website
ServerName MyWebsite
ErrorLog logs/error_log
</VirtualHost>
<VirtualHost 192.168.1.102:560>
DocumentRoot C:/Testing
ServerName Testing
ErrorLog logs/error_log
</VirtualHost>
|
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 13 Oct '06 23:50 Post subject: |
|
|
Code: |
Listen 560
NameVirtualHost *:560
<VirtualHost *:560>
ServerAdmin you@your.com
DocumentRoot /server2/www
ServerName server1
ServerAlias www.server1
ErrorLog /server2/logs/error.log
CustomLog /server2/logs/access.log common
<Directory "/server2/www">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:560>
ServerAdmin you@your.com
DocumentRoot /server2/www_sandbox
ServerName sandbox.server1
ServerAlias www.sandbox.server1
ErrorLog /server2/logs/sandbox.error.log
CustomLog /server2/logs/sandbox.access.log common
<Directory "/server2/www_sandbox">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
|
If you can reach all servers, edit the hosts file in C:\WINDOWS\system32\drivers\etc
But that will only take effect localy (don't forget to restart Windows) |
|
Back to top |
|
gannina
Joined: 13 Oct 2006 Posts: 4
|
Posted: Sat 14 Oct '06 6:45 Post subject: |
|
|
I tried using the config data you gave me, but when I restarted apache it came up with the following error. You also mentioned editing the hosts file, when I add a server to it do I need to add the port number? Thanks in advance.
Code: |
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : make_sock: could not bind to address 127.0.0.1:560
no listening sockets available, shutting down
Unable to open logs
Note the errors or messages above, and press the <ESC> key to exit.
|
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sat 14 Oct '06 9:47 Post subject: |
|
|
That means, that there is another process listening on Port 560. Please check in the console (cmd) with netstat -ab which programm that is.
Why do you want to run apache on Port 560 instead of the normal 80? |
|
Back to top |
|
gannina
Joined: 13 Oct 2006 Posts: 4
|
Posted: Sat 14 Oct '06 20:22 Post subject: |
|
|
I just want the site available on my machine since it is a test server. If it's on port 80 is it less secure, or could outside people access it more easily? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sun 15 Oct '06 13:09 Post subject: |
|
|
Port 80 is the standart port for webservers. If the port is not 80 ppl can access it easy because they have to add the Port number to the url
like yourname.com:560
Port 80 is not less secure than any other Port. |
|
Back to top |
|
gannina
Joined: 13 Oct 2006 Posts: 4
|
Posted: Mon 16 Oct '06 4:32 Post subject: |
|
|
I got it working, thanks for the help. I ended up installing a newer version of 2.0 (since 2.2 cannot handle php 5 as a module, yet). I also edited the C:\windows\system32\etc\hosts file and added the IP address and servername for each virtual host. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 16 Oct '06 9:43 Post subject: |
|
|
You can download the php5apache2.dll from this page and replace that in your php folder and it will handle Apache 2.2.x |
|
Back to top |
|