0

Our server [ ubuntu 14.04 ] not working, so when i tried : sudo service apache2 restart, i got :

enter image description here

then when i tried grep -ri listen /etc/apache2 , i got

enter image description here

As mentioned here , i tried netstat -ltnp | grep :80 , i got :

enter image description here

edit

/etc/apache2/ports.cnf :

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I am not getting what next thing i need to do ?

2 Answers2

2

Looks like nginx is listening to port 80,you should stop nginx with this command sudo service nginx stopand start apache after.

Edit: after short discussion we figured out the problem was in: wrong config in /etc/hosts and running nginx server. everything fixed after moving apache to another port and adding correct hostname in hosts file.

AsenM
  • 1,048
1

Into the report of sudo service apache2 restart I can see two problems. The first one is the message sudo: unable to resolve host <host-name>. Probably the solution of that is here: When I run a sudo command it says unable to resolve host.

The second one as @AsenM noticed is that some other service (nginx) is listen to the port 80: make_sock: could not bind to address: ...:80. Usually you can use the command sudo lsof -i -n -P to investigate which service on which port listen.

pa4080
  • 29,831