2018-03-03

AWS Nginx PHP7.0-FPM MariaDB

PHP:

PHP install:
sudo apt-get install php-fpm php-mysql

PHP module install:
apt-get install php7.0-gd php7.0-curl php7.0-mbstring php7.0-xml php7.0-mcrypt


MariaDB:

MariaDB 완전 삭제
sudo apt-get purge mariadb-server
sudo apt-get purge mariadb-common

sudo rm -rf /var/log/mysql
sudo rm -rf /var/log/mysql.*
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql

MariaDB 설치하기
sudo apt install mariadb-server mariadb-client php7.0-mysql
sudo systemctl restart php7.0-fpm.service

Security Script 실행하기
sudo mysql_secure_installation

sudo 없이 mysql 실행하기
sudo mysql -u root -p
MariaDB> use mysql;
MariaDB> update user set plugin=’‘ where User=’root’;
MariaDB> flush privileges;
MariaDB> exit

How To Install Nginx, MariaDB 10, PHP 7 (LEMP Stack) in 16.10/16.04:
https://www.tecmint.com/install-nginx-mysql-php-lemp-in-ubuntu-16-10-ubuntu-16-04/

How to install Mysql/MariaDB on Ubuntu
https://thishosting.rocks/install-mysql-mariadb-ubuntu/

Wordpress Database 생성:
http://webdir.tistory.com/98


Prepare to install Nginx:

1. download
wget http://nginx.org/download/nginx-1.12.2.tar.gz

apt-get install gcc ; for gcc compile
apt-get install g++ ; for cpp compile

$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
$ tar -zxf pcre-8.41.tar.gz
$ cd pcre-8.41
$ ./configure
$ make
$ sudo make install

$ wget http://zlib.net/zlib-1.2.11.tar.gz
$ tar -zxf zlib-1.2.11.tar.gz
$ cd zlib-1.2.11
$ ./configure
$ make
$ sudo make install

$ wget http://www.openssl.org/source/openssl-1.0.2k.tar.gz
$ tar -zxf openssl-1.0.2k.tar.gz
$ cd openssl-1.0.2k
$ ./configure --prefix=/usr/local --openssldir=/usr/local/openssl
$ make
$ sudo make install

Nginx configuration:
./configure \
--sbin-path=/usr/local/nginx/nginx \
--conf-path=/usr/local/nginx/nginx.conf \
--pid-path=/usr/local/nginx/nginx.pid \
--with-pcre=../pcre-8.41 \
--with-zlib=../zlib-1.2.11 \
--with-http_ssl_module \
--with-stream \
--with-mail=dynamic \
--with-stream_ssl_module


Ubuntu 버전체크
cat /etc/issue
lsb_release -a

메모리 체크
free -m

CPU 코어수 확인
cat /proc/cpuinfo | grep processor | wc -l

Timezone 설정
dpkg-reconfiure tzdata

Public IP check site
curl bot.whatismyipaddress.com
curl http://ipecho.net/plain
curl icanhazip.com
curl ipv4.icanhazip.com
curl ipv4.ipogre.com

OpenLDAP:
http://blog.hkwon.me/use-openldap-part1/