Can't restart apache (with nginx reverse proxy) because of |PORT_80| in httpd.conf

corneyl

Verified User
Joined
May 5, 2015
Messages
19
A week ago I enabled Let's Encrypt and ran the following commands without problems:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs

Now I wanted to change the certificate paths in directadmin.conf to a letsencrypt certificate, and after doing so and running again the rewrite_confs command, apache won't restart.
The problem is that in the httpd.conf template, it says 'Listen |PORT_80|', which also turned up in the real config file (/etc/httpd/conf/httpd.conf), so it was not rewritten to 80 or something like that.

But I'm running a reverse proxy with nginx listening on port 80. Shouldn't it be |PORT_8080| in the httpd.conf template? Can I just edit the template, or should i run some command to indicate that i'm using a reverse proxy? Why is this happening now, has it something to do with new certificate paths in directadmin.conf?

Btw, i changed back the certificate path and manually changed /etc/httpd/conf/httpd.conf to Listen 8080 instead of Listen |PORT_80|, and restarted httpd which went fine.

Thanks!
 
Hello,

Probably related:

Code:
# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd:
(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

Port 80, and it should be 8080

Code:
# grep ^Listen /etc/httpd/conf/httpd.conf
Listen 80

No custom template is used:

Code:
# ls -la /usr/local/directadmin/custombuild/*/ap2/conf/httpd.conf
-rw-r--r-- 1 root root 7074 Mar  1 03:46 /usr/local/directadmin/custombuild/configure/ap2/conf/httpd.conf

Default settings:

Code:
# /usr/local/directadmin/directadmin c | grep ^port
port=2222
port_80=80
port_443=443
port_8080=8080
port_8081=8081

Nginx as proxy installed:

Code:
# /usr/local/directadmin/directadmin c | grep nginx_proxy
nginx_proxy=1

Custombuild version:

Code:
# ./build version
2.0.0 (rev: 1506)
 
Fixed in CB 2.0 rev. 1506. Thank you for the report.

The rewrite now works fine in rev. 1506, httpd.conf now lists 'Listen 80', but because I'm using nginx as reverse proxy, it should be 'Listen 8080'. Something else wrong, or am I missing something?

Thanks!
 
Still seems to be not fixed even in rev: 1509

Code:
# ./build version2.0.0 (rev: 1509)


Code:
Restarting apache.
Stopping httpd:                                            [  OK  ]
Starting httpd: (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
 
2.0.0 (rev: 1510) still exist. Today I've installed DA with nginx_apache and have that same problem.
 
# ./build version
2.0.0 (rev: 1510)

Nginx proxy

Today i upgrade nginx to 1.9.12 from 1.9.11 which works great. And have the same issue with port 80 on Nginx or Apache (depending which is stareted first).

# grep ^Listen /etc/httpd/conf/httpd.conf
Listen 80
 
Last edited:
Back
Top