Question

After LAMP stack tutorials, I can't find my site on localhost

I’m a student trying to figure out how to get LAMP stack working on my laptop for Ubuntu 18.04. I need it for a project I’m working on at school and out of school.

I followed a few tutorials,

first https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04 second https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04 third https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04 fourth https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-18-04

to make a long story short, I set my domain as abc and this is me looking at it in terminal

Skynet:/var/www/abc$ ls index.html websitedirectory

index.html is from the second tutorial and displays: “Success! The your_domain virtual host is working!” The index.html works fine and displays when I go to url localhost in firefox. If I try to do localhost/websitedirectory I get a blank page and if I try to do www.abc/websitedirectory/login.php (I added login.php into /etc/apache2/mods-enabled/dir.conf to prioritize it) I also get a blank page. I’m not really sure what I’m doing wrong and how I can get my actual site to display using the LAMP stack. I was using the lampp package from apachefriends.org and I had my site working with that, but I’m trying to figure out how to use it with LAMP stack instead and to apply it to real world situations.

Would anyone be able to clarify this for me and explain what I’m doing wrong. Thank you in advance.

Big thank you to the tutorial authors: Justin Ellingwood, Kathleen Juell, and Mark Drake


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

What happens if you enter the full path in your browser - localhost/abc/subdirectory/index.php

Also are you using an .htaccess file and if so can you place the content of it here?

Hello, @Pachuca

Can you please check if mod_rewrite is enabled? You can check it via this command:

httpd -M | grep rewrite

Also, please make sure that the site files are located in the same directory where your apache virtual hosts - document root is pointing to.

Let me know how it goes.