douxiong3234 2014-10-21 10:41
浏览 9

升级到Yosemite后,Apache配置中断

Yesterday I upgraded to Yosemite and now my local configuration for web development is not working anymore.

I managed to set up a userdir under /Users/user/public_html and I could access all the websites via localhost/~user/websitename. Nothing special, but it took me a while to configure.

Looking in the apache directory I saw that many files were replaced, keeping a backup. I tried putting back the files with my settings again, but still is not working. Maybe I'm missing some file that I don't remember.

This is httpd-userdir.conf:

# Settings for user home directories
#
# Required module: mod_userdir

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir public_html

#
# Users might not be in /Users/*/Sites, so use user-specific config files.
#
Include /private/etc/apache2/users/*.conf
<IfModule bonjour_module>
       RegisterUserSite customized-users
</IfModule>

<Directory "/Users/*/public_html/">
    AllowOverride FileInfo AuthConfig Limit Indexes
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        Order allow,deny
        Allow from all
</Directory>

Then in http.conf I have enabled some modules:

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

and this:

DocumentRoot "/Users/user/public_html"

Directory "/Users/user/public_html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks MultiViews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

If I simply try to access localhost, it displays the message "It works!". If I go to localhost/user simply doesn't load and the same if I try to access one of the websites.

Did I miss any file? In the apache logs it doesn't even display any error.

  • 写回答

2条回答 默认 最新

  • dongxixia6399 2014-10-27 11:58
    关注

    OS X 10.10 Yosemite comes with Apache 2.4 instead of Apache 2.2 in Mavericks.
    The major difference in configuration is that you have to replace...

    Order allow,deny
    Allow from all
    

    ...with...

    Require all granted
    

    See Apache doc's manual Upgrading to 2.4 from 2.2 for more details.

    UPDATE:
    Please be aware that after upgrading OS X you will usually find your old config files as backups next to the new ones written by Yosemite. They are labeled e.g. httpd.conf.pre-update and/or httpd.conf~previous and can be found in the same paths as the new configs (e.g. in /private/etc/apache2).

    评论

报告相同问题?

悬赏问题

  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装