Solved Appache not running (AH00526)

Davey

Verified User
Joined
Sep 27, 2007
Messages
16
Location
NL
Apache is not running on our webserver.
AH00526: Syntax error on line 31 of /etc/httpd/conf/extra/httpd-vhosts.conf:
The address or port is invalid


Our httpd-vhosts.conf looks likes this:

<VirtualHost [178.18.82.4.bak 178.18.82.4 2a02:348:55:5204:0:0:0:1]:80>
ServerAdmin [email protected]
UserDir public_html
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
CustomLog /var/log/httpd/access_log combined
ErrorLog /var/log/httpd/error_log

<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>
</VirtualHost>

<VirtualHost [178.18.82.4.bak 178.18.82.4 2a02:348:55:5204:0:0:0:1]:443>
ServerAdmin [email protected]
UserDir public_html
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
CustomLog /var/log/httpd/access_log combined
ErrorLog /var/log/httpd/error_log

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt.combined
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
#SSLCACertificateFile /etc/httpd/conf/ssl.crt/server.ca

<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>
</VirtualHost>

./build apache d gives the same error.

./build rewrite_confs gives:
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using [178.18.82.4.bak
178.18.82.4
2a02:348:55:5204:0:0:0:1] for your server IP
./build: line 15515: [: too many arguments


Any ideas?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,224
Location
Maastricht
Remove it.
change:
Code:
<VirtualHost [178.18.82.4.bak 178.18.82.4 2a02:348:55:5204:0:0:0:1]:443>
to
Code:
<VirtualHost [178.18.82.4 2a02:348:55:5204:0:0:0:1]:443>
where present, and restart apache. See if it still throws errors or not.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,224
Location
Maastricht
Also check /usr/local/directadmin/custombuild/custom/ap2/extra directory if a httpd-vhosts.conf (or any other file) is in there too.
 

Davey

Verified User
Joined
Sep 27, 2007
Messages
16
Location
NL
removing the 178.18.82.4.bak (2x) does not help.

/usr/local/directadmin/custombuild/custom/ap2/extra/httpd-vhosts.conf


<VirtualHost |IP|:|PORT_80||LINKEDIP|>
ServerAdmin [email protected]
UserDir public_html
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
CustomLog /var/log/httpd/access_log combined
ErrorLog /var/log/httpd/error_log

<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>
</VirtualHost>

<VirtualHost |IP|:|PORT_443||LINKEDIPSSL|>
ServerAdmin [email protected]
UserDir public_html
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
CustomLog /var/log/httpd/access_log combined
ErrorLog /var/log/httpd/error_log

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/server.ca

<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>
</VirtualHost>

Thanks for the assistance!
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,224
Location
Maastricht
removing the 178.18.82.4.bak (2x) does not help.
Exactly how did it not help? If apache still not starts, you should get another error notice now.

Try this via SSH as root:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
after that, the httpd-vhosts.conf in the normal directory should look the same (but with ip's) as in the /custom/ap2/extra directory.

If you start apache again after that, does it work? If not, what is the exact error notice?

If it does not start, also do this command and check the output:
apachectl configtest
 

Davey

Verified User
Joined
Sep 27, 2007
Messages
16
Location
NL
Exactly how did it not help? If apache still not starts, you should get another error notice now.
Same error.

/sbin/service httpd start 2>&1

----------------
Code:
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
-------------------
Gives:

[[email protected] custombuild]# ./build rewrite_confs
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using [178.18.82.4.bak
178.18.82.4
2a02:348:55:5204:0:0:0:1] for your server IP
./build: line 15515: [: too many arguments
Gracefully shutting down php-fpm80: . done
Starting php-fpm80: [14-Jan-2022 19:25:04] NOTICE: PHP message: PHP Warning: PH P Startup: Unable to load dynamic library 'redis.so' (tried: /usr/local/php80/li b/php/extensions/no-debug-non-zts-20200930/redis.so (/usr/local/php80/lib/php/ex tensions/no-debug-non-zts-20200930/redis.so: cannot open shared object file: No such file or directory), /usr/local/php80/lib/php/extensions/no-debug-non-zts-20 200930/redis.so.so (/usr/local/php80/lib/php/extensions/no-debug-non-zts-2020093 0/redis.so.so: cannot open shared object file: No such file or directory)) in Un known on line 0
done
Restarting apache.
AH00526: Syntax error on line 31 of /etc/httpd/conf/extra/httpd-vhosts.conf:
The address or port is invalid
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,224
Location
Maastricht
I think that is caused by that custom vhost. Probably used to get your ipv6 in there. But I'm not into ipv6 so I have to let go for that part.

Like active8 said, same.bak file and seems only the custom config can create something like that.
 

Davey

Verified User
Joined
Sep 27, 2007
Messages
16
Location
NL
Do not need the ipv6, looking to remove it from de vhosts.
After a ./build rewrite_confs the .bak is back.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
9,224
Location
Maastricht
If you don't need it, then why the custom vhost? Try this.
Move the /usr/local/directadmin/custom/ap2/extra/httpd-vhost.conf to some place else.
Check if there is no other content in the /custom directory and beneath (if yes mention it first)

Then run the rewrite_confs again and see if that .bak is removed. My feeling says everything will be working again then, but I'm not sure anymore.
 

Davey

Verified User
Joined
Sep 27, 2007
Messages
16
Location
NL
bak.png

.bak indeed. Removed it. Did a DA restart, same issue.

./build rewrite_confs gives:

Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using [178.18.82.4
2a02:348:55:5204:0:0:0:1] for your server IP
/usr/local/directadmin/custombuild/build: line 15515: [: /usr/local/directadmin/data/admin/ips/[178.18.82.4: binary operator expected
Gracefully shutting down php-fpm74: . done
Starting php-fpm74: done
Restarting apache.
AH00526: Syntax error on line 31 of /etc/httpd/conf/extra/httpd-vhosts.conf:
The address or port is invalid
 

jamgames2

Verified User
Joined
Aug 16, 2019
Messages
786
and what about that ipv6 ? did you use it ?
maybe it could remove that too. right ?
 
Top