Apache cannot boot Httpd:apr_sockaddr_info_get () failed XGP

Source: Internet
Author: User

Httpd:apr_sockaddr_info_get () failed for Hoteel
Httpd:could not reliably determine the server ' s fully qualified domain name, using 127.0.0.1 for ServerName
I prompted the above information when the service httpd restart. Although the start was successful, but also very depressed.
This is because I was hostname hoteel when I configured DNS.
Re-hostname localhost on the go.
I found some information about this on the Internet, and I posted it here by the way.
1
Occurs when the httpd is started
Starting Httpd:httpd:apr_sockaddr_info_get () failed for MYHOST
Httpd:could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName.
This problem should be not set in the/etc/httpd/conf/httpd.conf ServerName so it will be replaced with the name on the host, first will go to find/etc/hosts there is no host definition.
So to solve this problem can be set ServerName or in the/etc/hosts to fill in their host name MYHOST, like this:
>vi/etc/hosts
127.0.0.1 localhost.localdomain localhost MYHOST

2
Under Linux installed Apache 2.2.6, start HTTP service error, it does not seem to affect the use of services, but also very awkward.

[[email protected] http]#./apachectl start
Httpd:apr_sockaddr_info_get () failed for Linux (on BSD is Apr_sockaddr_info_get () failed for Freebsdla)
Httpd:could not reliably determine the server ' s fully qualified domain name, using 127.0.0.1 for ServerName

The analysis found that the Conf directory in the Apache configuration file httpd.conf in the hostname settings and/etc/sysconfig/network in the hostname settings caused by the unification, modified to a unified hostname can solve the problem.

Note: The/etc/sysconfig/network default hostname is: Hostname=localhost.localdomain

PS: It seems useless to have this method on the Internet, because I think Apache compiles ARP during the compilation and installation process, so the following operation is a bit superfluous.

Apr and Apr-util are included in the release source code of Apache httpd and are not problematic in most cases. Of course, if the 1.0 or 1.1 version of Apr or Apr-util is already installed on your system, you must either upgrade your apr/apr-util to 1.2, or compile the httpd separately. To install using the Apr/apr-util source code that comes with the release source, you must do it manually:

# Compile and install Apr 1.2

Apr
./configure--PREFIX=/X/HTTPD/APR
Make
Make install

Apr-util
./configure--prefix=/x/httpd/apr_util--WITH-APR=/X/HTTPD/APR
Make
Make install

Apache
./configure--prefix=/x/httpd/apache2 \
--ENABLE-SO \
--ENABLE-CGI \
--enable-rewrite \
--enable-mods-shared=all \
--WITH-APR=/X/HTTPD/APR \
--with-apr-util=/x/httpd/apr_util

Ldflags= "-l/usr/lib64-l/lib64"

Native correct setting instructions must be for the same

[[email protected" ~]# nl/etc/ HOSTS
     1 # Don't remove the following line, or various programs< BR style= "Word-wrap:break-word" >     2 # that require network functionality would fail.
     3 127.0.0.1 localhost.localdomain Spring


[[email protected" ~]# nl/etc/ SYSCONFIG/NETWORK
     1 networking=yes
     2 networking_ipv6=no
      3 hostname=spring
     4 #GATEWAY =192.168.8.1

[Email protected] ~]# Less/etc/httpd/conf/httpd.conf|grep ServerName
# ServerName gives the name and port, the server uses to identify itself.
#ServerName www.example.com:80
ServerName 127.0.0.1

Apache cannot boot Httpd:apr_sockaddr_info_get () failed XGP

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.