Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

Neil Gee

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Forbidden 403, You don’t have permission to access /~username/ on this server

October 20, 2014 77 Comments

osx-forbidden

OS X 10.10 / 10.9 Sites Folder Sharing Not Working

If your user personal web sharing is not working for a user but is OK at the other document root localhost level, the issue may be a configuration file for the user.

The higher document root level of http://localhost/  displays “It Works” but when going to the user level,  http://localhost/~username/ you get the:

Forbidden 403, You don’t have permission to access /~username/ on this server

Check that you have a “username.conf” filed under:

/etc/apache2/users/

If you don’t, then create one named by the short username of the account with the suffix .conf:

Find your short username by typing in the Terminal

whoami

Change directory into the right directory:

cd /etc/apache2/users

sudo nano username.conf

For OSX 10.9 Apache 2.2

Then add the content below swapping in your username:

<Directory "/Users/username/Sites/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

For OSX 10.10 Apache 2.4

Then add the content below swapping in your username:

<Directory "/Users/username/Sites/">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>

Permissions on the file should be:

-rw-r--r--   1 root  wheel  298 Jun 28 16:47 username.conf

This is documented at Apple.

Restart apache

 sudo apachectl restart

Then all should be good.

Changing The Apache Web User

One of the frustrations of using the Users/username/Sites folder is the permissions issues with things like updates and authentication.

This is because the default webserver user which runs httpd is known as _www, which will not be the user in your local account. If your machine is only in use by you and the webserver will run only under your account then you can change the user.

Change this back in /etc/apache2/httpd.conf

 

osx-yosemite-webserveruser

Just change it to your username and group, group will be staff and restart Apache

 sudo apachectl restart

Share this:

  • Twitter
  • Facebook

Related

Cats: macOS, Tech Tags: apache, mac, OSX, permissions, sharing, web

Subscribe

Coolest Guides on the Planet

Tags

3gs 10.6 apache backup baseband Bing boot clean urls Coolest Guy on the Planet cpanel css custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect remote rsa SEO shell ssh terminal unstoppables urls Yahoo
Get DesktopServer

Donate a Beer to the Coolest Guides

Beaver Builder Ultimate Addons

Copyright © 2019· Neil Gee - All Rights Reserved - Hosted by Cloudways and Vultr