Ubuntu: How to activate apache2?



Question:

I installed apache2 as follows on my Ubuntu 16.04LTS machine:

$ sudo apt-get upgrade  $ sudo apt-get install apache2  

Everythings worked fine here.But after I typed:

$ sudo systemctl start apache2  $ sudo systemctl status apache2  

It showed this:

apache2.service - LSB: Apache2 web serve    Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)  Drop-In: /lib/systemd/system/apache2.service.d           â""â"€apache2-systemd.conf   Active: inactive (dead) since Tue 2017-05-16 21:00:45 CST; 16s ago     Docs: man:systemd-sysv-generator(8)  Process: 5436 ExecStop=/etc/init.d/apache2 stop (code=exited,status=0/SUCCESS  Process: 5420 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCE    May 16 21:00:45 shayuxiong-X555LPB apache2[5420]: (98)Address already in use: AH  May 16 21:00:45 shayuxiong-X555LPB apache2[5420]: (98)Address already in use: AH  May 16 21:00:45 shayuxiong-X555LPB apache2[5420]: no listening sockets available  May 16 21:00:45 shayuxiong-X555LPB apache2[5420]: AH00015: Unable to open logs  May 16 21:00:45 shayuxiong-X555LPB apache2[5420]: Action 'start' failed.  May 16 21:00:45 shayuxiong-X555LPB apache2[5420]: The Apache error log may have   May 16 21:00:45 shayuxiong-X555LPB apache2[5420]:  *  May 16 21:00:45 shayuxiong-X555LPB apache2[5436]:  * Stopping Apache httpd web s  May 16 21:00:45 shayuxiong-X555LPB apache2[5436]:  *  May 16 21:00:45 shayuxiong-X555LPB systemd[1]: Started LSB: Apache2 web server.  

Then I just uninstall apache2 and reinstall it,but the situation still occured. So how can I activate apache2? What does "no listening sockets available" means? I am totally new to the LAMP installation and this platform.Thanks in advance :)


Solution:1

Try the following solution:

  1. Alter the listening port for nginx server by opening /etc/nginx/sites-available and changing the port or line listen: 80 to whatever port you like.

  2. Reload nginx server:

    sudo systemctl restart nginx  
  3. Now try re-installing apache again.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »