logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Having trouble setting up Virtual Host
Author
gannina



Joined: 13 Oct 2006
Posts: 4

PostPosted: Fri 13 Oct '06 22:13    Post subject: Having trouble setting up Virtual Host Reply with quote

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

PostPosted: Fri 13 Oct '06 23:50    Post subject: Reply with quote

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

PostPosted: Sat 14 Oct '06 6:45    Post subject: Reply with quote

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

PostPosted: Sat 14 Oct '06 9:47    Post subject: Reply with quote

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

PostPosted: Sat 14 Oct '06 20:22    Post subject: Reply with quote

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

PostPosted: Sun 15 Oct '06 13:09    Post subject: Reply with quote

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

PostPosted: Mon 16 Oct '06 4:32    Post subject: Reply with quote

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

PostPosted: Mon 16 Oct '06 9:43    Post subject: Reply with quote

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


Reply to topic   Topic: Having trouble setting up Virtual Host View previous topic :: View next topic
Post new topic   Forum Index -> Apache