Miralem Cebic
Miralem Cebic

Reputation: 1286

Starting web server apache2 failed

I have a Virtual Server. Till yesterday everything works fine on it. Today my Hostcompany restarted my server to config something on I/O.

When I trying to get to my address I get

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further    configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

I tried to sudo service apache2 start and get these Error Message:

* Starting web server apache2                                                                                                     

(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 'start' failed.
The Apache error log may have more information.
* 
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

Does someone know how I can fix this problem?

Upvotes: 0

Views: 6426

Answers (5)

Noah Bennet
Noah Bennet

Reputation: 1

Try this. My Apache config has 2 extra lines by mistake.

"Include conf/extra/httpd-8080.conf"

"Include conf/extra/httpd-8080.conf"

Therefore, it was saying address already in use because it already loaded the Virtual host once and was trying again.

Solution was to delete this extra line and have only one include.

Upvotes: 0

thatzprem
thatzprem

Reputation: 4767

Stop Nginx service nginx stop

Restart Apache service apache2 restart

Upvotes: 1

Miralem Cebic
Miralem Cebic

Reputation: 1286

Here is my solution

first: sudo update-rc.d -f nginx remove than: sudo rm /etc/init.d/nginx

after restarting VM almost everything works fine. Some strange thing is almost there.

When I goto www.myfoobarwebpage.com now apache is working and it's all ok! When I goto myfoobarwebpage.com (without www.) I get "Welcome to nginx! ..."

Upvotes: 0

Daniel Rodriguez
Daniel Rodriguez

Reputation: 1

The problem is this, Nginx (another web server engine) it's using your port 80 so apache it's unable to start, a fast fix it turn of nginx and then restart apache.

You can do it with service nginx stop and service apache2 restart if you are using Ubuntu or Debian based release, if you are using an RHEL distro then use service nginx stop and service httpd restart

Upvotes: 0

Reza S
Reza S

Reputation: 9748

You have another webserver that's running on the host (probably as part of the startup during the restart) You need to shut that off first.

You can run netstat -tulpn | grep :80 and that'll tell you what that process is

Upvotes: 0

Related Questions