Solution to httpd startup failure in Linux

Source: Internet
Author: User
How to solve httpd startup failure in Linux-Linux Enterprise Application-Linux server application information. Red Hat Linux enterprise 5
Start httpd faild
Linux httpd: httpd starts failed

I encountered this problem in the Virtual Machine. After trying many methods, I couldn't start it. Later I found that the problem lies in a file named httpd. conf in the/etc/httpd/conf/directory. There is another httpd in the same directory. conf. bak, as long as the httpd. conf. bak content replication httpd. in the conf file, overwrite the original content to start, and run service httpd start in shell.

Surprise, start httpd OK
Start httpd OK

Use service httpd status to check whether httpd is running. Feeling comfortable. Although it's just a beginner's problem, hey, but I still write it down. Maybe this problem may be helpful for a newbie. Later, I checked in detail what caused the problem. The result is unexpected. The [system]-[management]-[server settings]-[HTTP] tool was used for setting, and then saved and imported. After using this tool, the configuration content is quite different from the initial setting.

I found that modifying the/etc/httpd/conf/httpd. conf file can solve the problem:

1. comment out the ServerName line, that is, add a # sign at the beginning of the line.

2. Complete the ServerAdmin line. For example: ServerAdmin admin@example.com

3. Correct the file path of the Lockfile, or comment out all of them (add at the beginning of the line #)

4. Load module .........

Loadmodule .........

... # There are many lines. Omitted! In fact, these errors are caused by HTTP code problems. We replace it with an initial file.

Loadmodule .....

Replace the corresponding content in/etc/httpd/conf/httpd. conf. bak.

The content is as follows:
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. In this case, you can start the httpd service. Use the service httpd start command in shell to start the service.

In addition, it should be noted that only a small part of the content has been modified, and many options have been followed by the initial httdp. conf is different. Please take a closer look at the activation status of related functions and change it as needed.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.