I can't seem to view my index.html file.

February 21, 2016 3.4k views
Deployment PHP Ubuntu

HOLD ON. I just found my /var/ folder

Hey guys, I've recently uploaded the necessary files for my website in my Ubuntu14.04 server. I followed the initialization guide (minus the LAMP installation) so can log in to my FTP, phpMyAdmin, upload files, and make database tables. I also set up a user named angelo according to the guide (instead of demo).

Now, I uploaded the project folder of a sample ExtJS4 website to the following directory:

/root/home/angelo/samples/projectname/

and all the files are inside the projectname folder.

However, when I go to:
myWebsite.com/home/angelo/samples/projectname/index.html

I get a 404 telling me that the requested URL was not found in this server.
Now, I tried removing the /home then /angelo but to no avail as well.

Can anyone help me with my issue? It seems that I'm overlooking something rather simple/easy but I can't seem to figure out what it is. Any help is very much appreciated, thank you.

1 comment
  • Hey Angelo,

    Have you installed Apache or NGINX on your server?

    You first need to have an file server set-up to serve your HTML files and resources from your server, then you can access these files by dropping them on your program's www or html folder, so they become available.

    Hope this helps you :)

1 Answer

Hi there!

What you are needing is called a virtual host (or server block, for Nginx). This is what tells the web server to load files from a certain location if called by a certain domain. You can find virtual host guides for Nginx and Apache at these links:

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-14-04-lts
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

Kind Regards,
Jarland
Platform Support Specialist

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
Have another answer? Share your knowledge.