Apache2 webserver wont start

Have upgraded apache via virtualmin package updates as it was displaying updates available.

Since doing so I am unable to get apache to start, with the following error:

Failed to start apache :

  • Starting web server apache2
    Syntax error on line 87 of /etc/apache2/sites-enabled/postrangersgolfsociety.org.uk.conf:
    Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
    …fail!

This is the what is in the the .conf at line 87, which I have not altered since update and which was working:

php_value register_globals Off

Any ideas chaps?

Hey!

If Apache doesn’t know that directive anymore, it usually means that mod_php (which provides the directive) is not loaded. In Server Configuration -> Website Options you can check if Apache is (or should be) configured to use mod_php or one of the CGI variants.

Thanks Locutus
I have looked in Server Configuration -> Website Options and all seems to be as it was before the upgrade.

I am now getting the following error message:

Failed to start apache :

  • Starting web server apache2
    apache2: Syntax error on line 236 of /etc/apache2/apache2.conf: Syntax error on line 89 of /etc/apache2/sites-enabled/postrangersgolfsociety.org.uk.conf: without matching section
    …fail!

I dont want to alter too much and completely mess things up and have to do a re-install. And its been a long week and I need some sleep, will have another look tomorrow.

Have even disabled the postrangers site and still get the error regarding it, so apache wont start even with that web site disabled?

What’s the error message when the site in question is disabled?

Failed to start apache :

  • Starting web server apache2
    apache2: Syntax error on line 236 of /etc/apache2/apache2.conf: Syntax error on line 85 of /etc/apache2/sites-enabled/postrangersgolfsociety.org.uk.conf: Expected but saw
    …fail!

Uuhm… I don’t think the error message came through correctly. There seem to be parts missing. Here’s what it reads like for me:

“Starting web server apache2 apache2: Syntax error on line 236 of /etc/apache2/apache2.conf: Syntax error on line 85 of /etc/apache2/sites-enabled/postrangersgolfsociety.org.uk.conf: Expected but saw …fail!”

Incomplete sentences in the end there. Make sure to circumscribe any HTML-like characters in the message, and put it in tags.

Anyway, line 85 of your config file contains </VirtualHost>, just like line 84. Conversely, the /VirtualHost line is missing after the actual virtual host declaration. Seems something got messed up pretty good there.

You can try manually fixing the config file for that vhost, e.g. by removing line 84 and 85 and putting </VirtualHost> at the bottom of the file (though I’m not sure if it needs to be there, or if some directives need to go outside the vhost), or you can recreate the Apache config for that domain by turning the Apache Website feature off and on again. Be aware that the config will be reset when doing that, though website directory contents should not be affected. Better make a copy of it first though, better safe than sorry.

Thanks Locutus, your comment pointed me in the right direction.

Went into Edit Virtual Server, disabled all options under Enabled Features, saved and then re-enabled them. Websites and apache now working.

All thats left is to change some directory permissions to get some modules back up and running.

I am thinking there was a conflict with how Joomla was configured, which is why when apache was updated it was misconfigured. It didnt have permissions to re-write to certain directories.

Thanks again Locutus

Good that it works now. :slight_smile: You’re welcome.