`Apache` `localhost/~username/` not working

前端 未结 7 913
予麋鹿
予麋鹿 2020-11-28 00:40

UPDATE: The following answer will also work for El Capitan.

For people who just start, the file mentioned below is under /etc/apache2

For th

7条回答
  •  孤城傲影
    2020-11-28 01:23

    Following these instructions from start to finish worked for me: https://www.computersnyou.com/3376/setup-apache-php-mysql-macosx-10-10-yosemite/

    Basic instructions added in response to suggestion from rozkosz:

    These instructions are for setting up apache from scratch after upgrading the Yosemite. It seems like you've done most of this but you need to make edits to your /etc/apache2/users/YOURUSERNAME.conf. In any case, here's a summary of the whole thing:

    uncomment the following in /etc/apache2/httpd.conf

    LoadModule authn_core_module libexec/apache2/mod_authn_core.so
    LoadModule authz_host_module libexec/apache2/mod_authz_host.so 
    LoadModule userdir_module libexec/apache2/mod_userdir.so 
    Include /private/etc/apache2/extra/httpd-userdir.conf
    

    Then,go to /etc/apache2/extra/httpd-userdir.confand uncomment:

    Include /private/etc/apache2/users/*.conf 
    

    Your /etc/apache2/users/YOURUSERNAME.conf file should contain the following:

    
      DirectoryIndex index.html index.php index index.html default.html default.htm
      AllowOverride FileInfo AuthConfig Limit Indexes
      Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
      
       Require all granted
      
      
       Require all denied
      
    
    

    Now create the Sites folder in your home directory, restart apache, and all should be working properly.

提交回复
热议问题