Resolve Apache Startup Error "Httpd:could not reliably determine ..."

Source: Internet
Author: User
Tags fully qualified domain name

The following is a summary of how to handle errors when configuring and starting Apache2

First, start Apache encountered error: Httpd:could not reliably determine the server ' s fully qualified domain name [root@server httpd-2.2.4]#/US R/local/apache/bin/apachectl start

Httpd:could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

1 Enter the installation directory of Apache: (depending on the individual installation situation) [Root@server ~]# cd/usr/local/apache/conf

2) Edit httpd.conf file, search "#ServerName", add ServerName localhost:80
[Root@server conf]# ls
Extra httpd.conf Magic Mime.types Original
[Root@server conf]# VI httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
3) and then restart the Apache can be.

[Root@server ~]#/usr/local/apache/bin/apachectl Restart


Second, restart the error apache2 address already in use:make_sock:could not bind to address [::]:80

This error is used for the port and only the root user is allowed to view all ports being occupied.

$su

#netstat-LNP | grep 80

TCP 0 x x.x.x.x:8084 ... listen 1167/mono

TCP 0 x x.x.x.x:80 ... listen 1194/inetd

UDP 0 x x.x.x.x:2080 ... listen 14427/drcomauthsvr

Check to see that inetd occupies 80 ports.

#kill 1194

#exit//Exit root user

$sudo apapche2ctl-k Start

Started successfully.

Third, after the installation of Apache2 default index.html Web page inside text display garbled, modify Adddefaultcharset also no use, even in the head of the Web page to add meta, designated charset=gb2312| GBK's no use.

Attention, pro, here because the default document font size is h1, large font, Chinese can not be displayed, here, modified for small font can, I modified for H5, garbled disappeared, normal display of Chinese.

Four, in the Web page run HTML file call CGI program, the hint can not find the CGI program and find the program after the desired results.

First look at the apache2 configuration file and/etc/apache2/site-enables the default Cgi-bin directory in the system, where you can modify the default Cgi-bin directory as needed. Apt installed after the default Cgi-bin directory is in/usr/lib/cgi-bin/

Specifically modify the Scriptalias parameter, if you do not know your similar site-enables directory, after all, there are some different versions, you can directly search Scriptalisa this parameter, because no matter which version, this parameter is basically unchanged.

After the above changes to find the program, found not to get the desired results, it may be due to the differences in the compilation environment, this time may be based on your compilation environment to modify the source code you write.


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.