Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save goodjob1114/f6179ffe6d28e78127b4 to your computer and use it in GitHub Desktop.
Save goodjob1114/f6179ffe6d28e78127b4 to your computer and use it in GitHub Desktop.
hhvm, nginx, php, mariadb -> [laravel] install memo used on Ubuntu 14.04

ubuntu 14.04

sysv-rc-conf (service control tool)

sudo apt-get install -y sysv-rc-conf

nginx

sudo add-apt-repository -y ppa:nginx/stable 
sudo apt-get update
sudo apt-get install -y nginx

php

sudo apt-get update
sudo apt-get install -y php5-fpm php5-mysql

mariadb

reference link

sudo apt-get install -y software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 \
0xcbcb082a1bb943db
sudo add-apt-repository \
'deb http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.0/ubuntu trusty main'
sudo apt-get update
sudo apt-get install -y mariadb-server
sudo mysql_secure_installation

hhvm

wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
echo deb http://dl.hhvm.com/ubuntu trusty main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo wget https://raw.githubusercontent.com/hhvm/packaging/master/hhvm/deb/skeleton/etc/init.d/hhvm /etc/init.d/hhvm && chmod +x /etc/init.d/hhvm
sudo apt-get install -y hhvm

hhvm initialize

sudo /usr/share/hhvm/install_fastcgi.sh
sudo update-rc.d hhvm defaults
sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60

start hhvm daemon 9000 port

sudo hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9000

set auto start service when reboot by sysv-rc-conf

sudo sysv-rc-conf

laravel

cd /srv
composer create-project laravel/laravel --prefer-dist

nginx

vi /etc/nginx/sites-enabled/laravel

=== /etc/nginx/sites-enabled/laravel ===

server {
  listen 80 default_server;

  root /srv/laravel/public;
  index index.html index.htm index.php;

  server_name laravel.app;

  access_log /var/log/nginx/localhost.laravel-access.log;
  error_log /var/log/nginx/locahost.laravel-error.log error;

  charset utf-8;

  location / {
    try_files $uri $uri/ /index.php?$query_string;
  }

  location = /favicon.ico { log_not_found off; access_log off; }
  location = /robots.txt { log_not_found off; access_log off; }

  error_page 404 /index.php;

  include hhvm.conf; # The HHVM Magic Here

  # Deny .htaccess file access
  location ~ /\.ht {
    deny all;
  }
}

=== End of /etc/nginx/sites-enabled/laravel ===

rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-enabled/laravel /etc/nginx/sites-available/laravel
service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment