Apache2 Restart Problem

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?

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Accepted Answer

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

I looked up some issues online and reinstalled things and it worked, my website was working. But now comes another issue which I don’t think is a droplet issue but everytime I type “node site.js” I get this long error

[2017-06-26 15:54:00.991] [INFO] [default] - DB Connection ID: 399
[2017-06-26 15:54:00.994] [INFO] [default] - DB Connection ID: 400
[2017-06-26 15:54:00.995] [INFO] [default] - DB Connection ID: 401
[2017-06-26 15:54:00.997] [INFO] [default] - DB Connection ID: 402
[2017-06-26 15:54:01.002] [TRACE] [default] - Roll 4263
[2017-06-26 15:54:01.003] [TRACE] [default] - Sucesfully updated history
[2017-06-26 15:54:01.004] [WARN] [default] - Loaded hashd8b710dfa2c8a3d990ca1dc7                                                                                           cc0a91754ac20aa6139fb7f6d44b58ee31ece8dc
[2017-06-26 15:54:01.134] [WARN] [default] - Loaded fresh prices
[2017-06-26 15:54:01.190] [WARN] [default] - Prices loaded from cache
[2017-06-26 15:54:03.934] [TRACE] [default] - Strange error
[2017-06-26 15:54:03.935] [DEBUG] [default] - { Error: listen EADDRINUSE :::8080
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at Server.setupListenHandle [as _listen2] (net.js:1305:14)
    at listenInCluster (net.js:1353:12)
    at Server.listen (net.js:1453:7)
    at Server.listen.Server.attach (/home/bot/node_modules/                                                                                           s:237:9)
    at Timeout._onTimeout (/home/bot/site.js:618:29)
    at ontimeout (timers.js:488:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:283:5)
  code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 8080 }

It was working literally 10 minutes ago and now it doesn’t work

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 :/

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel