Trac & Nginx on Ubuntu Feisty
Install trac
apt-get install trac python-mysqldb
Update ClearSilver
https://bugs.launchpad.net/ubuntu/+source/clearsilver/+bug/114930
apt-get install python-dev
wget http://www.clearsilver.net/downloads/clearsilver-0.10.5.tar.gz
tar xvzf clearsilver-0.10.5.tar.gz
cd clearsilver-0.10.5/
./configure –disable-wdb –disable-compression –disable-perl –with-python=$(which python)
make
cd python
cp -i neo_cgi.so /usr/lib/python2.5/site-packages/neo_cgi.so
Trac Environments Directory
You’ll need a directory for Trac’s environments to live that should be writable by the default tracd user:
sudo mkdir /var/lib/trac
sudo chgrp users /var/lib/trac
Create a MySQL DB
Create a new database (trac) and user with full rights to that DB (trac). Make sure the database character set is latin1_bin (UTF8 will cause key length problems; throwing “Specified key was too long; max key length is 1000 bytes” errors during trac setup)
Your connection string will be:
mysql://trac:trac@hostname:port/databasename
Configure Trac
trac-admin /var/lib/trac initenv
Follow the instructions.
Correct locale errors
If you get locale errors:
apt-get install localeconf
localedef -i en_US -c -f UTF-8 en_US.UTF-8
Themes
http://trac-hacks.org/wiki/TracMentalaxisTheme
Plugins
http://trac-hacks.org
Easy Rails app backup to S3 via Rake - code, SVN + DB
Adam Green has written a brilliant Rake task to backup your Rails App code, SVN + DB
Here is the original announcement: http://www.rubyinside.com/advent2006/15-s3rake.html
There is an updated version at: http://www.slingshothosting.com/support/backups
Watch out for the upcoming rubyforge.org project.
Thanks Adam!
HOWTO: Ruby, Rails, Postfix, Mongrel clusters & Nginx
Slicehost has a great HOWTO on installing MySQL, Ruby, Rails & Postfix (email) on a low memory VPS.
http://articles.slicehost.com/2007/9/11/ubuntu-feisty-mysql-and-ror
Also do an apt-get install libmysql-ruby to get around the require ‘mysql’ error
HOWTO: Nginx + Mongrel to server multiple Rails apps
http://blog.jordanisip.com/2007/6/27/rimuhosting-vps-nginx-mongrel-clust…
S3 Backup options: s3sync & duplicity
s3sync
http://s3sync.net/wiki
a ruby rsync command line tool, that mirrors folders on S3.
* S3 directories readable by any S3 browser (including standard HTTP calls)
* Bandwidth heavy; non encrypted
HOWTO; http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-…
Duplicity
http://duplicity.nongnu.org/index.html
GNU tar style backup tool, with many backing stores (SCP, FTP, S3).
* Fast, bandwidth efficient deltas
* Encrypted
HOWTO: Subversion + SSH/SVN, TortoiseSVN
Here is a great HOWTO on connecting to Subversion via ssh+svn:// using TortoiseSVN.
http://tortoisesvn.net/ssh_howto
Some additional tips:
- Make sure you change file permissions of the svn respository folder so that the SSH user you are using has full RW access
HOWTO: Symfony 1.0.8 with Nginx on Ubunty Feisty VPS
Get Symfony
# pear channel-discover pear.symfony-project.com
# pear install symfony/symfony
Using the command:
# pear config-show
we find the symfony libraries have been installed in:
$php_dir/symfony/ /usr/share/php/symfony/ main libraries
$data_dir/symfony/ /usr/share/php/data/symfony/ skeleton of symfony applications, default modules and configuration
doc_dir/symfony/ /usr/share/php/docs/symfony/ documentationCreate / configure a new symfony application
# mkdir /var/www/myproject
# cd /var/www/myproject
# symfony init-project myproject
# symfony init-app myapp
# ln -s /etc/nginx/sites-available/wattprint.org /etc/nginx/sites-enabled/wattprint.org
# /etc/init.d/nginx restart
Optimized Nginx config file
A useful Gzip + other optimized /etc/nginx/nginx.conf file
Thanks to http://brainspl.at/articles/2007/01/03/new-nginx-conf-with-optimizations
# user and group to run as
user www-data www-data;
# number of nginx workers
worker_processes 3;
# pid of nginx master process
pid /var/run/nginx.pid;
# Number of worker connections. 1024 is a good default
events {
worker_connections 1024;
}
# start the http module where we config http access.
http {
# pull in mime-types. You can break out your config
# into as many include’s as you want to make it cleaner
include /etc/nginx/mime.types;
# set a default type for the rare situation that
# nothing matches from the mimie-type include
default_type application/octet-stream;
# configure log format
log_format main ‘$remote_addr - $remote_user [$time_local] ‘
‘”$request” $status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;
# main access log
access_log /var/log/nginx/access.log main;
# main error log
error_log /var/log/nginx/error.log debug;
# no sendfile on OSX
sendfile on;
# These are good default values.
tcp_nopush on;
tcp_nodelay off;
# output compression saves bandwidth
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
#keepalive_timeout 0;
keepalive_timeout 65;
#vhost includes
include /etc/nginx/sites-enabled/*;
}





