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:
Which should look like this:
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:
When you are done editing, hold
CTRL
key and pressX
key, release keys, pressY
key and pressEnter
key.Now restart Apache
service apache2 restart
.