From d1b51dc84b63db37598a4c392e2bc5512735a6c4 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 7 Jun 2010 01:15:41 -0400 Subject: more servery goodness --- software/server-setup.page | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'software') diff --git a/software/server-setup.page b/software/server-setup.page index 0eb03eb..a436e10 100644 --- a/software/server-setup.page +++ b/software/server-setup.page @@ -7,6 +7,19 @@ toc: no Generic Server Setup Tricks ========================================= +hostname +------------- +On Linux (at least ubuntu), the correct way to set a FQDN (fully qualified +domain name, eg killer.mail.webtwo.com; the hostname in this case would be +killer) is to edit both ``/etc/hosts``:: + + + 127.0.0.1 localhost + +and ``/etc/hostname``:: + + + See also `debian `_ and `freebsd tricks `_. @@ -37,27 +50,29 @@ File Hierarchy Root for server files, scripts, and databases /srv/http/ - Subdirectories for each virtual host live in this folder, out of which - static `HTTP `__ content is served. + Subdirectories for each virtual host live in this folder, with further + subdirectories for different dynamic services or static serving. /www/ + is for static html content. -/srv/django/ - Django applications and their databases live in here. +/srv/http/default/www/ + Default pages like 404.html or 50x.html live here. /srv/git/ Bare git repositories are stored here; those with a file ``git-daemon-export-ok`` get served up through a web interface and can be publically cloned. -/srv/ - SVN repository roots are stored in sub folder in here. +/srv/backup/ + Database dumps and backups get put in subdirectories here; this whole + directory can be rsynced to a remote location. -/srv/python/ - Standalone python scripts and applications are stored in here (not Django - apps). +/srv/db/ + Database files (sqlite, passwds, etc) go in subdirectories here. Usually + has crazy r/w permissions! -Ruby on Rails Deployment ------------------------------- -This method will mess around with nginx. It uses ` +Ruby on Rails Deployment: Phusion Passenger +----------------------------------------------- +This method replaces the nginx binary. It uses ` Phusion Passenger`_ on Ubuntu Server:: nano /etc/apt/sources.list # uncomment the 'universes' lines @@ -66,3 +81,4 @@ Phusion Passenger`_ on Ubuntu Server:: sudo aptitude install irb1.8 bzip2 unzip less screen wget curl sysinfo # Optional sudo gem install passenger sudo /var/lib/gems/1.8/bin/passenger-install-nginx-module + -- cgit v1.2.3