I edited the file /etc/apache2/sites-enabled/000-default and then tried to restart my apache server and this error came up:
Syntax error on line 20 of /etc/apache2/sites-enabled/000-default.save:
unknown order
Action 'configtest' failed.
Here is what the 000-default file looks like:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
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
</VirtualHost>
Best Answer
EDIT Just a quick note to say, one way to avoid having your Apache server hosed if the config file chokes due to a change is to first
reload
Apache to see how it parses the config.The nice thing about
reload
is it will attempt to reload the settings in a config file, but it won’t force the server to stop or restart. If it chokes, it will send up an alert, but your Apache server is still running smoothly. If after areload
all is clean, you can thenrestart
Apache to force settings if you wish.Now, specific to your question the error states:
But then you are referring to:
Seems like something went amiss when you were editing the
000-default
file since that.save
file shows up when a crash or some other non-normal way of exiting the editor happens.Also, there should be only one
000-default
and not a000-default.save
.I would look in this file:
Does that look right? No, then look here:
Does that look right? Then replace the contents of
000-default
with000-default.save
?Once you have
sites-available
ironed out, go over to this directory:And clean it up. Remove any files named
000-default
or000-default.save
and create a proper symbolic link fromsites-available
tosites-enabled
like this:Note that when in
sites-available
the file is nameddefault
but when it is linked intosites-enabled
it gets named000-default
to set the load order.