Best directory structure for multiple sites?

Hi. I'm new to Linode and a bit of a n00b with server administrating but am learning lots. I've recently gotten virtual hosting working through Apache.

I'm just wondering if there is a 'standard' place to store each site's directory? If not what pathing structure do you recommend?

I have the following structue but am not sure if it's a 'best practice':

_/home//publichtml/site1.com/index.html

/home//public_html/site2.com/index.html

/home//publichtml/site3.com/index.html_

3 Replies

In most cases, website files are placed under either /var/www or /home. In the end, it doesn't really matter. Do what seems natural for you.

If different users need to manage their own sites, you might want to consider creating some additional usernames and making each user own his/her site. But if you're managing all those sites, don't make it unnecessarily complicated.

Personally I use a similar structure to you, except under /srv/http/ instead of /home/username/

Ill second fukawi2,

/srv/http/domain1.tld

/srv/http/domain2.tld

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct