Skip to content

Instantly share code, notes, and snippets.

@plaurent
Created October 7, 2012 14:54
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save plaurent/3848586 to your computer and use it in GitHub Desktop.
Save plaurent/3848586 to your computer and use it in GitHub Desktop.
============================================================
Pakl's guide to a complete tentd and tentd-admin
and Nginx proxy:80 installation.
============================================================
Oct 7, 2012 -- Version 1.2 (adds missing commands for installing nginx)
History
Oct 7, 2012 -- Version 1.1 (adds missing nodejs repository)
Oct 7, 2021 - 1.0 initial release
On a fresh install of Ubuntu 12.04 32-bit server.
sudo aptitude install postgresql
sudo aptitude install ruby1.9.1-full libxml2 libxml2-dev libxslt1-dev git
sudo vi /etc/postgresql/9.1/main/pg_hba.conf
--> the pg_hba should have these "trust" lines:
local all postgres trust
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
sudo /etc/init.d/postgresql restart
sudo -u postgres psql
psql# CREATE USER ubuntu WITH PASSWORD 'pickYourPostgresPassword' CREATEDB CREATEROLE;
createdb tent_server_test
sudo update-alternatives --config ruby
mkdir tent
cd tent
git clone https://github.com/tent/tentd.git
git clone https://github.com/tent/tentd-admin.git
cd tentd
sudo gem install bundler
sudo apt-get install make
sudo aptitude install postgresql-server-dev-9.1
sudo bundle install
cd ../tentd-admin/
bundle install
sudo gem install execjs
cd ..
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
createdb tent_server_account1
cd tentd-admin/
DATABASE_URL=postgres://localhost/tent_server_account1 ADMIN_USERNAME=admin ADMIN_PASSWORD=pickYourAdminPassword bundle exec puma -p 3000
# YOUR TENT SERVER IS RUNNING, YOU CAN SET UP ADMIN BY VISITING http://your_vps:3000/admin
# Go there, change the entity name to not have the :3000, and also
# add a second Server without the :3000 (then delete the :3000 one after
# you have added the without-:3000 one)
Nginx
=====
# Install Nginx using
sudo apt-get install nginx
# Add to the file /etc/nginx/defaults (or create another file in that directory)
server {
listen 80;
server_name coolname.yourserver.com; # <-- replace
location / {
proxy_pass http://0.0.0.0:3000;
include /etc/nginx/tentproxyconf.conf;
}
}
# Add more server lines as necessary for other tent entities/accounts
# Create a file /etc/nginx/tentproxyconf.conf:
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
# Then run
sudo invoke-rc.d nginx reload
# you can also use sudo invoke-rc.d nginx stop / start
@plaurent
Copy link
Author

plaurent commented Oct 7, 2012

Update notifications will be posted here as well as ^pakl.tent.is

@paparent
Copy link

Thanks! This helped. the ruby installation didn't really work, dunno why (I'm on Natty). So I installed it via rvm. And had to replate aptitude by apt-get because it'S not installed by default (anyway, on my VPS provider).

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment