Skip to content

Instantly share code, notes, and snippets.

@iamkingsleyf
Created October 30, 2015 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamkingsleyf/5689ce6c27fd2b96cf02 to your computer and use it in GitHub Desktop.
Save iamkingsleyf/5689ce6c27fd2b96cf02 to your computer and use it in GitHub Desktop.
##
# 301 redirect settings
##
server {
listen 80;
server_name healthable.org;
rewrite ^(.*) http://www.healthable.org$1 permanent;
}
##
# MAIN CONFIGURATION
##
server {
server_name www.healthable.org;
listen 80;
##
# LOGGING DETAILS
##
access_log /src/www/healthable.org/logs/access.log;
error_log /src/www/healthable.org/logs/error.log;
##
# ROOT DIRECTORY FOR SITE
##
root /src/www/healthable.org/public;
##
# FILE TYPES TO SERVE
##
index index.php index.html;
##
# WORDPRESS PERMALINK
##
location / {
try_files $uri $uri/ /index.php?$args;
#try_files $uri $uri/ /index.php?q=$uri&$args;
}
##
# PHP-FPM parsing
##
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
CREATE DATABASE joda;
CREATE USER 'healthable'@'localhost' IDENTIFIED BY '@@healthable@@';
GRANT ALL PRIVILEGES ON healthable.* TO 'healthable'@'localhost';
FLUSH PRIVILEGES;
chown -hR www-data:www-data /src/www/healthable.org
104.237.129.34 nnegi.kraftysprouts.com nnegi
echo "nnegi.kraftysprouts.com" > /etc/hostname
hostname -F /etc/hostname
service nginx restart && service php5-fpm restart
===========================
# WordPress website: Healthable
#Redirect NON www to www for www.healthable.org
server {
listen 80;
server_name healthable.org;
return 301 http://www.healthable.org$request_uri;
}
# the server directive is nginx's virtual host directive.
server {
listen 80;
server_name www.healthable.org;
# Set the charset
charset utf-8;
#Root folder were to server files
root /src/www/healthable.org/public;
#Nginx looks for PHP files
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
# Set image format types to expire in a very long time
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|html|xml|otf|ttf|eot|woff)$ {
expires 30d;
access_log off;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
# Add a slash at the end of request */wp-admin
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# PLUGINS : Enable Rewrite Rules for Yoast SEO SiteMap
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
#Other awesomes stuffs
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }
location ~ /\. { deny all; log_not_found off; access_log off; }
access_log /src/www/healthable.org/logs/access.log;
error_log /src/www/healthable.org/logs/error.log error;
error_page 404 /index.php;
# Add Rocket-Nginx configuration (of course !!)
include rocket-nginx/rocket-nginx.conf;
#Includes HHVM configuration
include hhvm.conf;
}
$ sudo mkdir -p /src/www/healthable.org/public
$ sudo mkdir /src/www/healthable.org/logs
server {
server_name healthable.org www.healthable.org;
root /src/www/healthable.org/public;
index index.php;
include global/restrictions.conf;
# Additional rules go here.
include global/wordpress.conf;
}
https://s3-us-west-2.amazonaws.com/kraftysprouts/15-10-11/dir-_src_www_healthable.org_.tar.gz
dir-_src_www_healthable.org_.tar.gz
wget https://s3-us-west-2.amazonaws.com/kraftysprouts/15-10-11/dir-_src_www_healthable.org_.tar.gz /src/www/healthable.org/
sudo chown -R www-data:www-data /var/www/example.com/public_html
sudo ln -s /etc/nginx/sites-available/healthable.org /etc/nginx/sites-enabled/healthable.org
healthable.org
=============================================
server {
listen 80;
server_name healthable.org www.healthable.org;
access_log /src/www/healthable.org/logs/access.log ;
error_log /src/www/healthable.org/logs/error.log;
root /src/www/healthable.org/public;
index index.php index.html index.htm;
include global/restrictions.conf;
include global/wordpress.conf;
}
# WordPress website: Jodablog
server {
listen 80;
server_name www.jodablog.com;
return 301 $scheme://jodablog.com$request_uri;
#Root folder were to server files
root /src/www/jodablog.com/public;
index index.php index.html;
access_log /src/www/jodablog.com/logs/access.log;
error_log /src/www/jodablog.com/logs/error.log error;
error_page 404 /index.php;
#Includes HHVM configuration
include hhvm.conf;
#wordpress specific
include global/wordpress.cache.conf;
include global/restrictions.conf;
#include global/wordpress.conf;
}
root@Adserver:~# kill 9066
root@Adserver:~# apt-get install nginx
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
root@Adserver:~# dpkg --configure -a
Setting up nginx-common (1.9.4-1+trusty0) ...
#Redirect www to NON www for jodablog.com
server {
listen 80;
server_name www.jodablog.com;
return 301 http://jodablog.com$request_uri;
}
# the server directive is nginx's virtual host directive.
server {
listen 80;
server_name jodablog.com;
# Set the charset
charset utf-8;
#Root folder were to server files
root /src/www/jodablog.com/public;
#Nginx looks for PHP files
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
# Set image format types to expire in a very long time
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|html|xml|otf|ttf|eot|woff)$ {
expires 14d;
access_log off;
add_header Pragma public;
add_header Cache-Control "public";
}
# Add a slash at the end of request */wp-admin
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# PLUGINS : Enable Rewrite Rules for Yoast SEO SiteMap
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
#Other awesomes stuffs
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }
location ~ /\. { deny all; log_not_found off; access_log off; }
access_log /src/www/jodablog.com/logs/access.log;
error_log /src/www/jodablog.com/logs/error.log error;
error_page 404 /index.php;
#Includes HHVM configuration
include hhvm.conf;
#wordpress specific
#include global/restrictions.conf;
include global/wordpress.cache.conf;
}
ln -s /etc/nginx/sites-available/citymp3.com.conf /etc/nginx/sites-enabled/citymp3.com.conf
sudo mysql -u root -p flingsmobile < /home/sql/jodablog.sql
chown -hR www-data:www-data /home/kingsley/flingsmobile.com
chmod -R 755 /home/kingsley/flingsmobile.com
flingsmobile.com.conf
server {
listen 80;
server_name www.flingsmobile.com;
root /home/kingsley/flingsmobile/public;
index index.php;
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|html|xml|otf|ttf|eot|woff)$ {
expires 30d;
access_log off;
add_header Cache-Control public;
}
# PLUGINS : Enable Rewrite Rules for Yoast SEO SiteMap
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }
location ~ /\. { deny all; log_not_found off; access_log off; }
access_log /home/kingsley/flingsmobile.com/logs/access.log;
error_log /home/kingsley/citymp3.com/logs/error.log error;
error_page 404 /index.php;
include hhvm.conf;
}
=====================================
69.28.85.2 adserver.kraftysprouts.com adserver
wget http://download.revive-adserver.com/revive-adserver-3.2.1.zip
unzip revive-adserver-3.2.1.zip
mv revive-adserver-3.2.1 /var/www/adserver.kraftysprouts.com/ad
sudo ln -s /etc/nginx/sites-available/healthable.org.conf /etc/nginx/sites-enabled/healthable.org.conf
http://charles.lescampeurs.org/2008/11/14/fix-nginx-increase-server_names_hash_bucket_size
http://www.liberiangeek.net/2014/09/install-memcached-ubuntu-14-04-lts/
http://www.liberiangeek.net/2014/10/managed-achieve-100-pagespeed-insights-scores/
mysql -u root -p
CREATE DATABASE adserver_3;
CREATE USER adserver@localhost;
GRANT ALL PRIVILEGES ON adserver_3.* to adserver@localhost IDENTIFIED BY 'adserver';
FLUSH PRIVILEGES;
quit
[emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
root@Adserver:/var/www/adserver.kraftysprouts.com# nginx -t
nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
sudo chown www-data:www-data * -R
sudo chown -hR www-data:www-data /var/www/adserver.kraftysprouts.com/
CREATE DATABASE flingsmobile;
CREATE USER 'flingsmobile'@'localhost' IDENTIFIED BY '@@flingsmobile@@';
GRANT ALL PRIVILEGES ON flingsmobile.* TO 'flingsmobile'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON flingsmobile.* TO 'flingsmobile'@'localhost';
FLUSH PRIVILEGES;
exit
==================================================
45.58.42.228 tari.kraftysprouts.com tari
http://www.shaunfreeman.name/installing-nginx-php-fpm-hhvm-on-ubuntu-14-04/#comment-3698
http://blog.diegorbaquero.com/2015/08/how-to-install-nginx-and-hhvm-with-php5-fpm-fallback-on-ubuntu-14-04/#comment-6
https://bjornjohansen.no/install-latest-version-of-nginx-on-ubuntu
php5enmod mcrypt
hhvm.server.file_socket = /var/run/hhvm/hhvm.sock
apt-get update && apt-get upgrade && apt-get dist-upgrade
45.58.41.186
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup
$cfg['Servers'][$i]['port'] = '3306';
(int)
45.79.141.163 mainserver.kraftysprouts.com mainserver
adduser kingsley
echo "This is the body of the email" | mail -s "This is the subject line" kingsleyfelix9@gmail.com
# m h dom mon dow command
sudo mkdir -p /src/www/jodablog.com/public
$ sudo mkdir /src/www/your-domain.com/logs
$ cd ~
$ wget http://wordpress.org/latest.tar.gz
$ tar xzvf latest.tar.gz
$ cd ~/wordpress
$ sudo cp -r . /src/www/your-domain.com/htdocs/
adduser kingsley
gpasswd -a kingsley sudo
159.203.80.137 nnegi.kraftysprouts.com nnegi
/home/kingsley/healthable.org
mkdir -p /home/kingsley/healthable.org
sudo chmod -R 755 /home/kingsley/healthable.org
sudo chown -R www-data:www-data /home/kingsley/healthable.org
CREATE DATABASE healthable;
CREATE USER 'healthable'@'localhost' IDENTIFIED BY '@@healthable@@';
GRANT ALL PRIVILEGES ON healthable.* TO 'healthable'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON healthable.* TO 'healthable'@'localhost';
FLUSH PRIVILEGES;
scp /home/kingsley/healthable.org/public.zip root@159.203.80.137:/home/kingsley/healthable.org
ln -s /etc/nginx/sites-available/healthable.org.conf /etc/nginx/sites-enabled/healthable.org.conf
server {
listen 80;
server_name www.healthable.org healthable.org;
root /home/kingsley/healthable.org/public;
index index.html index.htm index.php;
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|html|xml|otf|ttf|eot|woff)$ {
expires 30d;
access_log off;
add_header Cache-Control public;
}
# PLUGINS : Enable Rewrite Rules for Yoast SEO SiteMap
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; }
location ~ /\. { deny all; log_not_found off; access_log off; }
access_log /home/kingsley/healthable.org/logs/access.log;
error_log /home/kingsley/healthable.org/logs/error.log error;
error_page 404 /index.php;
include hhvm.conf;
}
http://nomadhacker.com/2014/02/10/whip-snapping-fast-wordpress-nginx-hhvm-part-2/
http://www.servermom.org/using-nixstats-to-monitor-server-performance/2290/
https://www.andrewmunsell.com/blog/setup-hack-and-hhvm-on-digital-ocean/
104.236.136.154
chown -hR www-data:www-data /home/kingsley/healthable.org
ln -s /etc/nginx/sites-available/healthable.org.conf /etc/nginx/sites-enabled/healthable.org.conf
gpasswd -a kingsley sudo
echo "tari.healthable.org" > /etc/hostname
hostname -F /etc/hostname
dd if=/dev/zero of=/swapfile bs=1G count=2
============================================================================
http://www.servermom.org/install-wordpress-hhvm-vps/2249/
http://www.linuxveda.com/2015/06/17/install-mysql-mariadb-secure-configure/
https://richardtape.com/2015/02/14/setting-wordpress-hhvm-digital-ocean/
https://codeable.io/community/how-to-set-up-wordpress-vps/
https://codeable.io/community/how-to-install-wordpress/
http://code.tutsplus.com/articles/using-hhvm-with-wordpress--cms-21596
https://webdevstudios.com/2014/07/17/setting-up-wordpress-nginx-hhvm-for-the-fastest-possible-load-times/
https://github.com/chuckreynolds/hhnginx
https://richardtape.com/2015/03/07/from-php-to-hhvm/
http://stackoverflow.com/questions/28308099/nginx-and-hhvm-always-return-a-404
http://opensourceeducation.net/updating-nginx-1-4-6-to-1-8-x-on-ubuntu-14-04-and-fixing-limit_zone-errors/
===========================================================================================
104.236.136.154 tari.healthable.org tari
adduser kingsley
usermod -a -G sudo kingsley
sudo ln -s /etc/nginx/sites-available/healthable.org /etc/nginx/sites-enabled/healthable.org
ln -s /etc/nginx/sites-available/healthable.org.conf /etc/nginx/sites-enabled/healthable.org.conf
BACKUPDIR="/home/kingsley/automysqlbackup"
mkdir healthable.org
mkdir healthable.org/logs
mkdir healthable.org/public
chmod -R 755 healthable.org
sudo nano healthable.org
=========================================================================
ERROR 1231 (42000) at line 289753: Variable 'character_set_client' can't be set to the value of 'NULL'
https://codeable.io/community/speed-up-wp-admin-redis-hhvm/
adduser kingsley
$ gpasswd -a kingsley sudo
$ gpasswd -a kingsley www-data
$ sudo usermod -g www-data kingsley
107.191.44.37 idi.healthable.org idi
$ sudo mkdir -p /src/www/healthable.org/public
$ sudo mkdir /src/www/healthable.org/logs
$ cd ~
$ wget http://wordpress.org/latest.tar.gz
$ tar xzvf latest.tar.gz
$ cd ~/wordpress
$ sudo cp -r . /src/www/your-domain.com/htdocs/
$ cd /src/www/healthable.org/
$ sudo chown -R kingsley *
$ sudo chgrp -R www-data *
$ sudo chmod -R g+rwx /src/www/healthable.org/
sudo nano /etc/nginx/sites-available/common.conf
sudo nano /etc/nginx/sites-available/healthable.conf
nginx.error.log
nginx.access.log
sudo mysql -u root -p jodablog < /home/kingsley/sql/jodablog.sql
mysql -u root -p healthable < /home/kingsley/sql/healthable.sql
sudo ln -s /etc/nginx/sites-available/healthable.conf .
/srv/users/serverpilot/apps/healthable
CREATE DATABASE citymp3;
CREATE USER 'citymp3'@'localhost' IDENTIFIED BY '@@citymp3@@';
GRANT ALL PRIVILEGES ON citymp3.* TO 'citymp3'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON citymp3.* TO 'citymp3'@'localhost';
FLUSH PRIVILEGES;
==============================================================================
http://www.liberiangeek.net/2014/10/install-latest-version-nginx-ubuntu-14-10/
http://www.liberiangeek.net/2015/07/how-to-install-and-configure-hhvm-on-ubuntu-15-04/
http://gosukiwi.svbtle.com/highperformance-wordpress-installation-using-nginx-mariadb-and-hhvm-from-scratch-in-ubuntu-1310
http://www.liberiangeek.net/2015/08/how-to-install-wordpress-with-support-for-nginx-mariadb-hhvm-on-ubuntu-15-04/
https://www.maketecheasier.com/setup-lemh-stack-in-ubuntu/
https://bjornjohansen.no/install-latest-version-of-nginx-on-ubuntu
https://bjornjohansen.no/running-hhvm-instead-php-nginx-ubuntu
http://fideloper.com/hhvm-nginx-laravel
https://kinsta.com/blog/hhvm-and-wordpress/
https://thinkingandcomputing.com/2014/10/23/hhvm-nginx-on-digitalocean-comprehensive-guide/
https://richardtape.com/2015/03/07/from-php-to-hhvm/
http://www.servermom.org/install-wordpress-hhvm-vps/2249/
================================================================================
scp /srv/users/serverpilot/apps/healthable/public.zip root@107.170.214.5:/src/www/healthable.org
$ adduser kingsley
$ gpasswd -a kingsley sudo
$ gpasswd -a kingsley www-data
$ sudo usermod -g www-data kingsley
$ cd /src/www/healthable.org/
$ sudo chown -R kingsley *
$ sudo chgrp -R www-data *
$ sudo chmod -R g+rwx /src/www/healthable.org/
http://www.liquidweb.com/kb/how-to-install-mariadb-5-5-on-ubuntu-14-04-lts/
sudo ln -s /etc/nginx/sites-available/healthable.conf .
debug.log
healthable.org
$ sudo mkdir -p /src/www/healthable.org/public
$ sudo mkdir /src/www/healthable.org/logs
$ cd ~
$ wget http://wordpress.org/latest.tar.gz
$ tar xzvf latest.tar.gz
$ cd ~/wordpress
$ sudo cp -r . /src/www/your-domain.com/htdocs/
CREATE DATABASE healthable;
CREATE USER 'healthable'@'localhost' IDENTIFIED BY '@@healthable@@';
GRANT ALL PRIVILEGES ON healthable.* TO 'healthable'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON healthable.* TO 'healthable'@'localhost';
FLUSH PRIVILEGES;
exit
===================================
scp /srv/users/serverpilot/apps/healthable/public.zip root@107.191.44.37:/src/www/healthable.org
$ sudo mkdir -p /home/kingsley/jodablog.com/public
$ sudo mkdir /src/www/healthable.org/logs
/home/kingsley/jodablog.com/public
#Yoast sitemap
location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ {
## this redirects sitemap.xml to /sitemap_index.xml
rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent;
## this makes the XML sitemaps work
rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last;
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
}
sudo mv phpmyadmin mysql
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:iamkingsleyf:@@king10@@
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587
echo "This is the body of the email" | mail -s "This is the subject line" kingsleyfelix9@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment