Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a dynamic IP, router and 2 PCs. To currently serve two sites on the same name but different ports I have the following set-up: www.No-IP.com agent resides on one of the machines and updates DNS inn real time, router re-directs requests from ports 80 and 8080 to the respective PCs to serve the content. I want to move both sites on one machine. The issue is that Apache asks to specify IP address in the naming of the virtual host ... I can't do it. Is there a solution? Script ideas for conf file would be greatly appreciated. Oleg

I have a dynamic IP address and used Apache with virtual hosts on different ports for a while but I can't remember entirely how I did it. However this fragment lingers in my conf file and may help...
NB: My server was running on an old compaq deskpro with only 128k of memory and it used to go off into a corner and sulk quite a lot when running virtual hosts which may or may not have been due to memory shortage - I've since gone to using two PC's instead partly because of that and partly because I find it easier to maintain.
# ServerName myserverone.com
# ServerAdmin admin@myserverone.com
# DocumentRoot "C:/xampp/htdocs"
#
# Listen 80
# Listen 8080
#
# Virtual Hosts
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/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
#NameVirtualHost *:8080
#
# 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>
# ServerName www.myserverone.com
# ServerAdmin admin@serverone.com
# DocumentRoot "/xampp/htdocs"
# ErrorLog logs/server1.com-error_log
# CustomLog logs/server1-access_log common
#</VirtualHost>#<VirtualHost *:8080>
# ServerName myservertwo.co.uk
# ServerAdmin admin@myservertwo.co.uk
# DocumentRoot "/xampp/server2"
# ErrorLog logs/server2-error_log
# CustomLog logs/server2-access_log common
#</VirtualHost>

Thanks a lot. Not sure if it will work -- the first stab was not, bt thanks a lot for taking time to post your response. Well, does anyone know how to test virtual host configuation without going through restarts, etc. I'm not using your typical Apache, but Apache as a part of Reactor server (combined with PHP and MySQL).
Regards,
Oleg

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |