Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This question is an exact duplicate of:

I've installed XAMPP on my Mac, and am trying to set up multiple virtual hosts.

I've changed the system hosts file to include the line seo-reports.local and i've added the following to the XAMPP vhosts file

<VirtualHost *>
    DocumentRoot "/Users/Alex/Documents/Software Development/Web/seo-reports"
    ServerName seo-reports.local
    <Directory "/Users/Alex/Documents/Software Development/Web/seo-reports">
    Order allow,deny
    Allow from all

When I go to http://seo-reports.local the file automatically redirects to http://seo-reports.local/xampp - the xampp control page which doesn't seem right.

If i go to an example file, eg: http://seo-reports.local/index.html - i get an error:

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster. Error 404 seo-reports.local Sun Sep 4 14:02:13 2011 Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1

share|improve this question

migrated from stackoverflow.com Sep 4 '11 at 13:22

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Michael Hampton, Khaled, Ward, Jay, mdpc Feb 18 '13 at 3:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

You have to delete the entire "xampp/htdocs" folder (well, only what's inside it). Can you post your "error.log" file please?

This is my configuration:

#vHosts Config:

NameVirtualHost *:80

<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
<Directory "C:/xampp/htroot">
    AllowOverride All
    Options Indexes FollowSymLinks Includes ExecCGI
    Order allow,deny
    Allow from all
    ServerAdmin support@u4ik.us
    DocumentRoot "C:/xampp/htroot/"
    ServerName my-ip
    ServerAlias my-ipaddress

<VirtualHost *:80>
    ServerAdmin support@u4ik.us
    DocumentRoot "C:/xampp/htdocs/"
    ServerName u4ik.us
    ServerAlias www.u4ik.us

<VirtualHost *:80>
    ServerAdmin support@u4ik.us
    DocumentRoot "C:/xampp/htdocs2/"
    ServerName u4ik.info
    ServerAlias www.u4ik.info
share|improve this answer
I'm a bit confused. I don't think I should need to delete the contents of that file because I'm not using it as the directory to store my files. –  Alex coady Sep 4 '11 at 16:42
You need the "Name virtual host" part, and properly formatting the vHost directives/tags. Try also using direct paths to the files... "C:/xampp/..." or "C:/users/user/docs/path/to/pages/" and remember the trailing slash. –  U4iK_HaZe Sep 4 '11 at 16:56
Yeah, that bit's there, I just included the individual config. Every single config I add just seems to revert to the default localhost one, any idea why? –  Alex coady Sep 4 '11 at 17:01
What are you using? Xampp? Your config should never "change" by itself unless you have syntax errors. –  U4iK_HaZe Sep 5 '11 at 1:46

To fix this you need to uncomment the include directive:

# Virtual hosts
# Include etc/extra/httpd-vhosts.conf

in /opt/lampp/etc/httpd.conf

Another way to debug your vhosts file is to run:

/opt/lampp/bin/httpd -S 

If you do not see your vhosts being parsed you have not uncommented the above Include Directive

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.