Last active
May 23, 2016 18:08
-
-
Save db-pj/8479967 to your computer and use it in GitHub Desktop.
VPS Setup Concise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up a new VPS for Framework (Ubuntu 12.04) | |
1. Add personal user | |
useradd pj | |
passwd pj | |
* Add user to 'admin/sudo' and 'www-data' groups | |
adduser pj sudo pj && usermod -G www-data pj | |
Login in as new user | |
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install python-software-properties -y && sudo add-apt-repository ppa:keithw/mosh -y && sudo apt-get update && sudo apt-get install mosh -y && sudo tasksel && sudo apt-get install php5 php5-gd php5-mysql php5-curl php5-cli php5-cgi php5-dev -y && sudo a2enmod rewrite expires headers mime deflate filter && sudo service apache2 restart && sudo apt-get install phpmyadmin -y && sudo apt-get install vim -y && sudo apt-get install git-core git-gui git-doc -y && cd ~ && mkdir ~/.ssh | |
Install Basic Ubuntu server | |
OpenSSH server | |
LAMP server | |
Configure apache2 | |
cd /.ssh | |
sudo ssh-keygen -t rsa -C "pj@digitalbrands.com" && git config --global user.name "PJ Fancher" && git config --global user.email "pj@digitalbrands.com" | |
sudo apt-add-repository ppa:chris-lea/node.js -y && sudo apt-get update && sudo apt-get install nodejs -y && sudo aptitude install npm -y && sudo npm install -g less && git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle && cd ~ && git init && git remote add vimrc git@github.com:digital-brands/.vimrc.git && git pull vimrc master && mkdir ~/.vim/colors && curl -L http://www.vim.org/scripts/download_script.php?src_id=13400 > ~/.vim/colors/wombat256mod.vim && sudo add-apt-repository ppa:webupd8team/java -y && sudo apt-get update && sudo apt-get install oracle-java7-installer -y && sudo apt-get install sendmail -y && sudo apt-get install libjpeg-progs gifsicle optipng imagemagick -y && cd ~ && git clone git://github.com/git/git.git ./git/ && cd git/contrib/subtree && make && sudo install -m 755 git-subtree /usr/lib/git-core && cd ~ && rm -rf ./git | |
#Get .vimrc, .bashrc, snippets, NerdTree Bookmarks, colors, monsoon | |
cd && git clone git@github.com:db-pj/vimrc.git && ln -s vimrc/.vimrc .vimrc && git clone git@github.com:db-pj/bashrc.git && ln -s bashrc/.bashrc .bashrc && source .bashrc && git clone git@github.com:db-pj/NERDTreeBookmarks.git && ln -s NERDTreeBookmarks/.NERDTreeBookmarks .NERDTreeBookmarks && mkdir .vim/colors/ && wget https://raw.githubusercontent.com/vim-scripts/wombat256.vim/master/colors/wombat256mod.vim && mv wombat256mod.vim .vim/colors/ && git clone git@github.com:digital-brands/monsoon-php.git && sudo apt-get install htop && sudo apt-get install tig | |
- - - | |
1. Create Website subdirectory | |
cd /home/ | |
sudo mkdir {site-name} | |
cd {site-name} | |
sudo mkdir public_html && sudo mkdir logs | |
1. Set up a Virtual Host - /etc/apache2/sites-available | |
<VirtualHost *:80> | |
ServerAdmin pj@digitalbrands.com | |
ServerName {site-url} | |
ServerAlias www.{site-url} | |
DocumentRoot /home/{site-url}/public_html | |
ErrorLog /home/{site-url}/logs/error.log | |
CustomLog /home/{site-url}/logs/access.log combined | |
<Directory '/home/{site-url}/public_html'> | |
AuthName 'Password Protected Area' | |
AuthUserFile /home/.htpasswd | |
AuthType Basic | |
Require valid-user | |
AllowOverride All | |
</Directory> | |
</VirtualHost> | |
1. Enable Site | |
sudo a2ensite {virtualhost-filename} | |
1. Set the permissions | |
cd /home/{site-name} | |
sudo chgrp -R www-data public_html/ && sudo chmod -R g+w public_html/ && sudo find public_html/ -type d -exec sudo chmod g+s {} \; && sudo chown -R www-data public_html/ | |
1. Install WordPress | |
cd public_html/ | |
wget http://wordpress.org/latest.tar.gz && tar -xzvf latest.tar.gz && mv ./wordpress/* ./ && rm -rf ./wordpress && rm latest.tar.gz | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment