Apache gives an error of AH00526 (restart)

November 22, 2014 2k views

The error massage that I get when I try to restart apache

AH00526: Syntax error on line 20 of /etc/apache2/sites-enabled/zzz-deny-generic.conf:
Invalid ServerName "*" use ServerAlias to set multiple server names.
Action 'configtest' failed.
The Apache error log may have more information.

What shoul I do?

1 comment
2 Answers
# zzz-deny-generic
# (c) Chris Stephenson 2014
# Licensed under GNU Public License v3 or later
# No warranty explicit or implied that this script is fit for purpose or even that it will not harm your computer
# This is the belt to default’s braces
# It tries to explicitly match any stray virtual host requests and deny them
# Not foolproof and needs to be done again for each ip on the server
# I couldn’t find a better way.
# Insert the correct IP in the VirtualHost line. If there is more than one IP on the server, repeat the
# whole VirtualHost block with that IP at the beginning.
<VirtualHost _IP_:80>
# match just about anything
ServerName *
ServerAlias *.*
ServerAlias *.*.*
ServerAlias *.*.*.*
ServerAlias *.*.*.*.*
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
# ban any access
<Directory />
AllowOverride None
Order allow,deny
deny from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Have another answer? Share your knowledge.