httpd -v
Server version: Apache/2.4.18 (Unix)
Server built:   Feb 20 2016 20:03:19
Mac OS El Capitan 10.11.6

I hope I am not violating rules by reposting my question I have written on stackexhange. If this is incorrect, please, let me know. I have troubles accessing my Sites folder. I am a newbie, and I am at my wit's end because I have studied all possible links (the ones I am capable to understand) and have performed all necessary changes, but localhost/username/Sites keeps telling me:

Not Found
The requested URL /~username/Sites was not found on this server.

I have tried also:

Not Found
The requested URL /username/Sites was not found on this server.

Of course I use my name instead of username. I have added lines to username.conf as per https://coolestguidesontheplanet.com/forbidden-403-you-dont-have-permission-to-access-username-on-this-server/ and https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx-10-11-el-capitan/

Here is the link to my original post https://apple.stackexchange.com/questions/264174/apache-localhost-doesnt-work-safari-cant-connect-to-the-server-localhost

I will be grateful for help. I truly need to fix this issue and get the thing running.


When you have Apache enabled, the content of your ~/Sites directory becomes visible at http://localhost/~youruser. In other words, instead of /~username/Sites, you're really looking for /~username.

Try this for a simple test:

echo hello > ~/Sites/hello.html

And visit in your browser http://localhost/~youruser/hello.html.

If Apache is correctly setup, you should see a primitive page with just "hello" on it.

  • When opening localhost/~username I should see a list of directories, etc, very basic page, but I don't see it. I have a few folders in my Sites folders, but I don't see contents of any of those: – Vitale Dec 23 '16 at 18:38
  • I can access, for example: localhost/~username/Sites/folder/somefile.php or localhost/~username/Sites/another_folder/somefile.html – Vitale Dec 23 '16 at 18:40
  • So you can access specific files, but your question is how to see directory listings? – janos Dec 23 '16 at 18:40
  • No, sorry it was a typo - I can't access any of those files. Sorry for this typo. – Vitale Dec 24 '16 at 18:14
  • Can you access hello.html if you perform simple sanity test I suggested? – janos Dec 24 '16 at 18:16

Your Answer

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

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