I'm having a hell of a time setting up a dev environment for Wordpress.

I messed everything up a couple weeks ago and this afternoon wanted to start over.

I tried to reset Apache by uninstalling the package and deleting the /etc/apache2 directory.

Then I reinstalled Apache2 and restored the directory with the command:

sudo apt-get install --reinstall apache2.2-common

Localhost navigates to the "It Works!" page, but Apache won't restart, which make me nervous.

I keep getting this error:

Syntax error on line 160 of /etc/apache2/apache2.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.


Any ideas? I'm just trying to get up a working LAMP set up.

  • Did you look at the log or config file? Please post an excert of the config file at around line 160 and may be the log file at tht time if you still can't find the issue. – LiveWireBT Oct 24 '13 at 8:14

Apache is unable to restart due to the error in your configuration file. Did you edit apache2.conf by hand? Debug your syntax error in /etc/apache2/apache2.conf and sudo service apache restart should start working correctly.


The Order directive is provided by the mod_authz_host module, and by deleting the /etc/apache2 directory you've caused it to become inactive. You need to reenable that module.

Deleting the whole directory is not a good way to start over, for two reasons: there are files in there owned by other packages, and because Ubuntu's package manager thinks your changes are intentional. apt-get install --reinstall will not clobber your config changes.

If you want to remove a package and all its configuration, the right way to do that is with dpkg --purge. Then, when you reinstall the package, you will get back to the default configuration.

Probably the easiest way to recover from here is to purge all the apache2.2 packages. Then, reinstall apache2.2.

(Another course is to use dpkg -i --force-confmiss /var/cache/apt/archives/apache2.2-common-*.deb to just restore missing configuration files, but that may not be enough if deleting the directory also broke some install-time configuration.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.