• 1
name This is the guide that i used to set up an apache server. I did everything that was necessary but i wasn't able to run this command $ sudo cp httpd-userdir.conf httpd-userdir.conf.bak Answer from terminal was "Access denied" So, I decided not to make back-up files. When i completed the proccess, i entered this in the browser http://localhost/~username, where username was my actual username. And got this response


You don't have permission to access /~username on this server.

I ran apachectl configtest. And got this:

Warning: DocumentRoot [/usr/docs/] does not exist AH00112: Warning: DocumentRoot [/usr/docs/] does not exist AH00557: httpd: apr_sockaddr_info_get() failed for MacBook-Pro-Tim.local AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message Syntax OK

What should I do?


Try http://localhost/directory/ where directory is an folder in your sites folder. For some reason before Seirra this worked for me and http://localhost/~username/directory didn't (most likely the way I had it configured, don't quite remember how I did it, try them both just in case).

If both doesn't work, try the following in terminal.

sudo nano /etc/apache2/users/username.conf;

Add this in the file. Side Note: username below and anywhere else in this answer should be your machines username.

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

Save the changes. Then sudo chmod 644 username.conf

Next: sudo nano /etc/apache2/httpd.conf Uncomment the following lines (i.e. remove the # in front of each line if it has one)

LoadModule authz_core_module libexec/apache2/
LoadModule authz_host_module libexec/apache2/
LoadModule userdir_module libexec/apache2/
LoadModule include_module libexec/apache2/
LoadModule rewrite_module libexec/apache2/
LoadModule php5_module libexec/apache2/
Include /private/etc/apache2/extra/httpd-userdir.conf

Then sudo nano /etc/apache2/extra/httpd-userdir.conf and uncomment the line Include /private/etc/apache2/users/*.conf Save and restart apache. sudo apachectl restarthttp://localhost/~username/ should then be accessible. I just went through these steps and it worked for me.


  • 0
Reply Report