Configuring apache web server on mac os Sierra (macbook pro 13 2014)

http://digitalshore.io/local-web-development-environment-apache-macos-sierra-10-12 This is the guide that I used to configure the Apache server. I did everything that was necessary, but I could not run this command $ sudo cp httpd-userdir.conf httpd-userdir.conf.bak The response from the terminal was "Access denied" Therefore, I decided not to create backup files. When I completed the process, I entered this into the browser   http://localhost/~usernamewhere the username was my actual username. And got this answer

Forbidden

You do not have permission to access / username on this server.


I ran apachectl configtest. And got this:

Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist AH00112: Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist AH00557: httpd: apr_sockaddr_info_get () failed for MacBook-Pro-Tim.local AH00558: httpd: Failed to reliably determine the fully qualified domain name of the server using 127.0.0.1. Set the global "ServerName" directive to suppress this message. OK syntax

What should I do?

+4
source share
1 answer

http://localhost/directory/, - . - , http://localhost/~username/directory ( , , ), , , ).

, .

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

. : - .

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

. sudo chmod 644 username.conf

: sudo nano /etc/apache2/httpd.conf (.. # , )

LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php5_module libexec/apache2/libphp5.so
Include /private/etc/apache2/extra/httpd-userdir.conf

sudo nano /etc/apache2/extra/httpd-userdir.conf Include /private/etc/apache2/users/*.conf apache. sudo apachectl restart http://localhost/~username/ . , .

: https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-macos-sierra/

+9

Source: https://habr.com/ru/post/1656152/


All Articles