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

前端 未结 7 930
予麋鹿
予麋鹿 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:32

    Resuming for El Captain, with users support:

    • sudo nano /private/etc/apache2/users/username.conf

      
          Options Indexes MultiViews FollowSymLinks Includes ExecCGI
          AllowOverride All
          Order allow,deny
          Allow from localhost
          Require all granted
      
      
    • sudo nano /etc/apache2/httpd.conf, uncomment:

      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 cgi_module libexec/apache2/mod_cgi.so
      LoadModule php5_module libexec/apache2/libphp5.so
      
      Include /private/etc/apache2/extra/httpd-userdir.conf
      
    • sudo nano /etc/apache2/extra/httpd-userdir.conf, uncomment:

      Include /private/etc/apache2/users/*.conf
      
    • apachectl configtest

    • sudo apachectl restart

    Taken from here.

提交回复
热议问题