1

I had the LAMP stack installed on my Ubuntu machine. Everything was working fine. I had Apache, mySql, phpmyadmin, etc. I'm learning web development, and a friend suggested I try out Drupal. So, I downloaded the tar package, extracted it, began the setup process via an online tutorial, and I kept getting the error "the Settings file is not writable". I went through everything I could think of to change the permissions to no avail. I also downloaded openssh, but had trouble logging in. That was next on the list to uninstall.

I became frustrated thinking I had done something wrong during installation, so I deleted everything I had installed: Apache, php, mysql, and drupal. I believe I got any leftovers taken care of.

Well, I restarted the process and got Apache downloaded, but when I try my I.P. or "localhost," I get the error "this site can't be reached." HOWEVER, if I navigate to the physical folder /var/www/html/index.html, and double click, the Apache "it works!" page comes up.

I wish I could take the snapshot of my computer two days ago and forget this ever happened because one seemingly simple download has caused me nothing but headache.

Any ideas on where I can start to fix my broken machine?

DevOpsSauce
  • 203
  • 1
  • 3
  • 18

4 Answers4

4

I've added the url to /etc/hosts the issue is resolved. such as (wpfa.dev):

127.0.0.1       localhost
127.0.3.1       wpfa.dev
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Ali Hesari
  • 1,042
  • 3
  • 10
  • 16
3

OK, there are ways to do that, the first you have to do is to reload configuration:

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/*.conf

After that use next commands:

sudo service apache2 reload
sudo service apache2 restart

Make sure default folder is owned by web server, to change permissions use next commands:

sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
sudo service apache2 restart

Also if you had enabled ufw, that use command next command to allow HTTP(HTTPS):

sudo ufw allow 80
#for HTTPS use 443 instead of 80

But if this don't work, then you must reinstall completely apache2 using command:

sudo apt-get remove --purge apache2
sudo apt-get install apache2
Gallaoui
  • 103
  • 2
  • That didn't work. Going with last step. Also, I don't know what "ufw" means. – DevOpsSauce Apr 02 '16 at 18:20
  • Ok. Tried the reinstall. Still didn't work. – DevOpsSauce Apr 02 '16 at 18:23
  • @IRGeekSauce ufw is firewall, uncomplicated firewall, installed on ubuntu. –  Apr 02 '16 at 18:23
  • Have you tried to access your server using internal IP? –  Apr 02 '16 at 18:25
  • Please, give me the link of tutorial. –  Apr 02 '16 at 18:28
  • [LAMP Setup from DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04) – DevOpsSauce Apr 02 '16 at 18:30
  • I did a complete removal (sudo apt-get remove --purge apache2*), then reinstalled it. The "it works" page comes up like it previously did, however, my phpmyadmin page is now not found. – DevOpsSauce Apr 02 '16 at 19:40
  • You should completely remove phpmyadmin, and install it, while installing you should select apache2, then click space on keyboard, after that click enter, thats all. –  Apr 03 '16 at 15:49
  • I will try that out when I'm at my machine again. Thanks. – DevOpsSauce Apr 03 '16 at 18:21
  • Note: if you changed apache to listen to any port other than the default `80`, then this command would help with the firewall: `sudo ufw allow proto tcp from any to any port 80,443,8080` – Imtiaz Apr 10 '20 at 20:16
1

It worked for me after uninstalling and re-installing apache2.

I tried a bunch of other things first:

sudo apt-get remove --purge apache2
sudo apt-get install apache2
Martin Thornton
  • 5,151
  • 11
  • 30
  • 39
0

Try to start apache2 by this command:

sudo service apache2 start
K4y31
  • 1