Page 1 of 1

Error: Apache & Nginx Running ON Same Port

Posted: Sun Apr 17, 2016 5:58 pm
by cdg
After about a week of not even touching my server, I rebooted it and when rebooting I noticed that apache could no start.
After looking into the problem, I found that Apache and Nginx were both trying to run on port 8080, and if I stopped Nginx I could start Apache and vise versa.

The errors I am receiving are:

(For Apache): (98)Address already in use: AH00072: make_sock: could not bind to address 192.168.0.39:8080

(For Nginx): nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)

How can I fix this and how could this happen randomly?

The only thing I can access on the server is port 8083, and all the websites are down.

Thanks for any help.

Re: Error: Apache and Nginx start...

Posted: Mon Jul 09, 2018 9:01 am
by vedavrat
I installed NGINX with nginx-rtmp-module
using doc: https://github.com/arut/nginx-rtmp-modu ... nginx-rtmp

Then started NGINX:

Code: Select all

 /usr/local/nginx/sbin/nginx 
But APACHE failed:

Code: Select all

 service apache2 restart 
gives
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

Code: Select all

     journalctl -xe 
-- Unit apache2.service has begun starting up.
Jul 09 10:58:08 vedavrat.org apachectl[6796]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jul 09 10:58:08 vedavrat.org apachectl[6796]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jul 09 10:58:08 vedavrat.org apachectl[6796]: no listening sockets available, shutting down
Jul 09 10:58:08 vedavrat.org apachectl[6796]: AH00015: Unable to open logs
Jul 09 10:58:08 vedavrat.org apachectl[6796]: Action 'start' failed.
Jul 09 10:58:08 vedavrat.org apachectl[6796]: The Apache error log may have more information.
Jul 09 10:58:08 vedavrat.org systemd[1]: apache2.service: Control process exited, code=exited status=1
Jul 09 10:58:08 vedavrat.org systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit apache2.service has failed

What to do?

(((
OS = Debian9
Linux vedavrat.org 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
)))