a_user Posted February 11, 2008 Share Posted February 11, 2008 Hi All, Im having a bugger of a time getting VirtualHost’s to work correctly for my domain. I am currently using XAMPP 1.6.4 on Windows 2003 for my testing environment. What I am trying to do is create a suddomain of forum. for my domain of abc123.com (fictitious). When users enter forum.abc123.com I want to them to go to the forums page. c:/xampp/htdocs/forum When users enter www.abc123.com I want them to be accessing the main web page c:/xampp/htdocs/wp This is what I have in my httpd.conf file for my virtualhosts configuration: #Virtual hosts <VirtualHost *:80> DocumentRoot c:/xampp/htdocs ServerName www.abc123.com </VirtualHost> <VirtualHost *:80> DocumentRoot C:/xampp/htdocs/forum ServerName forums.abc123.com </VirtualHost> Notice that I currently have c:/xampp/htdocs as the default root folder as per defaults. The examples from the apache tutorials themselves are as below: # Ensure that Apache listens on port 80 Listen 80 # Listen for virtual host requests on all IP addresses NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /www/example1 ServerName www.example1.com # Other directives here </VirtualHost> <VirtualHost *:80> DocumentRoot /www/example2 ServerName www.example2.org # Other directives here </VirtualHost> I have also ensured the vhost_alias_module modules/mod_vhost_alias.so is set to load. At least I think so..I removed the # from the config file httpd.conf for it. Your help is appreciated here as I am pretty new to this. I have reviewed a number of documents, a number of which contradict each other by the way. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/90511-having-a-bugger-of-a-time-with-virtualhosts/ Share on other sites More sharing options...
a_user Posted February 11, 2008 Author Share Posted February 11, 2008 All of the looking and testing!! I just came across this here post with the following recommendation: NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/lax/html/ ServerName www.orilliawomenslacrosse.com ServerSignature On DirectoryIndex index.php index.html index.htm index.shtml </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html/hdog ServerName www.thehdog.com ServerSignature On DirectoryIndex index.html index.htm index.shtml </VirtualHost> This worked. Quote Link to comment https://forums.phpfreaks.com/topic/90511-having-a-bugger-of-a-time-with-virtualhosts/#findComment-464073 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.