joolzhaines Posted August 15, 2008 Share Posted August 15, 2008 Hi, I am running apache 22 on Windows 2003, I have 10 domains which up to now I have been using host names to resolve which is working, I have recently been given five TCP/IP numbers and I want to secure one site with SSL. I have set my DNS server on all but one domain to use the same internet IP number and one to use its own IP number which I want to secure, if I change the host file as below <VirtualHost 80.xxx.xxx.xxx> ServerAdmin mail@mydomain.co.uk ServerName mydomain.co.uk DocumentRoot /www/vhosts/www.mydomain.co.uk ErrorLog /www/vhosts/www.mydomain.co.uk/logs/error.log </VirtualHost> Instead of this the old way <VirtualHost *:80> ServerAdmin mail@mydomain.co.uk ServerName mydomain.co.uk DocumentRoot /www/vhosts/www.mydomain.co.uk ErrorLog /www/vhosts/www.mydomain.co.uk/logs/error.log </VirtualHost> When I change to using an IP I cannot resolve to the web site anymore? What am I doing wrong, is this correct for securing with SSL, my router is passing all numbers correctly. Thanks for your help Joolz Quote Link to comment https://forums.phpfreaks.com/topic/119909-apache-22-vhosts/ Share on other sites More sharing options...
corbin Posted August 16, 2008 Share Posted August 16, 2008 Try 80.xxx.xxx.xxx:80. Also, can you tell us if the site name resolves to the right IP address? Quote Link to comment https://forums.phpfreaks.com/topic/119909-apache-22-vhosts/#findComment-617853 Share on other sites More sharing options...
joolzhaines Posted August 17, 2008 Author Share Posted August 17, 2008 Hi, No it does not resolve it goes to my default site instead, I have also tried using the :80 Does any know what I am doing wrong regards Julian Quote Link to comment https://forums.phpfreaks.com/topic/119909-apache-22-vhosts/#findComment-618736 Share on other sites More sharing options...
corbin Posted August 18, 2008 Share Posted August 18, 2008 Can I see the exact config? Feel free to leave out the site name if you want. Quote Link to comment https://forums.phpfreaks.com/topic/119909-apache-22-vhosts/#findComment-618903 Share on other sites More sharing options...
joolzhaines Posted August 18, 2008 Author Share Posted August 18, 2008 Hi, Here is the vhost file, when I change the 2nd host to use an TCP both address route to the first www.joolz.info domain, both hosts resolve to the correct TCP/IP so it must be something to do with apache not recognizing/resolving the TCP and defaulting to www.joolz.info # # 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. # # Tried with and without this line # NameVirtualHost *:80 # Default Virtual Host --> \www\vhosts\localhost # # This Virtual Host serves two functions: # 1) As the VH for http://localhost # 2) As the default VH for all unknown hosts that resolve to this server # # Do not remove/edit this VH unless you know exactly what you are doing. # Note that this should be the 1st VH Apache parses from the configuration files. # Note that permissions for this VH's DocumentRoot are taken from httpd.conf <VirtualHost *:80> ServerName joolz.info ServerAlias www.joolz.info DocumentRoot /www/vhosts/www.joolz.info ErrorLog /www/vhosts/www.joolz.info/logs/error.log <Directory "/www/vhosts/www.joolz.info"> Options All AllowOverride All order allow,deny allow from all </Directory> </VirtualHost> <VirtualHost 80.229.212.90:80> ServerName sussex-tennis.co.uk ServerAlias www.sussex-tennis.co.uk DocumentRoot /www/vhosts/www.sussex-tennis.co.uk ErrorLog /www/vhosts/www.sussex-tennis.co.uk/logs/error.log <Directory "/www/vhosts/www.sussex-tennis.co.uk"> Options All AllowOverride All order allow,deny allow from all </Directory> </VirtualHost> ### PLACE NEW VHs BLOCKS ___ONLY___ ABOVE THE DYNAMIC/MASS VH BLOCK ### ### PLACE NOTHING BELOW THIS VH BLOCK OR LINE ### Quote Link to comment https://forums.phpfreaks.com/topic/119909-apache-22-vhosts/#findComment-619128 Share on other sites More sharing options...
corbin Posted August 18, 2008 Share Posted August 18, 2008 Oh, when ever you use a NameVirtualHost directive, you can't use IP addresses with it. Side note: Couldn't you just use a port to know whether or not to use SSL? Quote Link to comment https://forums.phpfreaks.com/topic/119909-apache-22-vhosts/#findComment-619584 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.