Tuesday, April 23, 2024
 Popular · Latest · Hot · Upcoming
16
rated 0 times [  16] [ 0]  / answers: 1 / hits: 90207  / 2 Years ago, fri, april 29, 2022, 4:43:28

I have installed Apache2, mysql, php5 and phpmyadmin on my Ubuntu 14.04 but later on mistakenly I install nginx.



Now my localhost page show me Welcome to nginx server. And the localhost/phpmyadmin link is not working.



How can I get my LAMP server back?



i removed ngnix using command



sudo apt-get remove nginx
sudo apt-get purge nginx


installing apache



sudo apache2ctl restart


but at the end on restarting apache2 i get this error



sudo apache2ctl restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
httpd not running, trying to start
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'restart' failed.

More From » server

 Answers
1

First, you need to stop nginx so it releases port 80 so that apache2 can listen to it later on.



sudo service nginx stop


Next, if nginx was installed with apt-get, it can be removed by running one of the following two commands (I explained the difference in the next paragraph).



sudo apt-get remove nginx


Or



sudo apt-get purge nginx


Both of them remove all package files, while the second also removes the configuration files that package had installed.

If you intend to use nginx later on with the configuration you did, use remove. Else, I would suggest using purge.



After removing nginx, you can restart apache to make sure it is listening to port 80.



sudo apache2ctl restart


If you had removed apache before installing nginx, you can re-install it with



sudo apt-get install apache2

[#25064] Sunday, May 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ersoggles

Total Points: 69
Total Questions: 111
Total Answers: 111

Location: Vanuatu
Member since Sun, Oct 2, 2022
2 Years ago
;