Accessing files on new server.

Posted November 7, 2013 4k 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

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.

Submit an Answer
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.