7

Today while trying to start apache server I received an error:

Apr_sockaddr_info_get() Failed

I would like to get opinions / answers to resolve this issue.

I would like to know what exactly is wrong with my current setup and what are correct steps I need to take to resolve it.

Just to start apache server I referred to http://www.webune.com/forums/apr-sockaddr-info-get-failed.html and server started without error but I don't see website coming online yet.

I'm not exactly sure what all information is required to resolve it, you guys can ask me and I'll reply with required information

1
  • is your ServerName defined in your httpd.conf?
    – organicit
    May 1, 2012 at 2:33

2 Answers 2

8

Fix your hosts file at /etc/hosts.

1) From command line type hostname to get your hostname. Example output might be example.com

2) Edit /etc/hosts and change the lines to match your hostname. Example:

    ::1 localhost.example.com localhost
    127.0.0.1 localhost.example.com localhost
    192.168.1.104 example.com example
    192.168.1.104 example.com.

3) Open your httpd.conf file and make sure ServerName is defined. If it is not add ServerName example.com

4) Restart apache via command line apachectl -k graceful OR apachectl -k restart

2
  • For multiple domains, would you simply add in the other sites to the hosts file?
    – Gerico
    Jan 27, 2014 at 6:59
  • @Mat-visual yes, as many as you like. Jan 27, 2014 at 17:27
3

just try the following steps:

sudo nano /etc/apache2/httpd.conf 

Most probably the file will be empty.

Just add the following line, and you are done!

ServerName localhost 

[ localhost will be the servername. ]

Then you can restart service by typing the code below:

sudo service apache2 restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.