Skip to content

Instantly share code, notes, and snippets.

@aginanjar
Created April 30, 2017 17:34
Show Gist options
  • Save aginanjar/186817cfe32611e1bd0a4f06ac8980a9 to your computer and use it in GitHub Desktop.
Save aginanjar/186817cfe32611e1bd0a4f06ac8980a9 to your computer and use it in GitHub Desktop.
My Xubuntu Xenial Config

Change repository on source list, I'm using source from Indonesia

cp /etc/apt/sources.list /etc/apt/sources.list.bak

vi /etc/apt/sources.list

deb ftp://ftp.itb.ac.id/pub/ubuntu xenial main restricted universe multiverse
deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-updates main restricted universe multiverse
deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-security main restricted universe multiverse
deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-backports main restricted universe multiverse
deb ftp://ftp.itb.ac.id/pub/ubuntu xenial-proposed main restricted universe multiverse

Update and upgrade

sudo apt-get update && sudo apt-get upgrade

Install multimedia support

sudo apt-get install xubuntu-restricted-extras vlc reference : http://bit.ly/2pLnVJ0

Installing necesarry tools

sudo apt-get install build-essential vim git zsh openssh-server curl I'm using prezto framework for zsh please refer to this repo : https://github.com/sorin-ionescu/prezto for further information, another usefull things for zsh configuration from joshsymonds's blog

Installing LEMP Stack

LEMP is abbreviation from Linux, Nginx, MySql and PHP

  1. Nginx sudo apt-get install nginx Allowing Nginx HTTP using ufw sudo ufw allow "Nginx HTTP" You can check status of Nginx HTTP is active or inactive can use this command : sudo ufw status Make sure ufw is enabled. Enabling it with sudo ufw enable If everything is OK, the result would be like this :
    Status: active
    
    To                         Action      From
    --                         ------      ----
    Nginx HTTP                 ALLOW       Anywhere                  
    OpenSSH                    ALLOW       Anywhere                  
    Nginx HTTP (v6)            ALLOW       Anywhere (v6)             
    OpenSSH (v6)               ALLOW       Anywhere (v6)
    And also check your localhost or 127.0.01 ;)
  2. MySql sudo apt-get install mysql-server sudo mysql_secure_installation for securing mysql
  3. PHP sudo apt-get install php-fpm php-mysql Configure PHP Processor sudo vim /etc/php/7.0/fpm/php.ini Uncomment cgi.fix_pathinfo and set it to 0 Restart latest PHP configuration with : sudo systemctl restart php7.0-fpm.service
  4. Configure Nginx with PHP /etc/nginx/sites-available/default Update nginx config with :
    server {
        listen 80 default_server;
        listen [::]:80 default_server;
    
        root /path/to/your/destination;
        index index.php index.html index.htm index.nginx-debian.html;
    
        server_name server_domain_or_IP;
    
        location / {
            try_files $uri $uri/ =404;
        }
    
        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }
    }
    Check your configuration of nginx : sudo nginx -t if success, the result would be like below :
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    Reload with sudo systemctl reload nginx reference: http://do.co/2oMskLG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment