Thursday, May 8, 2014

Error in LAMP when restarting Apache2

when installing LAMP per the instructions here:
https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu

which was essentially:
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
sudo nano /etc/apache2/mods-enabled/dir.conf
adding index.php to the beginning of this config file
<IfModule mod_dir.c>

          DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm

</IfModule>

sudo apt-get install php5-common
sudo nano /var/www/info.php
configure file with:
<?php
phpinfo();
?>
sudo service apache2 restart

It was at that moment that I got the following error:

apache2: Syntax error on line 211 of /etc/apache2/apache2.conf: Syntax error on line 5 of /etc/apache2/mods-enabled/dir.conf: </IfModule> without matchin <IfModule> section
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

Now, typing it all out I can clearly see what was wrong.  Inadvertently I deleted the first < while editing the dir.conf file in the red highlighted step.

So if you're bad at keyboarding like I am, and screw up the same way, this might help you.

No comments:

Post a Comment

Samsung refrigerator not making ice

How I got my stupid fridge to work again. Normally, I press/hold the blue button till it chimes. Well that didn’t work this time. Darn. I re...