Website not loading - Apache conf problems

March 11, 2016 869 views
DigitalOcean Apache WordPress Backups Ubuntu

My website was opening only using IP after i recreated a droplet using snapshot,
then i configured the sudo nano /etc/apache2/sites-available/000-default.conf
(created i new file) input the lines requested by this tutorial


where it says to input this:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName serverdomainnameorIP
<Directory /var/www/html/>
AllowOverride All
. . .
(i didnt input the "...")

meanwhile i remembed a friend told me to recreate the DNS records in digitalocean droplet to this way the new IP would propagate properly then i did.

then i did this in putty:
and used these commands afterwards:
sudo a2ensite newnewnew-default.conf
sudo a2dissite 000-default.conf

now my website have this error:

This webpage has a redirect loop


The webpage at http://mydomain.com/ has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

Also i have this error in putty:

service apache2 reload

  • Reloading web server apache2 *
  • The apache2 configtest failed. Not doing anything. Output of config test was: apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/ap ache2/sites-enabled/substituir-default.conf: /etc/apache2/sites-enabled/substituir-default.conf:1 : <VirtualHost> was not closed. Action 'configtest' failed. The Apache error log may have more information.

p.s(how i see the log)? Thanks.

1 Answer

Your configuration has an opening <VirtualHost *:80> tag so it must close that tag by ending with </VirtualHost>

Because of this your changes are not being picked up.

Have another answer? Share your knowledge.