View Full Version : virtual host on development environment

01-09-2008, 04:21 PM

I am trying to create a virtualhost for a development environment
We have a separate local server for all our developments. At present we have been putting new projects in new folders on the test server that would look like this


and hadn't set up any virtual hosts. I suggested we use virtualhosts because we are getting the problem in our sites where links arn't relative to the document root when we upload them to the live server. I have set up a virtual host on a real server but that was when I had domains pointing to the server. I'm not sure how do this when our development server
When we access our sites to test we would type

unfortunatley the document root would still be in htdocs and not in htdocs/domain.com/

If someone can help me replace the squiggly brackets following

<VirtualHost {vhost}>
DocumentRoot /Applications/MAMP/htdocs/domian.com
ServerName {domain.com}

Any ideas?

01-13-2008, 12:47 PM
I believe, after setting up a virtual host, we can access it by just typing www.example.com
1. Configuring 'httpd-vhosts.conf' file

ServerName www.example.com
DocumentRoot "C:/XAMPP/htdocs/mysitefolder"

Options FollowSymLinks
AllowOverride All

Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

2. Configuring 'hosts' file
\system32\drivers\etc www.example.com

3. Restart xammp.

4. Try typing "www.example.com" in your browser!! :)