Good afternoon fellow StachExachangers,

Background story:

I have recently upgraded my macbook pro from Mavericks to Yosemites, everything went well except my local development environment got totally screwed up, specifically my apache 2 environment. I reconfigured my environments to my likings, including setting all permissions correctly, however, there is one issue i am not able to figure out what it is. I searched StackExcahange and and many other communities as well, although i have seen some similar question but none of the given answer was able to fix my issue.


I configured various vhosts for each my projects. Most of my vhosts work as they should, however there are several of them that only throws 404. In this particular Vhosts, i removed all the scripts, just left with html document with "Hello Wold" and still give the same error - which ruled out being and issue with some of my scripts. I deleted any other filed that could cause the issue including but not limited to .htaccess files, I have also changed the the rootdirectory of each offending vhosts to something different still gives the same error.

As anybody would do, i looked at the logs for each of these vhosts in question, there is no data in the error logs however this is what i find in the access logs: - - [22/Oct/2014:16:41:31 -0400] "GET / HTTP/1.1" 404 198 - - [22/Oct/2014:16:41:34 -0400] "GET / HTTP/1.1" 404 198 - - [22/Oct/2014:16:43:56 -0400] "GET / HTTP/1.1" 404 198 - - [22/Oct/2014:16:45:02 -0400] "GET / HTTP/1.1" 404 198 - - [22/Oct/2014:16:45:02 -0400] "GET /favicon.ico HTTP/1.1" 404 209 - - [22/Oct/2014:16:45:02 -0400] "GET /favicon.ico HTTP/1.1" 404 209 - - [22/Oct/2014:16:45:05 -0400] "GET / HTTP/1.1" 404 198

That is it. Which already knew about it, because when i access the vhost via browser i get Not Found The requested URL / was not found on this server.

As for my apache Vhosts configuration, here is one that is not working and followed by one that is working:


#*********** START OF timex.dev  *********
<VirtualHost *:80>
    ServerAdmin local@timex.dev
    DocumentRoot "Users/sp01010011/Dropbox/www/projects/timex/public"
    ServerName timex.dev
    ServerAlias www.timex.dev
    ErrorLog "/private/var/log/apache2/timex.dev-error_log"
    CustomLog "/private/var/log/apache2/timex.dev-access_log" common

  <Directory "Users/sp01010011/Dropbox/www/dev/projects/timex/public">
    AllowOverride All
    #Order Deny, Allow
    #Deny from all
    Allow from
    Allow from ::1

#************ // END OF timex.dev  ***************


#*********** START OF sab.dev  *********
<VirtualHost *:80>
    ServerAdmin local@sab.dev
    DocumentRoot "/Users/sp01010011/Dropbox/www/dev/projects/sab/public"
    ServerName sab.dev
    ServerAlias www.sab.dev
    ErrorLog "/private/var/log/apache2/sab.dev-error_log"
    CustomLog "/private/var/log/apache2/sab.dev-access_log" common

<Directory "Users/sp01010011/Dropbox/www/dev/projects/sab/public">
  AllowOverride All
    #Order Deny, Allow
  #Deny from all
  Allow from
  Allow from ::1

#************ // END OF sab.dev  ***************

As you can see, they are identical, all directories and subdirectories have the exact same permission and owned by the same user in the same group.

I totally cleaned out any scripts, htaccess files that could cause the issue, except for plain html file. I changed the directory location, however, none of these seemed to address my issue. Plus, the biggest part that is causing me the headache is that why one of the vhosts are being served correctly while others are not served correctly.

Additional Information:

I had 21 vhosts, out of which 8 of them were not working. I have deleted most of these vhosts now down to 13. The issue still remains, please if you have any idea what this might be let me know. I really appreciate any help you can give.

Thank you all.

  • Your document root looks wrong, DocumentRoot "/Users/" while the other one has DocumentRoot "Users/" Always ensure that your paths include a forward slash at the beginning... This occurs twice in the not working and once in the working... but change them all to /Users/ Oct 22 '14 at 22:10
  • @bybe Dang good catch! I looked at these and missed that entirely. Generally, I cut and paste a lot and always like to cut and paste from DocumentRoot into <Directory. I find that helps cut down on the mistakes my lexdisic fingers like to make.
    – closetnoc
    Oct 22 '14 at 22:41
  • @baybe. Thank you!!, wow this is the biggest gotcha! I read this code line by line multiple times and i haven't seen that, my eyes played tricks on me i guess; well this is is great lesson to be very attentive to details, and i believe this lesson with stay with me for a very long time. Closetnoc, thanks for the suggestions, from now on copy and paste will be my bbf.
    – S01010011
    Oct 23 '14 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.