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?
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
?
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/socket.io/lib/index.j 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 :/
@k0ala Okay, then you’ve just renamed or removed the file. Try running the following:
service apache2 start
service apache2 status
#press Q to exit the status dialog
@k0ala What are you confused by? The file? Do you have a backup of the file, then remove it. If not, then simply rename it. The server? Hire a system administrator to help you with the server.
@k0ala Getting a little narrow again, so starting a new thread
Can you remove or rename the file /var/www/.htaccess
, which might be the reason.
Rename command mv /var/www/.htaccess /var/www/.htaccess-OLD
@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
.
This comment has been deleted