apache2: apr_sockaddr_info_get() failed

While I was trying to restart apache from a VM, I was getting this weird error!

* Restarting web server apache2
apache2: apr_sockaddr_info_get() failed for ip-172-19-1-2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
... waiting apache2: apr_sockaddr_info_get() failed for ip-172-19-1-2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
But the solution for this problem is problem is too simple 🙂
just try the following steps:
 sudo nano /etc/apache2/httpd.conf 
Most probably the file is empty.
Just add the following line, and done!
 ServerName localhost 

[ localhost will be the servername. ]

Install phpmyadmin in ubuntu

In the previous article you’ve seen how to setup a LAMP server. Now if you want to install phpmyadmin open your terminal and type
sudo apt-get install phpmyadmin
follow the screen.

Now, open browser go to http://localhost/phpmyadmin/

you are done with your phpmyadmin installation. now, login with the password you provided earlier.

Install LAMP on ubuntu

Installing LAMP(Linux, Apache, MySQL, PHP) is not that tough now-a-days.

The easiest way
First open the synaptic manager with sudo synapti
then Edit ==> Mark Packages by Task
select LAMP server from the list and click OK.

Another easy way
go to terminal and type
sudo tasksel

press space bar to select and then tab to <ok>
Follow the screen.

One line command setup
go to terminal and type
sudo apt-get install lamp-server^
N. B the character ‘^’ is not a typo
Follow the screen, it’ll ask to change password for the root user of MySQL database.

Now. test Apache. Open a browser and type http://localhost/

if you see this, you are done with you apache installation.

test PHP installation. open terminal and type
sudo vim /var/www/test.php
save the file.
again, sudo /etc/init.d/apache2restart
now, open browser and try http://localhost/test.php

you see this, means your PHP installation is completed.

Test MySQL setup
go to terminal and type
mysql -u root -p

you see this, ahhhh….you are done with the famous LAMP installation 😀

For phpmyadmin setup try this