Solution to failure of Apache server

Source: Internet
Author: User
This article introduces some solutions for Apache server failure. For more information, see Apache.

Cause 1:Port 80Take up IIS, for example, Thunder. My apache server cannot be enabled due to thunder!

Cause 2: Some software installed in the software conflict will make apache unable to start, such as Dr.com, you open the network connection-> TcpIp properties-> Advanced-> WINS tag to remove the netbios lmhosts check, disable netbios for TCP/IP. and then start it.


Cause 3: httpd. conf configuration error if apache configuration file httpd. conf is wrong. if you start it in windows, the system will prompt the requested operation has failed. this is depressing because it takes a long time to check the error. In fact, you can start apache in command line mode with parameters. apache will prompt you which sentence is incorrect, and then you can solve the problem accordingly.

Check error methods

Go to cmd and enter the Apache installation directory (your own installation directory) \ bin> httpd.exe-w-n "Apache2"-k start (change Apache2 in quotation marks to your Apache service name, my service name is Apache2 and can be found in the computer service)

When a problem occurs in row 133 (prompt: Syntax error on line 133 ...........), open the Apache installation directory \ conf \ httpd. conf: Find the ServerAdmin of row 133rd (if there is no tool to determine the number of rows, press ctrl + F and use the "ServerAdmin" keyword to search for the number. there are usually two rows, and the following is the one). This row is left blank after it, add a name as needed. for example, after abc is added, it can be solved.

If the port is occupied (Note: (OS 10048) each socket address (Protocol/network address/Port) can only be used once .), Log out of Apache, search for Listen 80 in httpd. conf, change 80 to 8080 or another port number, and run Apache again.

Solution to website root directory mismatch


If the root directory of the website is set incorrectly, it cannot be started. There are many Apache tasks. There are two problems. In httpd. conf, find Apache/htdocs. modify it, for example, K:/IDDCWEB/wwwroot. Change the file address "\" to "/" in Apache. If you are using Apache2.24, select php5apache2_2.dll in php to load.

The following are some settings for modifying httpd. conf by yourself for your reference and comparison.

1. modify the root directory of the website in two ways. Search for DocumentRoot and Directory. modify the file address, such as D:/wwwroot. change the file address "\" to "/" in Apache.

2. set the home page, DirectoryIndex, and add related home items, such as index. php ihdex.htm.

3. find LoadModule ssl and add two lines below. The first line is "LoadModule php5_module. D:/Server/php/php5apache2_2.dll is used to load php in module mode, and "PHPIniDir" D:/php "in the second line indicates the php configuration file. the ini location is, of course, where "D:/php" should be changed to the directory you have previously selected for php decompression.

4. find AddType application/x-gzip. gz. add "AddType application/x-httpd-php. php "," AddType application/x-httpd-php. html "two lines, you can also add more, the essence is to add file types that can execute php, for example, if you add a line "AddType application/x-httpd-php .htm.pdf", The .htm file can also execute the php program. you can even add the last line "AddType application/x-httpd-php. txt, so that the common text file format can also run php programs.

5. search for "ServerName" and change the port after the website name to the previously modified port. if no change is made, skip this step.


D: \ Program Files \ Apache2.2 \ bin> httpd-t. [Wed Jun 22 14:34:49 2011] [warn] module php5_module is already loaded, skipping Syntax error on line 503 of D:/Program Files/Apache2.2/conf/httpd. conf:
PHPINIDir takes one argument, Directory containing the php. ini file. This is very simple. open "D:/Program Files/Apache2.2/conf/httpd. conf" in Notepad. do you see one of the last few lines?[PHPIniDir ""]. The error is caused by the absence of a parameter in double quotation marks.

Solution:
Find your php installation directory. for example, if my directory is D:/Program Files/PHP, you only need to add "D:/Program Files/PHP/php. ini" to the double quotes above"

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.