Skip to content

Instantly share code, notes, and snippets.

@tehpeh
Created May 8, 2012 06:42
Show Gist options
  • Save tehpeh/2633080 to your computer and use it in GitHub Desktop.
Save tehpeh/2633080 to your computer and use it in GitHub Desktop.
Ubuntu Deploy
Setup:
------
See ror-deploy.txt for general instructions.
Packages:
---------
sudo aptitude update
sudo aptitude safe-upgrade
sudo aptitude install vim ssh openssh curl git
sudo aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev (Ruby dependencies)
sudo aptitude install libcurl4-openssl-dev (passenger-nginx dependencies)
sudo aptitude install avahi-daemon (for local VMs to use bonjour)
sudo aptitude install acpid (for ACPI shutdown support)
sudo aptitude install ntp (for ntp sync)
Enable firewall:
----------------
- edit: /etc/default/ufw
- and set: IPV6=yes (for avahi, but maybe useful in future)
sudo ufw allow ssh
sudo ufw limit ssh/tcp
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 5353/udp (for avahi, not required but stops ufw block messages in syslog)
sudo ufw enable
Set hostname (optional):
------------------------
- edit /etc/hostname:
newhostname
- add 127.0.1.1 newhostname in /etc/hosts:
127.0.0.1 localhost
127.0.1.1 newhostname
- (do not add .local, avahi handles that)
DynDNS:
-------
sudo aptitude install libio-socket-ssl-perl
wget http://cdn.dyndns.com/ddclient.tar.gz (or from sourceforge for latest)
tar -xzvf ddclient.tar.gz
cd ddclient-3.7.3/
sudo mkdir /etc/ddclient
sudo mkdir /var/cache/ddclient
sudo cp ddclient /usr/local/sbin
sudo cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
sudo cp sample-etc_rc.d_init.d_ddclient.ubuntu /etc/init.d/ddclient
- edit the /etc/init.d/ddclient file:
DDCLIENT=/usr/local/sbin/ddclient
- edit the /etc/ddclient/ddclient.conf file so that it contains something like:
use=web
login=yourdndnslogin
password=yourdyndnspassword
wildcard=yes
server=members.dyndns.org, \
protocol=dyndns2 \
yourhost.dyndns.domain
- change permissions:
sudo chmod 600 /etc/ddclient/ddclient.conf
- start the ddclient daemon:
sudo /etc/init.d/ddclient start
- launch at boot:
sudo update-rc.d ddclient defaults
- or
sudo aptitude install sysv-rc-conf
sudo sysv-rc-conf
- you can check status and troubleshoot using:
sudo /etc/init.d/ddclient status
sudo /etc/init.d/ddclient stop
sudo tail /var/log/syslog
Static IP (if required):
------------------------
- edit /etc/network/interfaces:
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.21
netmask 255.255.255.0
gateway 192.168.0.1
nginx startup:
----------------------------
- Copy nginx-initd-ubuntu to /etc/init.d/nginx
sudo chmod 755 /etc/init.d/nginx
sudo update-rc.d nginx defaults
- or
sudo aptitude install sysv-rc-conf
sudo sysv-rc-conf
- add levels 2,3,4,5
ntp sync (if required):
-----------------------
- edit /etc/ntp.conf
- add an Australian server (above/under server ntp.ubuntu.com)
server au.pool.ntp.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment