Project

General

Profile

Support #724

Install SSL-Decoder on FreeBSD

Added by Daniel Curtis almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Server
Target version:
Start date:
01/17/2016
Due date:
% Done:

100%

Estimated time:
0.50 h
Spent time:

Description

This is a guide on how I installed ssl-decoder with nginx on FreeBSD 9.

Prepare the Environment

  • Make sure the system is up to date:
    pkg update && pkg upgrade
    
  • Install a few dependencies:
    pkg install nginx php56 pecl-intl php56-bcmath php56-curl php56-filter php56-mbstring php56-openssl php56-xml python2 py27-netaddr
    

Install Nginx

  • Start and enable nginx at boot:
    echo 'nginx_enable="YES"' >> /etc/rc.conf
    service nginx start
    
  • Create a configuration directory to make managing individual server blocks easier
    mkdir /usr/local/etc/nginx/conf.d
    
  • Edit the main nginx config file:
    vi /usr/local/etc/nginx/nginx.conf
    
    • And strip down the config file and add the include statement at the end to make it easier to handle various server blocks:
      #user  nobody;
      worker_processes  1;
      error_log  /var/log/nginx-error.log;
      
      events {
          worker_connections  1024;
      }
      
      http {
          include       mime.types;
          default_type  application/octet-stream;
      
          sendfile        on;
          #tcp_nopush     on;
      
          #keepalive_timeout  0;
          keepalive_timeout  65;
      
          #gzip  on;
      
          # Load config files from the /etc/nginx/conf.d directory
          include /usr/local/etc/nginx/conf.d/*.conf;
      }
      
  • Configure the default PHP settings
    cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
    
  • Edit /usr/local/etc/php-fpm.conf:
    vi /usr/local/etc/php-fpm.conf
    
    • Make the following changes:
      listen = /var/run/php-fpm.sock
      listen.owner = www
      listen.group = www
      listen.mode = 0660
      
  • Start and enable PHP-FPM at boot:
    echo 'php_fpm_enable="YES"' >> /etc/rc.conf
    service php-fpm start
    

Install SSL-Decode

  • Clone ssl-decode from GitHub:
    cd /usr/local/www
    git clone https://github.com/RaymiiOrg/ssl-decoder.git
    
  • Create a ssl-decoder.example.com server block:
    vi /usr/local/etc/nginx/conf.d/ssl-decoder.example.com.conf
    
    • Add the following:
      server {
          listen       80;
          server_name  ssl-decoder.example.com;
          root         /usr/local/www/ssl-decoder;
          access_log   /var/log/ssl-decoder.example.com-access.log;
          error_log    /var/log/ssl-decoder.example.com-error.log;
      
          location / {
              index  index.php index.html index.htm;
          }
      
          # For all PHP requests, pass them on to PHP-FPM via FastCGI
          location ~ \.php$ {
              fastcgi_pass unix:/var/run/php-fpm.sock;
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              fastcgi_param PATH_INFO $fastcgi_script_name;
              include fastcgi_params; # include extra FCGI params
          }
      }
      
  • Change the ownership of ssl-decode to the www user:
    chown -R www:www /usr/local/www/ssl-decoder
    
  • Restart nginx:
    service nginx restart
    

Resources

Also available in: Atom PDF