How do you structure your web server?

web

MossyBlog is asking about how people setup their new web servers. I though I'd post my thoughts on directory structure here.

This is web server directory structure that I have used for long time (probably 6 or 7 years). A former co-worker Eric Griff helped me come up with it I believe.

We wanted a directory structure that would allow us to keep domains grouped together, so if you have domain.com, and blog.domain.com the will be located near each other. Also we wanted there to be room to put things related to the domain above the web root such as logs, documentation, and at the time we used access, so we also had a directory for the database files. I haven't used access in years so I leave that one out now.

So here's what it looks like:

/websites/domain.com/www/web/ (this is your web server root for www.domain.com)
/websites/domain.com/www/logs/ (logs go here)
/websites/domain.com/www/docs/ (docs)
/websites/domain.com/www/db/ (database files, optional)
/websites/domain.com/www/requirements.txt

The requirements.txt is a file where you can put any server requirements that the site has, I usually list what datasources, custom tags, or server components the site requires in this file. Then if I want to move it to another server you know what you need to install to get the site working.

Now when you setup another site under that domain, such as blog.domain.com, it would look like this:

/websites/domain.com/blog/web/ (web root for blog.domain.com)
/websites/domain.com/blog/logs/ (logs go here)
...

So that's how I setup my directories, how do you do it?



7 people found this page useful, what do you think?

Trackbacks

Trackback Address: 420/5C44F51DD3257F0E857580069D58E782

Comments

On 07/26/2005 at 2:15:36 PM UTC Brandon Harper wrote:
1
Looks fairly similar to what I use as well. I have a bad habit of putting it in the /home/ directory though which I should probably change.. ie:

/home/web/domain.com/www/public_html

All of the FreeBSD ports install things underneath /usr/local/www and I just create links to those directories if I'm using something from the ports system.

On 07/26/2005 at 4:45:09 PM UTC Neculai Macarie wrote:
2
I have the files in /var/www/domain/public_html, but all the logs go to /var/log/httpd for easy awstats processing, rotating and achiving.

On 07/26/2005 at 4:48:03 PM UTC Seth Voltz wrote:
3
We're an a shared host ATM but i like their structure:

/home/httpd/domain.com/httpdocs/ /home/httpd/domain.com/subdomains/blog/httpdocs/ /home/httpd/domain.com/statistics/ /home/httpd/domain.com/statistics/logs/ ...

The thing I don't like is they split httpdocs and httpsdocs in the primary (*.domain.com) area and combine them in subdomains (blog.domain.com) I'd like them combined all the time.

On 07/27/2005 at 10:56:51 PM UTC Abhijit wrote:
4
What about using the reverse of the web address as the directory name? Similar to Java package names.

i.e.

/websites/com.domain.www/ /websites/com.domain.blog/ ...

On 08/09/2005 at 10:27:54 PM UTC Anonymous wrote:
5
Help! Amatuer here : ) I have a website I created w/ FrontPage 2002. I need to remove images from google. I followed the protocol I found on the web. My question is> It says I have to create a robots.txt file in the "web server root". - I did create a 'new page' as a robots.txt file. - When they say "web server root" could some explain exactly what that means & how I get there? - I learned alot on my own - but don't know all the 'language' yet. Appreciate any help : ) Thank you! Rose narose_98@yahoo.com

On 01/15/2006 at 2:09:32 AM UTC Garret Hunter wrote:
6
I totally agree with what you're saying. I wish more people felt this way and took the time to express themselves. Keep up the great work. Garret Hunter http://www.webserverscenter4u.com

On 01/15/2006 at 2:11:27 AM UTC Garret Hunter wrote:
7
I totally agree with what you're saying. I wish more people felt this way and took the time to express themselves. Keep up the great work. Garret Hunter http://www.webserverscenter4u.com

On 07/12/2006 at 7:00:43 PM UTC Dot Bambach wrote:
8
What is rotating domains?

On 04/09/2007 at 6:14:32 AM UTC ABrar wrote:
9
WEB HOSTING USA |Cheap Hosting Plan, Cheap Hosting Package, Managed hosting services at hostinghelpline.com at http://redirect.alexa.com/redirect?www.hostinghelpline.com Choosing the right web hosting company is not an easy task but hostinghelpline.com has made this now so easy to choose the right cheap hosting package for your web solution. Hostinghelpline.com provides the consumer with an objective way to find the right hosting plan without any problem, and provides web hosting companies with a level playing field to differentiate themselves in a competitive market. Our directory provides user the best way to find cheap hosting plans with respect to all basic features including price, disk storage, mail accounts, data transfer and location. The directory offers a wide range of plans including latest technology such as Microsoft ASP.NET, PHP, Perl, Python, IIS6, SQL Server, Microsoft frontpage, and ODBC and control panel. Explore www.hostinghelpline.com provides you articles covering all aspects of web hosting alongside reviews with web hosting players, a section of the site covering detail of web hosting providers with ratings and about their hosting triumphs.

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?