Forum Moderators: phranque

Message Too Old, No Replies

Having trouble hosting multiple websites with virtual host

         

BackusLab

8:59 pm on Sep 8, 2011 (gmt 0)

10+ Year Member



Hello,
I was recently tasked to build a new website for my lab. I chose Drupal and simply loved the process. The problem I'm running into is configuring the new site properly with our server. My lab, as well as a few upstairs share this server which we simply use to hosts our sites, we don't share a database or anything like that. The root of the server is poseidon-DOT-sunyopt-DOT-edu which used to bring you to a nice little index page with all of the labs. Now it simply takes you to my new site. If I manually enter the old sites address I am brought to the custom 404 page I made for the new site. I want it to go poseidon.sunyopt-DOT-edu/LAB1 or poseidon.sunyopt-DOT-edu/LAB2 or what have you. Each lab site is several pages or nodes.

I separated the Drupal site and the old sites into different htdoc folders (htdocs/backuslab for the drupal site, htdocs2/wwwroot for the old html sites) and made sure to configure the httpd.conf file's document-root to the main xampp folder which houses both htdocs folders. I also made sure the virtualhosts part was un-commented. In httpd-vhosts.conf I entered this:

<Directory: C:/xampp>
Order Deny,Allow
Allow from all
</Directory>
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/Backuslab
ServerName POSEIDON.OPTNET.EDU:80
</VirtualHost>

<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs2/wwwroot
ServerName POSEIDON.OPTNET.EDU:80
</VirtualHost>

I feel like I'm missing something really simple here. Alias? The drupal site is alive and well, I just think it's feeding off the whole server instead of the little plate I want it to have. Any help would be greatly appreciated.

phranque

3:52 am on Sep 9, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, BackusLab!

<VirtualHost> Directive:
http://httpd.apache.org/docs/2.0/mod/core.html#virtualhost

Each Virtual Host must correspond to a different IP address, different port number or a different host name for the server,...


this means you should either specify a unique subdomain (for example) for each root directory.
or if you prefer the subdirectory url route, change you directory structure so that each site/subdirectory is located in the DocumentRoot, which in your case would be essentially a single virtual host.

BackusLab

7:49 pm on Sep 9, 2011 (gmt 0)

10+ Year Member



Awesome! Got her running. I guess I was trying to over complicate things, I followed your sub-directory note and just dumped the different folders into htdocs and commented the virtual host business I did in the httpd-vhosts.conf file.
Thank you very much, you save a lot of my hair from being pulled out.