OS X apache配置,若碰到"The requested URL /~your userName/ was not found on this server."这里有详细解答...

从网上随便搜一下,按步骤做到修改/etc/apache2/httpd.conf

在网上查了半天,我是漏了一句这个

#LoadModule userdir_module libexec/apache2/mod_userdir.so

这是我的,已经改好了

Last login: Thu Aug 11 19:31:58 on ttys003
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/httpd.conf
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo apachectl restart
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2.httpd.conf
Password:
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/httpd.conf
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/httpd-userdir.conf
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/extra/httpd-userdir.conf
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo apachectl restart
hanxueyingdeMacBook-Pro:~ hanxueying$ vi /etc/apache2/users/hanxueying.conf

[No write since last change]
/bin/bash: wq: command not found

shell returned 127

Press ENTER or type command to continue
[No write since last change]
/bin/bash: wq: command not found

shell returned 127

Press ENTER or type command to continue
[No write since last change]

Press ENTER or type command to continue
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/users/hanxueying.conf
Password:
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo apachectl restart
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/users/hanxueying.conf
Password:
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/users/hanxueying.conf
hanxueyingdeMacBook-Pro:~ hanxueying$ sudo vi /etc/apache2/httpd.conf

#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
# will be interpreted as '/logs/access_log'.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
"/etc/apache2/httpd.conf" 531L, 20592C

 

还有在 /private/etc/apache2/users/Your UserName.conf中要写为

<Directory "/Users/YourUserName/Sites/">
  Options Indexes MultiViews
  AllowOverride None
  Require all granted
</Directory>

 

转载于:https://www.cnblogs.com/HackHer/p/5763047.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值