I have updated my OS to Yosemite and the only issue I have is that my localhost is not working anymore. Please excuse if the questions sounds dumb but I have limited knowledge about servers.
我已将我的操作系统更新为Yosemite,我唯一的问题是我的localhost不再工作了。如果问题听起来很愚蠢,但我对服务器的了解有限,请原谅。
with Mavericks I was able to use localhost
and customdomain.dev
right after a system start. Also my MySQL server has been started without any actions
使用Mavericks我可以在系统启动后立即使用localhost和customdomain.dev。我的MySQL服务器也已启动,没有任何操作
Now Google Chrome throws an ERR_CONNECTION_REFUSED
error when using localhost.
现在,Google Chrome在使用localhost时会抛出ERR_CONNECTION_REFUSED错误。
I run
我跑
apachectl configtest
which returns
返回
httpd: Syntax error on line 58 of /private/etc/apache2/httpd.conf: Cannot load libexec/apache2/mod_authn_default.so into server: dlopen(/usr/libexec/apache2/mod_authn_default.so, 10): image not found
if I comment out this line it continues with other modules. When I comment out all modules which causes this syntax error I get
如果我注释掉这一行,它会继续其他模块。当我注释掉导致这种语法错误的所有模块时,我得到了
AH00526: Syntax error on line 131 of /private/etc/apache2/httpd.conf:
Invalid command 'User', perhaps misspelled or defined by a module not included in the server configuration
I'm using the httpd.conf
file from Mavericks (where everything worked fine)
我正在使用Mavericks的httpd.conf文件(一切正常)
I have no idea what I should do next
我不知道下一步该做什么
4 个解决方案
#1
34
Did you retain your original httpd.conf from before the upgrade? You may have to edit the modules in your httpd.conf
您是否在升级之前保留了原始的httpd.conf?您可能需要编辑httpd.conf中的模块
I found that an Apache upgrade came along with Yosemite. Apparently there are several authentication-related changes from Apache 2.2 to 2.4. I had to run sudo apachectl configtest
repeatedly to display which modules to remove.
我发现与Yosemite一起进行了Apache升级。显然,从Apache 2.2到2.4有几个与身份验证相关的更改。我不得不反复运行sudo apachectl configtest来显示要删除的模块。
Then, I had to add some modules. My modules look like this now:
然后,我不得不添加一些模块。我的模块现在看起来像这样:
LoadModule authn_file_module libexec/apache2/mod_authn_file.so
LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so
LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so
LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so
#LoadModule authn_default_module libexec/apache2/mod_authn_default.so
LoadModule authn_core_module libexec/apache2/mod_authn_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache2/mod_authz_user.so
LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so
LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so
#LoadModule authz_default_module libexec/apache2/mod_authz_default.so
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so
LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so
LoadModule cache_module libexec/apache2/mod_cache.so
#LoadModule disk_cache_module libexec/apache2/mod_disk_cache.so
#LoadModule mem_cache_module libexec/apache2/mod_mem_cache.so
LoadModule dbd_module libexec/apache2/mod_dbd.so
LoadModule dumpio_module libexec/apache2/mod_dumpio.so
LoadModule reqtimeout_module libexec/apache2/mod_reqtimeout.so
LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule filter_module libexec/apache2/mod_filter.so
LoadModule substitute_module libexec/apache2/mod_substitute.so
LoadModule deflate_module libexec/apache2/mod_deflate.so
LoadModule log_config_module libexec/apache2/mod_log_config.so
LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so
LoadModule logio_module libexec/apache2/mod_logio.so
LoadModule env_module libexec/apache2/mod_env.so
LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so
#LoadModule cern_meta_module libexec/apache2/mod_cern_meta.so
LoadModule expires_module libexec/apache2/mod_expires.so
LoadModule headers_module libexec/apache2/mod_headers.so
#LoadModule ident_module libexec/apache2/mod_ident.so
LoadModule usertrack_module libexec/apache2/mod_usertrack.so
#LoadModule unique_id_module libexec/apache2/mod_unique_id.so
LoadModule setenvif_module libexec/apache2/mod_setenvif.so
LoadModule version_module libexec/apache2/mod_version.so
LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so
LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so
LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so
#LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so
LoadModule ssl_module libexec/apache2/mod_ssl.so
LoadModule mime_module libexec/apache2/mod_mime.so
LoadModule dav_module libexec/apache2/mod_dav.so
LoadModule status_module libexec/apache2/mod_status.so
LoadModule autoindex_module libexec/apache2/mod_autoindex.so
LoadModule asis_module libexec/apache2/mod_asis.so
LoadModule info_module libexec/apache2/mod_info.so
LoadModule cgi_module libexec/apache2/mod_cgi.so
LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
LoadModule negotiation_module libexec/apache2/mod_negotiation.so
LoadModule dir_module libexec/apache2/mod_dir.so
LoadModule imagemap_module libexec/apache2/mod_imagemap.so
LoadModule actions_module libexec/apache2/mod_actions.so
LoadModule speling_module libexec/apache2/mod_speling.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
#LoadModule perl_module libexec/apache2/mod_perl.so
#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule unixd_module libexec/apache2/mod_unixd.so
LoadModule access_compat_module libexec/apache2/mod_access_compat.so
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so
You'll see that I commented out a few. There are a few new ones. The two _core_
ones, unixd_module
, and access_compat_module
are new. Don't mind the strange looking PHP module. That's from Homebrew's PHP.
你会看到我评论了一些。有一些新的。两个_core_,unixd_module和access_compat_module都是新的。不要介意奇怪的PHP模块。这是来自Homebrew的PHP。
I also had to remove the LockFile
directive in httpd-mpm.conf
. And the NameVirtualHost
directive in httpd-vhosts.conf
.
我还必须在httpd-mpm.conf中删除LockFile指令。和httpd-vhosts.conf中的NameVirtualHost指令。
I hope this helps.
我希望这有帮助。
#2
1
Since Mac OSX 10.10 Yosemite
the Web Sharing
option located previously in Settings -> Sharing ceased to exist, now manual configuration is necessary.
由于Mac OSX 10.10 Yosemite之前位于设置 - >共享中的Web共享选项不再存在,现在需要手动配置。
check this link: http://ole.michelsen.dk/blog/setup-local-web-server-apache-php-osx-yosemite.html
检查此链接:http://ole.michelsen.dk/blog/setup-local-web-server-apache-php-osx-yosemite.html
#3
0
Except Stephen Farmers very good answer. I also had to add one more module.
斯蒂芬·法默斯除了非常好的答案。我还需要再添加一个模块。
LoadModule slotmem_shm_module libexec/apache2/mod_slotmem_shm.so
Otherwise apaches log was filled with messages like:
否则,apaches日志中充满了以下消息:
[proxy_balancer:emerg] [pid 25593] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??
and it would not start.
它不会开始。
Works fine now.
现在工作正常。
Link to Apaches bugzilla report of this
链接到Apaches bugzilla报告
#4
0
Adding this module seems to fix: Invalid command 'User'
添加此模块似乎已修复:无效命令'User'
LoadModule unixd_module modules/mod_unixd.so
#1
34
Did you retain your original httpd.conf from before the upgrade? You may have to edit the modules in your httpd.conf
您是否在升级之前保留了原始的httpd.conf?您可能需要编辑httpd.conf中的模块
I found that an Apache upgrade came along with Yosemite. Apparently there are several authentication-related changes from Apache 2.2 to 2.4. I had to run sudo apachectl configtest
repeatedly to display which modules to remove.
我发现与Yosemite一起进行了Apache升级。显然,从Apache 2.2到2.4有几个与身份验证相关的更改。我不得不反复运行sudo apachectl configtest来显示要删除的模块。
Then, I had to add some modules. My modules look like this now:
然后,我不得不添加一些模块。我的模块现在看起来像这样:
LoadModule authn_file_module libexec/apache2/mod_authn_file.so
LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so
LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so
LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so
#LoadModule authn_default_module libexec/apache2/mod_authn_default.so
LoadModule authn_core_module libexec/apache2/mod_authn_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache2/mod_authz_user.so
LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so
LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so
#LoadModule authz_default_module libexec/apache2/mod_authz_default.so
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so
LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so
LoadModule cache_module libexec/apache2/mod_cache.so
#LoadModule disk_cache_module libexec/apache2/mod_disk_cache.so
#LoadModule mem_cache_module libexec/apache2/mod_mem_cache.so
LoadModule dbd_module libexec/apache2/mod_dbd.so
LoadModule dumpio_module libexec/apache2/mod_dumpio.so
LoadModule reqtimeout_module libexec/apache2/mod_reqtimeout.so
LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule filter_module libexec/apache2/mod_filter.so
LoadModule substitute_module libexec/apache2/mod_substitute.so
LoadModule deflate_module libexec/apache2/mod_deflate.so
LoadModule log_config_module libexec/apache2/mod_log_config.so
LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so
LoadModule logio_module libexec/apache2/mod_logio.so
LoadModule env_module libexec/apache2/mod_env.so
LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so
#LoadModule cern_meta_module libexec/apache2/mod_cern_meta.so
LoadModule expires_module libexec/apache2/mod_expires.so
LoadModule headers_module libexec/apache2/mod_headers.so
#LoadModule ident_module libexec/apache2/mod_ident.so
LoadModule usertrack_module libexec/apache2/mod_usertrack.so
#LoadModule unique_id_module libexec/apache2/mod_unique_id.so
LoadModule setenvif_module libexec/apache2/mod_setenvif.so
LoadModule version_module libexec/apache2/mod_version.so
LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so
LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so
LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so
#LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so
LoadModule ssl_module libexec/apache2/mod_ssl.so
LoadModule mime_module libexec/apache2/mod_mime.so
LoadModule dav_module libexec/apache2/mod_dav.so
LoadModule status_module libexec/apache2/mod_status.so
LoadModule autoindex_module libexec/apache2/mod_autoindex.so
LoadModule asis_module libexec/apache2/mod_asis.so
LoadModule info_module libexec/apache2/mod_info.so
LoadModule cgi_module libexec/apache2/mod_cgi.so
LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
LoadModule negotiation_module libexec/apache2/mod_negotiation.so
LoadModule dir_module libexec/apache2/mod_dir.so
LoadModule imagemap_module libexec/apache2/mod_imagemap.so
LoadModule actions_module libexec/apache2/mod_actions.so
LoadModule speling_module libexec/apache2/mod_speling.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
#LoadModule perl_module libexec/apache2/mod_perl.so
#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule unixd_module libexec/apache2/mod_unixd.so
LoadModule access_compat_module libexec/apache2/mod_access_compat.so
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so
You'll see that I commented out a few. There are a few new ones. The two _core_
ones, unixd_module
, and access_compat_module
are new. Don't mind the strange looking PHP module. That's from Homebrew's PHP.
你会看到我评论了一些。有一些新的。两个_core_,unixd_module和access_compat_module都是新的。不要介意奇怪的PHP模块。这是来自Homebrew的PHP。
I also had to remove the LockFile
directive in httpd-mpm.conf
. And the NameVirtualHost
directive in httpd-vhosts.conf
.
我还必须在httpd-mpm.conf中删除LockFile指令。和httpd-vhosts.conf中的NameVirtualHost指令。
I hope this helps.
我希望这有帮助。
#2
1
Since Mac OSX 10.10 Yosemite
the Web Sharing
option located previously in Settings -> Sharing ceased to exist, now manual configuration is necessary.
由于Mac OSX 10.10 Yosemite之前位于设置 - >共享中的Web共享选项不再存在,现在需要手动配置。
check this link: http://ole.michelsen.dk/blog/setup-local-web-server-apache-php-osx-yosemite.html
检查此链接:http://ole.michelsen.dk/blog/setup-local-web-server-apache-php-osx-yosemite.html
#3
0
Except Stephen Farmers very good answer. I also had to add one more module.
斯蒂芬·法默斯除了非常好的答案。我还需要再添加一个模块。
LoadModule slotmem_shm_module libexec/apache2/mod_slotmem_shm.so
Otherwise apaches log was filled with messages like:
否则,apaches日志中充满了以下消息:
[proxy_balancer:emerg] [pid 25593] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??
and it would not start.
它不会开始。
Works fine now.
现在工作正常。
Link to Apaches bugzilla report of this
链接到Apaches bugzilla报告
#4
0
Adding this module seems to fix: Invalid command 'User'
添加此模块似乎已修复:无效命令'User'
LoadModule unixd_module modules/mod_unixd.so