Accessing files on new server.

November 7, 2013 2k views
I created a new LAMP stack using the Applications tab. Then, using the terminal, I added PHPmyAdmin. I now want to up load files via SFTP so that I can access them. I successfully logged into SFTP using Transmit and created a new folder /test and put a file in it /test/test.html Then I went to my IP: and I also tried but both times received a 404 page. What am I doing wrong? Thanks! Steve
3 Answers

Create your folder in /var/www/html which is the default Apache path and put your test.html file in there . then you should be able to access it through the browser.

On the web, when you navigate to your site, the web server will read (i.e. look for files in) the web server's root directory as defined in the Apache configuration file. As noted by @calidays81, Apache's default (web) root directory is /var/www.

You're more than welcome to have your web server serve files from /test; but that'll require that you modify Apache's configuration file so that it knows to look for files in /test, as opposed to /var/www.

You didn't specify the OS you're running. Assuming it's Ubuntu, check out How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS for an illustration on configuring Apache.
by Etel Sverdlov
This tutorial shows you how to set up a new directory, how to grant the correct permissions, how to add content to a new page, how to turn on virtual hosting, and how to, if needed, set up local hosts. Virtual Hosts are used to run more than one domain off of a single IP address and allows you to run multiple sites off of a single DigitalOcean droplet. This tutorial describes how to set up virtual hosts with Apache.
Have another answer? Share your knowledge.