I have been working on setting up a website and I am using Apache on a Ubuntu 20.04 LS VM. I have the domain configured to point to the server and https is set up and working but whenever I go to the domain I get this view.
I have tried to get the domain to bind with the virtual host by using the server name tag but that is not working. This is my config file:
I am new to the world of running servers so sorry if this question is stupid:).
Let me know if I can add anything that would be helpful in this situation. This is the only website I am trying to host on this VM. Also, apache does not think that the folder shown in the image exists in the filesystem. I do not know if this would affect anything but to get my website files on the server I downloaded all the files into backpacking-project. Thanks.
2
Answers
I figured out the reason why it was not working. It was because I uploaded a folder of my files to the server and apache did not recognize it in the filesystem. I uploaded the files separately that that worked.
To correct the site issue, change DocumentRoot to
Next, you should not allow Apache to display directory contents. Add these lines:
Apache Directory Listings
Next you should define the default page. Assuming the default page is index.html, add this line to the previous Directory section:
Change index.html to whatever you are using, e.g. for PHP use index.php or home.php, etc.