2

I am trying to set up my first server and stack. I spent a week trying to do it on a virtual machine but could never get the ports to forward correctly so today I just dedicated the full machine.

I installed Ubuntu server and followed the directions to install the LAMP stack. Everything worked perfectly. I configured my router, got the Apache welcome page, installed an ssh server, connected from a remote terminal, then connected with sftp and updated the index.html file. It's progress but I still feel pretty lost.

My biggest frustration is that I don't see anything when I am logged directly into Ubuntu from the terminal. I run ls and expect to see directories for Apache and MySQL but I see nothing. It's like I am look at an empty drive. Maybe I am.

At first, I thought I could create a public_html directory and scp files into it, but that didn't work. (Well, it worked but they weren't visible at the IP.) Then I discovered that I should probably work with the default directory structure /var/www only I can't see it from terminal? I do see it when I log on with filezilla. I don't get why I see it via sftp but not via ssh or directly on the server. I read through all the official documentation but it seems to take these basic issues for granted. Maybe someone can point me to other resources. I've been googling all day but not finding what I need to understand this better.

4

The reason you don't see anything when you type ls is because you are in your user's home directory, and on a server install, your home directory is empty ;)

To get to the root directory you will need to run the command

cd / 

This will take you to / (the root directory). From there you can use ls to see everything on your hard drive, including /var. You can jump straight to /var/www with the command

cd /var/www

To edit anything outside of your user's home (e.g. /var/www) you need root privileges, which you get by appending all your commands with sudo.

  • Okay, that did it! Now I can get oriented. I have not used cd .. before just cd, which I thought took me back one directory but now it seems to put me in the user directory. I need to practice a little. Thanks! – Nathan Sep 7 '13 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.