Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Machine: Mac Book Pro Web Server: Apache

I'm building a Wordpress site locally and I've set it up as a virtual host, I've made the following changes to http-vhosts.conf:

<VirtualHost *:80>
    DocumentRoot "/Users/username/Documents/Websites/projectname/index.php"
    ErrorLog "/private/var/log/apache2/"
    CustomLog "/private/var/log/apache2/" common

and I've made an entry in the /etc/hosts file as follows:       localhost

I've also changed the siteurl and home options in the wp_options table to be

but when I access the site via the browser ( I just get plain text, the theme/images/stylesheets are not picked up. Looking at the access_log, I can see a whole lot of 404 errors.

Any help appreciated, I've been playing around with it for a while now.

Rgards, Stephen

share|improve this question

closed as off topic by Jenny D, Ward, RolandoMySQLDBA, mdpc, Dennis Kaarsemaker Apr 6 '13 at 11:23

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

document root shouldn't include the files normally.. – NickW Apr 5 '13 at 12:06
up vote 1 down vote accepted

Fix your DocumentRoot, it should be the directory, not the file.

DocumentRoot /Users/username/Documents/Websites/projectname/

Can you give us more detail on the errors?

WordPress uses .htaccess to create search engine friendly URL's. This means WP will link to a file that doesn't exist, and have its index script parse and route the request. If .htaccess is not working, then you may have these errors.

Try to add AllowOverride All.

<VirtualHost *:80>
    DocumentRoot "/Users/username/Documents/Websites/projectname/"
    <Directory "/Users/username/Documents/Websites/projectname/">
         AllowOverride All

    ErrorLog "/private/var/log/apache2/"
    CustomLog "/private/var/log/apache2/" common

share|improve this answer
Thanks David, it was the DocumentRoot that was the problem, fixed now. – Stephen Apr 5 '13 at 12:10

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