Skip to content

Instantly share code, notes, and snippets.

@hagino3000
Created March 8, 2011 09:51
Show Gist options
  • Save hagino3000/860104 to your computer and use it in GitHub Desktop.
Save hagino3000/860104 to your computer and use it in GitHub Desktop.
Setup Ubuntu Server
#!/bin/bash
sudo locale-gen ja_JP.UTF-8
sudo update-locale LANG=ja_JP.UTF-8
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get -y install zsh
sudo apt-get -y install screen
sudo apt-get -y install vim
sudo apt-get -y install mercurial
sudo apt-get -y install git-core
sudo apt-get -y install subversion
sudo apt-get -y install zip
sudo apt-get -y install tree
sudo apt-get install manpages-ja manpages-ja-dev
sudo apt-get install lv
sudo apt-get install nkf
sudo apt-get install nginx
sudo apt-get -y install python-setuptools
sudo apt-get -y install python-software-properties
# install mongodb
sudo apt-get -y install mongodb
# install node
sudo apt-get -y install openssl
sudo apt-get -y install g++ curl libssl-dev apache2-utils
mkdir dev
cd dev
mkdir lib
cd lib
wget http://nodejs.org/dist/node-v0.4.2.tar.gz
node-v0.4.2.tar.gz
tar -xvf node-v0.4.2.tar
cd node-v0.4.2/
./configure
make
sudo make install
# install npm
curl http://npmjs.org/install.sh > npminstall.sh
sudo sh npminstall.sh
rm npminstall.sh
# install packages for node
sudo npm install express
sudo npm install expresso
sudo npm install ejs
sudo npm install less
sudo npm install socket.io
sudo npm install mongodb
sudo npm install nodeunit
sudo npm install jsdom
sudo npm install nodemon
sudo npm install socket.io
cd dev
hg clone https://bitbucket.org/hagino_3000/confs
cd confs
cp _vimrc ~/.vimrc
cp _gvimrc ~/.gvimrc
cp .zshrc ~/
cp .zshrc.mine ~/
cp .screenrc ~/
cp -r .vim ~/.vim
chsh -s /usr/bin/zsh
sudo update-alternatives --config editor
mkdir .ssh -m 700 .ssh
echo XXXXXXXXXXXXXXXXXXXXX > .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
# edit sshg_config
sudo vi /etc/ssh/sshd_config
# check
sudo sshd -t
# restart
sudo service ssh restart
sudo ufw default deny
sudo ufw allow 22
sudo ufw allow 80
sudo ufw enable
sudo add-apt-repository 'deb http://archive.canonical.com/ lucid partner'
audo apt-get update
sudo aptitude install sun-java6-jdk
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#saved /etc/nginx/conf.d/proxy.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment