sudo apt-get update
sudo apt-get upgrade
sudo apt-get install htop git python-software-properties curl libm17n-0 rcconf dialog graphicsmagick build-essential openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev
sudo apt-get install libgoogle-perftools-dev google-perftools
wget http://nginx.org/download/nginx-1.10.1.tar.gz
tar zxvf nginx-1.10.1.tar.gz
rm nginx-1.10.1.tar.gz
cd nginx-1.10.1
sudo ./configure --with-google_perftools_module --with-http_stub_status_module --with-http_ssl_module
sudo make
sudo make install
sudo ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
- Add
/etc/init/nginx.conf
with info from https://www.nginx.com/resources/wiki/start/topics/examples/ubuntuupstart/# - In above script, may need to change DAEMON to
env DAEMON=/usr/bin/nginx
sudo initctl list | grep nginx
sudo initctl start nginx
- Visit
http://{ip_address}
to verify successful nginx install - Create your web directory:
sudo mkdir -p /var/www/{site}/html
- Configure permissions:
sudo chown -R $USER:$USER /var/www/{site}/html
sudo chmod -R 755 /var/www
sudo apt-get install git
git config --global user.name "name"
git config --global user.email "email"
- Create ssh keys, upload to git user's account
- Clone your repo to
/var/www/{site}/html
- Install nvm from
https://github.com/creationix/nvm
nvm install 4.4.7
nvm use 4.4.7
nvm alias default 4.4.7
- Update npm:
cd ~/.nvm/versions/node/v4.4.7/lib
and thennpm install npm
npm install pm2 -g
pm2 startup ubuntu
pm2 start app.js
pm2 startup ubuntu
- Follow instructions from CLI
- Tweak the config from https://keymetrics.io/2014/06/17/high-performance-server-configuration-with-ubuntunginxpm2/
- Create file in /etc/logrotate.d/nginx.
- Paste and modify the following:
/var/log/nginx/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
endscript
}
- Run
sudo logrotate -f /etc/logrotate.d/nginx
to confirm that your log rotate works.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php7.0-cli php7.0-fpm php7.0-gd php7.0-json php7.0-mysql php7.0-readline php7.0-pdo
sudo apt-get install mcrypt php7.0-mcrypt
sudo apt-get install php-curl
sudo apt-get install php7.0-mbstring
sudo apt-get install php7.0-zip
sudo apt-get install php7.0-xml
sudo apt-get install php7.0-sybase
- Don't know why, but apache2 got installed. Uninstall with
sudo service apache2 stop
, and thensudo apt-get autoremove apache2
, and thensudo apt-get purge apache2*
. - Install composer:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer