Nginx과 MariaDB는 공식 repo가 존재하고 PHP는 공식 repo가 없어 PHP만 소스 설치합니다.
PHP같은 경우 사이트 성격에 따라 PHP 버전에 따라 영향이 생길수 있어서 별도 버전별로 설치해서 운영하셔도 됩니다.
MariaDB 설치
# nano /etc/yum.repos.d/MariaDB.repo ---------- /etc/yum.repos.d/MariaDB.repo 내용 ---------- # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 ---------- /etc/yum.repos.d/MariaDB.repo 내용 ---------- # yum update # yum install mariadb-server mariadb-client # systemctl start mariadb # systemctl enable mariadb # /usr/bin/mysqladmin -u root password '#password#' # mysql_secure_installation # nano /etc/my.cnf.d/server.cnf ---------- /etc/my.cnf.d/server.cnf 내용 추가 ---------- # [mysqld] 아래 입력하시면 됩니다. [mysqld] character-set-server=utf8 collation-server=utf8_general_ci ---------- /etc/my.cnf.d/server.cnf 내용 추가 ----------
Nginx 설치
# yum install libxml2 libxml2-devel # yum install openssl openssl-devel # yum install bzip2 bzip2-devel # yum install curl curl-devel # yum install gdbm gdbm-devel # yum install libjpeg libjpeg-devel # yum install libpng libpng-devel # yum install freetype freetype-devel # yum install libc-client libc-client-devel # yum install libicu libicu-devel # yum install libmcrypt libmcrypt-devel # yum install mysql-devel # ./configure --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-sigchild --with-libdir=lib64 \ --prefix=/usr/local/php-7.0.12 --with-config-file-path=/usr/local/php-7.0.12/etc \ --with-config-file-scan-dir=/usr/local/php-7.0.12/etc/conf.d \ --with-openssl --with-kerberos --with-zlib --enable-bcmath --with-bz2 --enable-calendar \ --with-curl --enable-dba --with-gdbm --with-libxml-dir --enable-exif --enable-ftp \ --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf \ --enable-intl --with-gettext --with-mhash --with-imap --with-imap-ssl --enable-mbstring \ --with-mcrypt --with-mysqli=/usr/bin/mysql_config --with-pdo-mysql \ --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx \ --enable-zip # make # make test # make install # ln -s /usr/local/php-7.0.12/bin/php /usr/bin/php # cp php.ini-production /usr/local/php70/etc/php.ini # cp /usr/local/php-7.0.12/etc/php-fpm.conf.default /usr/local/php-7.0.12/etc/php-fpm.conf