Skip to content

Instantly share code, notes, and snippets.

@purwandi
Last active December 18, 2015 00:28
Show Gist options
  • Save purwandi/5696404 to your computer and use it in GitHub Desktop.
Save purwandi/5696404 to your computer and use it in GitHub Desktop.

Install Git

Parepare some additional software

apt-get update

python g++ make build-essential bzip2 libpcre3-dev libssl-dev daemon libgeoip-dev libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential

Once they are installed, you can download the latest version of Git from the google code page. wget https://git-core.googlecode.com/files/git-1.8.1.2.tar.gz

After it downloads, untar the file and switch into that directory: tar -zxf git-1.8.1.2.tar.gz cd git-1.8.1.2

If you want to do a global install, install it once as yourself and once as root, using the sudo prefix: make prefix=/usr/local all sudo make prefix=/usr/local install

MariaDB

Here are the commands to run to add MariaDB to your system:

sudo apt-get install python-software-properties
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mariadb.biz.net.id//repo/5.5/ubuntu precise main'

Once the key is imported and the repository added you can install MariaDB with:

sudo apt-get update
sudo apt-get install mariadb-server

See Installing MariaDB .deb Files for more information.

You can also create a custom MariaDB sources.list file. To do so, copy and paste the following into a file under /etc/apt/sources.list.d/(we suggest naming the file MariaDB.list or something similar), or add it to the bottom of your /etc/apt/sources.list file.

# MariaDB 5.5 repository list - created 2013-06-03 07:25 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mariadb.biz.net.id//repo/5.5/ubuntu precise main
deb-src http://mariadb.biz.net.id//repo/5.5/ubuntu precise main

Installing Nginx

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

Konfigurasi

server {
    listen   80;
    root /home/purwandi/Sites/Flestok/public;
    index index.php index.html index.htm;

    server_name flestok.dev;
    #Specify a charset
    charset utf-8;

    # Include the component config parts for h5bp
    include conf/h5bp.conf;

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

    # pass the PHP scripts to FastCGI server
    location ~ \.php$ {

        # cors domain
        # include conf/cors.conf;

        # Zero-day exploit defense.
        # http://forum.nginx.org/read.php?2,88845,page=3
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include /etc/nginx/fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MACHINE local;

        ## Custom FastCGI
        fastcgi_send_timeout 900;
        fastcgi_read_timeout 900;
        fastcgi_buffer_size 512k;
        fastcgi_buffers 16 256k;
        fastcgi_busy_buffers_size 512k;
        fastcgi_temp_file_write_size 512k;
        fastcgi_intercept_errors on;

        # fastcgi_intercept_errors on;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
    }

    # deny access to .htaccess files, if Apache's document root
    location ~ /\.ht {
        deny all;
    }

    access_log  /var/log/nginx/flestok.dev-access.log;
    error_log  /var/log/nginx/flestok.dev-error.log;

}

Installing PHP 5.4

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5-fpm php5-cli php5-curl php5-gd php5-xsl php5-geoip php5-imagick php5-imap php5-mcrypt php5-mysqlnd

Installing PHP 7

sudo apt-get install php7.0-fpm php7.0-cli php7.0-curl php7.0-gd php7.0-common php7.0-dev php7.0-mcrypt php7.0-pgsql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment