Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So I'm working on getting my first webserver setup. Are there standard folder locations that my webserver should serve from? In the past, I've use var/www/vhosts/example.com. Since it's just for me, should I just use /var/www/example.com/? Also, how do I get ftp working to access that directory so I can upload my php application?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Under Ubuntu (and most other Debian based distros) the default site is located at /var/www/. I personally use folders under /var/www/ for the individual virtual hosts, generally named after the primary domain (i.e. the one used as ServerName in the apache config).

However, you can use just about any location you need/want. I have administered servers where sites were located under /opt/ or under /usr/local.

The easiest way to get ftp working is by setting up ftp accounts that have their home folders in the root folders of the related websites and making sure that these accounts are members of the apache group.

share|improve this answer
add comment

Honestly, it really doesn't matter where the files reside. Do whatever you're most comfortable with, keeping in mind that it's a good idea to maintain a somewhat organized folder hierarchy. I usually do something like:

/var/www/example.com/www
/var/www/example.com/dev
/var/www/example2.com/www
etc., etc., etc.

FTP server setup instructions really depend on which FTP server you're hoping to use. If you're open to it, though, I'd highly recommend using SCP instead of FTP. SCP works using the ssh daemon that you already likely have running on that server. It's much more secure, and one less service you'll need to manage/patch/etc. going forward.

share|improve this answer
add comment

As the others have said, it doesn't matter as long as the web server knows where you've put them! So if you're using Apache for the web server, and you've decided to put your files in a directory located at /free/beer, you'll have to tell Apache that it needs to look in /free/beer for the files (i.e. DocumentRoot)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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