Report this

What is the reason for this report?

Apache2 Restart Problem

Posted on June 26, 2017

So everytime i type “service apache2 restart” into putty, i get an error

apache2: Syntax error on line 268 of /etc/apache2/apache2.conf: Syntax error on line 30 of /etc/apache2/sites-enabled/000-default: Expected </Directory> but saw </VirtualHost> Action ‘configtest’ failed. The Apache error log may have more information. can anyone help me?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @k0ala Can you post the file here /etc/apache2/sites-enabled/000-default ?

sorry for leaving @hansen, I was really tired and i went to bed… anyway

the site isn’t working and even after doing everything you said and then typing “service apache2 restart” it still said waiting, and I’m following a tutorial that requires you to type that command in order for the website to work… or else you get a 404 error and that’s exactly what’s happenening so no the site doesn’t work :/

@k0ala Just starting a new thread, since it was getting a little narrow.

My guess would be that this is your problem:

        <Directory />
                Options FollowSymLinks
                AllowOverride None      </Directory>

Which should look like this:

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

But I don’t understand why it says line 30 in the error, when this is clearly not line 30. Anyways, let’s edit the file with this command to make it look like the above:

nano /etc/apache2/sites-enabled/000-default

When you are done editing, hold CTRL key and press X key, release keys, press Y key and press Enter key.

Now restart Apache service apache2 restart.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.