LNMP源码安装

1. mysql安装

# Preconfiguration setup
shell > groupadd mysql
shell > useradd -r -g mysql -s /bin/false mysql
# Beginning of source-build specific instructions
shell > tar zxvf mysql-5.7..tar.gz
shell > cd mysql-5.7. shell > cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.7. \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE= \
-DWITH_ARCHIVE_STORAGE_ENGINE= \
-DWITH_FEDERATED_STORAGE_ENGINE= \
-DWITH_BLACKHOLE_STORAGE_ENGINE= \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE= \
-DWITH_PARTITION_STORAGE_ENGINE= \
-DWITH_PERFSCHEMA_STORAGE_ENGINE= \
-DWITH_READLINE=ON \
-DWITH_BOOST=/usr/local/src/boost-1.59. \
-DENABLED_LOCAL_INFILE= \
-DMYSQL_DATADIR=/data/mysql/data \
-DMYSQL_USER=mysql \
-DMYSQL_UNIX_ADDR=/data/mysql/data/mysql.sock \ shell > make
shell > make install
shell > ln -s /usr/local/mysql-5.7. /usr/local/mysql
shell > cd /usr/local/mysql
shell > chown -R mysql .
shell > chgrp -R mysql . shell> bin/mysql_install_db --user=mysql # Before MySQL 5.7.
shell> bin/mysqld --initialize --user=mysql # MySQL 5.7. and up
shell> bin/mysql_ssl_rsa_setup # MySQL 5.7. and up
shell> chown -R root .
shell> chown -R mysql /data/mysql/data
shell> bin/mysqld_safe --user=mysql & shell> cp support-files/mysql.server /etc/init.d/mysql.server

2. PHP安装

shell > groupadd php

shell > useradd -r -g php -s /bin/false php

shell > yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel

shell > ./configure \
--prefix=/usr/local/php-7.0. \
--enable-fpm \
--with-fpm-user=php \
--with-fpm-group==php \
--enable-exif \
--with-mcrypt \
--with-gd \
--enable-mbstring \
--enable-mysqlnd \
--enable-session \
--with-curl \
--enable-fastcgi \
--enable-xml \
--with-gd \
--with-iconv \
--with-zlib \
--enable-zip \
--with-openssl \
--with-mysql=shared,mysqlnd \
--with-mysqli=shared,mysqlnd \
--with-pdo-mysql=shared,mysqlnd \
上一篇:MVC和WebApi 使用get和post 传递参数。 转载https://blog.csdn.net/qq373591361/article/details/51508806


下一篇:HTTP协议详解--转载http://blog.csdn.net/gueter/article/details/1524447