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 second third fourth

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 (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 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.

Site Moderator
Site Moderator badge
October 8, 2019
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?

Site Moderator
Site Moderator badge
October 7, 2019

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.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel