A website/api/media-server.
This codebase currently runs the websites:
http://brighton-wok.com
http://convictfilms.com
A server, written in Go, which can be run as a standalone or behind nginx or Apache. The server requires MongoDB, MySQL and Redis.
A set of templates, css, images and Javascript libraries.
To install Vafan on a new machine. Instructions are for Oneric (11.10).
-
Install Ubuntu.
-
Install git:
sudo apt-get install git-core
-
Clone vafan:
cd /srv/ git clone git://github.com/saulhoward/vafan.git
-
As root, run the setup script to install apt packages:
cd /srv/vafan sudo scripts/ubuntu-setup.sh
-
Optionally, set up your Go environment. Eg.:
echo "export GOPATH=/usr/lib/go" >> ~/.bashrc echo "export GOPATH=$GOPATH:/srv/vafan" >> ~/.bashrc source ~/.bashrc
-
Build the vafan-server command:
cd /srv/vafan/cmd/vafan-server go build vafan-server.go
This will complain about missing third-party libraries. You must install them, eg,
go get code.google.com/p/gorilla/mux
Some of the packages may depend on other Ubuntu packages. For example, googlecode packages use mercurial (hg), so:
apt-get install mercurial
Once they are installed, you should be able to build vafan-server.go.
-
Setup MySQL:
mysql -u root -ppassword create database vafan; quit cd /srv/vafan/data/sql mysql -u root -ppassword vafan < users.sql
-
Create the config file.
mkdir /etc/vafan cp /srv/vafan/config/config.ini /etc/vafan/vafan.ini vim /etc/vafan/vafan.ini
-
Daemonize, a la AG's ace blog:
http://nf.id.au/deploying-go-web-services-behind-nginx-under
Using the init.d script in the repo:
cp /srv/vafan/scripts/vafan-init.sh /etc/init.d/vafan chmod +x /etc/init.d/vafan ln -s /srv/vafan/cmd/src/vafan-server/vafan-server /usr/sbin/vafan-server /etc/init.d/vafan start update-rc.d vafan defaults