Skip to content

Instantly share code, notes, and snippets.

@amanualt amanualt/config_server.md
Last active Dec 5, 2018

Embed
What would you like to do?

#Install nginx pagespeed naxsi add-apt-repository ppa:nginx/stable

hilangkan semua tanda pagar di depan

vim /etc/apt/sources.list.d/nginx-ubuntu-stable-xenial.list
apt-get update
cd /tmp
apt install dpkg-dev
apt build-dep nginx-extras nginx-common
apt-get source nginx-extras
cd nginx-1.14.0/
apt install build-essential zlib1g-dev libpcre3 libpcre3-dev uuid-dev liblua5.1-0-dev libluajit-5.1-dev daemon dbconfig-common unzip libldap2-dev

cd debian/modules/
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/master.zip -O nginx_purge_module.zip 
unzip nginx_purge_module.zip

wget https://github.com/apache/incubator-pagespeed-ngx/archive/v1.13.35.2-stable.zip
unzip v1.13.35.2-stable.zip
mv incubator-pagespeed-ngx-1.13.35.2-stable ngx_pagespeed-latest-stable

cd ngx_pagespeed-latest-stable
wget https://dl.google.com/dl/page-speed/psol/1.13.35.2-x64.tar.gz
tar -xzvf 1.13.35.2-x64.tar.gz
rm 1.13.35.2-x64.tar.gz

cd ..
wget https://github.com/nbs-system/naxsi/archive/master.zip
unzip master.zip 

Add module

vim ../rules
extras_configure_flags := \
                        --with-http_addition_module \
                        --with-http_dav_module \
                        ......
                        ......
                        --add-dynamic-module=$(MODULESDIR)/ngx_pagespeed-latest-stable \
                        --add-dynamic-module=$(MODULESDIR)/ngx_cache_purge-master \
                        --add-dynamic-module=$(MODULESDIR)/naxsi-master/naxsi_src

Rename

vim ../changelog 
nginx (1.10.3-0ubuntu0.16.04.2) xenial-security; urgency=medium  `to`  nginx (1.10.3-0ubuntu0.16.04.2-pagespeed-naxsi) xenial-security; urgency=medium

cd ../../
dpkg-buildpackage -uc -b

Install php 7.1

apt-get install -y python-software-properties
add-apt-repository -y ppa:ondrej/php
apt-get update -y
apt install php7.1 \
  php7.1-common \
  php7.1-fpm \
  php7.1-intl \
  php7.1-mysql \
  php7.1-pspell \
  php7.1-xsl \
  php7.1-bcmath \
  php7.1-curl \
  php7.1-gd \
  php7.1-json \
  php7.1-odbc \
  php7.1-readline \
  php7.1-sybase \
  php7.1-zip \
  php7.1-bz2 \
  php7.1-dba \
  php7.1-gmp \
  php7.1-ldap \
  php7.1-opcache \
  php7.1-recode \
  php7.1-tidy \
  php7.1-cgi \
  php7.1-dev \
  php7.1-imap \
  php7.1-mbstring \
  php7.1-snmp \
  php7.1-xml \
  php7.1-cli \
  php7.1-enchant \
  php7.1-interbase \
  php7.1-mcrypt \
  php7.1-phpdbg \
  php7.1-soap \
  php7.1-xmlrpc
  
apt install mysql-server

Create new user

mkdir /home/user1
useradd -d /home/user1 user1
usermod -a -G www-data  user1

Error locale

perl: warning: Falling back to a fallback locale ("en_US.UTF-8").

Solution

export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

restart nginx on docker

/etc/init.d/nginx restart

~123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.