Solution to the failure to start httpd in Linux operating system_PHP tutorial

WBOY
Release: 2016-07-13 17:29:53
Original
1257 people have browsed it

Red Hat Linux enterprise 5

start httpd faild

linux httpd: httpd 启动 failed

我在虚拟机里面遇到此问题,试了很多方法都没法启动,后来发现,问题出在/etc/httpd/conf/目录里面有一个叫httpd.conf的文件。在同一目录下还有另外一个叫httpd.conf.bak,只要把httpd.conf.bak的内容复制httpd.conf文件中,覆盖原来的内容就能启动了,到shell里运行service httpd start,惊喜发现,start httpd ok。启动httpd 确定

用service httpd status可以看到httpd正运行中。心情舒服啊。虽然只是个很菜的新手问题,嘿嘿,但我还是写下来,或许哪个新手也遇到此问题能帮上忙。后来我又详细排查了一下是什么问题导至的。结果是意料之外啊。原来是使用了 [系统]-[管理]-[服务器设置]-[HTTP]工具进行设置,然后保存之后导至。用了这个工具后里面的设置内容有比较多的地方跟初始设置是不一样的。

我发现修改/etc/httpd/conf/httpd.conf文件可以解决问题:

1.将ServerName这行注释掉,即行最前面加个#号。

2.将ServerAdmin 这行要写完整。如:ServerAdmin admin@example.com

3.将Lockfile 的文件路径弄正确,或都干脆注释掉(行首加#)

4.将Loadmodule .........

Loadmodule.........

.........#这里很多行。省略!其实这些都是错误的,应该是HTTP本身代码问题导致。我们用初始文件替换。

Loadmodule.....

用/etc/httpd/conf/httpd.conf.bak里面的相应内容替换掉

内容如下:

LoadModule auth_basic_module modules/mod_auth_basic.so

LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule authn_file_module modules/mod_authn_file.so

LoadModule authn_alias_module modules/mod_authn_alias.so

LoadModule authn_anon_module modules/mod_authn_anon.so

LoadModule authn_dbm_module modules/mod_authn_dbm.so

LoadModule authn_default_module modules/mod_authn_default.so

LoadModule authz_host_module modules/mod_authz_host.so

LoadModule authz_user_module modules/mod_authz_user.so

LoadModule authz_owner_module modules/mod_authz_owner.so

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so

LoadModule authz_dbm_module modules/mod_authz_dbm.so

LoadModule authz_default_module modules/mod_authz_default.so

LoadModule ldap_module modules/mod_ldap.so

LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

LoadModule include_module modules/mod_include.so

LoadModule log_config_module modules/mod_log_config.so

LoadModule logio_module modules/mod_logio.so

LoadModule env_module modules/mod_env.so

LoadModule ext_filter_module modules/mod_ext_filter.so

LoadModule mime_magic_module modules/mod_mime_magic.so

LoadModule expires_module modules/mod_expires.so

LoadModule deflate_module modules/mod_deflate.so

LoadModule headers_module modules/mod_headers.so

LoadModule usertrack_module modules/mod_usertrack.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule mime_module modules/mod_mime.so

LoadModule dav_module modules/mod_dav.so

LoadModule status_module modules/mod_status.so

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule info_module modules/mod_info.so

LoadModule dav_fs_module modules/mod_dav_fs.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule dir_module modules/mod_dir.so

LoadModule actions_module modules/mod_actions.so

LoadModule speling_module modules/mod_speling.so

LoadModule userdir_module modules/mod_userdir.so

LoadModule alias_module modules/mod_alias.so

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule cache_module modules/mod_cache.so

LoadModule suexec_module modules/mod_suexec.so

LoadModule disk_cache_module modules/mod_disk_cache.so

LoadModule file_cache_module modules/mod_file_cache.so

LoadModule mem_cache_module modules/mod_mem_cache.so

LoadModule cgi_module modules/mod_cgi.so

OK,这样应该可以启动httpd服务了,请在shell里使用命令service httpd start来启动服务

It should also be noted that these have only changed a small part of the content, and many options are different from the original httpdp.conf. Please check the enabled status of relevant functions in detail and change them as needed.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509213.htmlTechArticleRed Hat Linux enterprise 5 start httpd faild linux httpd: httpd start failed I encountered this problem in the virtual machine. I tried many methods but couldn't start it. Later I found out that the problem lies in...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template