Download - Deploying to Ubuntu on Linode
![Page 1: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/1.jpg)
MONTREAL 1/3 JULY 2011
Deploying to Ubuntu on LinodeDavid LeBerAlign Software Inc.
![Page 2: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/2.jpg)
Overview
• What
• Why
• How
• Q&A
![Page 3: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/3.jpg)
![Page 4: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/4.jpg)
Linode Overview
• VPS Supplier
• Xen Virtualized Servers
• Multiple available Linux Distros
• Distributed data centers (1 x UK, 4 x USA)
• Multiple Linode sizes
• Pro-rated billing
![Page 5: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/5.jpg)
Linode Sizes
![Page 6: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/6.jpg)
Why Linode
• Familiar distros (Ubuntu 10.04 LTS)
• Pricing
• Pooled bandwidth
• Awesome performance (IO and network)
• Private network access
• Free DNS
• Virtual console (Lish)
![Page 7: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/7.jpg)
Linode Creation
![Page 8: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/8.jpg)
Creating a Linode - 1
![Page 9: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/9.jpg)
Creating a Linode - 2
![Page 10: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/10.jpg)
Creating a Linode - 3
![Page 11: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/11.jpg)
Creating a Linode - 4
![Page 12: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/12.jpg)
Creating a Linode - 5
![Page 13: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/13.jpg)
Creating a Linode - 6
![Page 14: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/14.jpg)
Creating a Linode - 7
![Page 15: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/15.jpg)
Creating a Linode - 8
![Page 16: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/16.jpg)
KEEP NOTES!
![Page 17: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/17.jpg)
Preliminary Setup
• Apply Updates:
• sudo apt-get update
• sudo apt-get upgrade --show-upgradegraded
• Set hostname
• echo "demo" > /etc/hostname
• hostname -F /etc/hostname
![Page 18: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/18.jpg)
Preliminary Setup
• Configure Network:
• Add private IP
• sudo nano /etc/network/interfaces
• Edit hosts file
• nano /etc/hosts
• Configure DNS
![Page 19: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/19.jpg)
Preliminary Setup
• Set Timezone
• dpkg-reconfigure tzdata
• Create admin user
• adduser admin
![Page 20: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/20.jpg)
Preliminary Setup
• Add admin user to /etc/sudoers
• visudo
• add “admin ALL=(ALL) ALL” to User priveleges
• Test ssh login with admin
• Test sudo with admin
![Page 21: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/21.jpg)
Secure SSH
• On Linode (as admin)
• cd ~
• mkdir .ssh
• On local machine
• ssh-keygen -t dsa
• ssh [email protected] "echo `cat ~/.ssh/id_dsa.pub` >> ~/.ssh/authorized_keys"
![Page 22: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/22.jpg)
Secure SSH
• Test login
• sudo nano /etc/ssh/sshd_config
• Change port: Port 22022
• Disable root login: PermitRootLogin no
• Allow only admin user: AllowUsers admin
• Disable password auth: PasswordAuthentication no
![Page 23: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/23.jpg)
Secure SSH
• Restart: sudo /etc/init.d/ssh restart
• Do not close terminal!
• Test login
![Page 24: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/24.jpg)
Firewall
• sudo apt-get install ufw
• sudo ufw allow 22022
• sudo ufw allow 80
• sudo ufw allow ...
• sudo ufw enable
![Page 25: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/25.jpg)
Oh Crap!
![Page 26: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/26.jpg)
Linode Typical Types
512Apache
PHP
1024Apachewotaskd
apps
2048 MySQL
512Monitor
512JenkinsSVN
![Page 27: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/27.jpg)
Install Java
• sudo echo "deb http://archive.canonical.com/ lucid partner\n deb-src http://archive.canonical.com/ lucid partner " >> /etc/apt/sources.list
• apt-get update
• apt-get install sun-java6-jdk
![Page 28: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/28.jpg)
Installing Software
• Ubuntu - apt-get
• Linode Library
![Page 29: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/29.jpg)
Linode StackScripts
• Scripts to automate Linode setup
• Hooks for user input
• Extensive library
• Create your own
• API for external control
![Page 30: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/30.jpg)
Install WO Frameworks
• Wait... Actually don’t.
![Page 31: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/31.jpg)
Prepare for WO Apps
• Apache 2.2?
• Apache Adapter?
![Page 32: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/32.jpg)
Build Apache Adaptor
• Curl Wonder source from webobjects.mdimension.com
• cd Wonder/Utilities/Adaptors/
• nano make.config and change ADAPTOR_OS
• remove srandomdev() call as per wiki
• make and install as per wiki
![Page 33: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/33.jpg)
Prepare WO Directories
• mkdir -p /opt/Library/WebObjects/JavaApplications/
• mkdir -p /opt/Local/Library/WebObjects/Applications/
• mkdir -p /opt/Local/Library/Logs/
![Page 34: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/34.jpg)
Generate WO Users
• sudo groupadd appserveradm
• sudo useradd -g appserveradm appserver
![Page 35: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/35.jpg)
Install wotaskd
• Curl wotaskd.woa.tar.gz from webobjects.mdiminsion.com
• untar and mv into /opt/Library/WebObjects/JavaApplications/
• Fix permissions
![Page 36: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/36.jpg)
Install JavaMonitor
• Curl JavaMonitor.woa.tar.gz from webobjects.mdiminsion.com
• untar and mv into /opt/Library/WebObjects/JavaApplications/
• Fix permissions
![Page 37: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/37.jpg)
Ubuntu Upstart
• Replacement for rc.d scripts
• Similar in concept to launchd
• Can perform auto relaunch
![Page 38: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/38.jpg)
Upstart Example
![Page 39: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/39.jpg)
Upstart
• File /etc/init/webobjects.conf
• Started with:
• services webobjects start
![Page 40: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/40.jpg)
WO App Installation
• Curl the app.woa from the build server
• Untar and mv to /opt/Local/Library/WebObjects/Applications/
• Curl the WSR app.woa from the build server
• Untar and mv to /srv/www/xxx.com/public_html/WebObjects/
• Fix permissions
![Page 41: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/41.jpg)
Linode Performance Tuning
• Choose the correct size Linode for the job
• Tune config for the service
• Apache
• MySQL
• Linode Library as lots of tips
![Page 42: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/42.jpg)
Linode Backup
• Linode offers a file system level backup service
• Enabled per Linode ($5 - $40/mo)
• 4 Snapshots (today, 1 weekly, 2 week, user triggered)
• DB export may be required for full coverage
![Page 43: Deploying to Ubuntu on Linode](https://reader031.vdocuments.us/reader031/viewer/2022022412/58f0324c1a28abf5528b4599/html5/thumbnails/43.jpg)
Q&A
MONTREAL 1/3 JULY 2011