码迷,mamicode.com
首页 > 数据库 > 详细

LNMP-GNINX1.8.1-MYSQL5.6.27-PHP

时间:2018-03-22 15:31:37      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:default   hash   ges   public   sys   pre   vim   with   load   

##############nginx##############
yum install pcre-devel zlib-devel -y
useradd -M -s /sbin/nologin nginx
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar xf nginx-1.8.1.tar.gz -C /usr/src/
cd /usr/src/nginx-1.8.1/
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module && make && make install
ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/
nginx -t && nginx
netstat -anpt | grep 80
 
##############mysql##############
yum install ncurses-devel gcc gcc-c++ -y
cd
tar xf  cmake-2.8.6.tar.gz -C  /usr/src/
cd /usr/src/cmake-2.8.6/
./configure && gmake && gmake install
cd
wget http://mirror.neu.edu.cn/mysql/Downloads/MySQL-5.6/mysql-5.6.27.tar.gz
groupadd mysql && useradd -M -s /sbin/nologin mysql -g mysql
tar xf mysql-5.6.27.tar.gz -C /usr/src/
cd /usr/src/mysql-5.6.27/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all
make && make install
chown -R mysql.mysql /usr/local/mysql/
rm -f /etc/my.cnf
cp -f support-files/my-default.cnf /etc/my.cnf
/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
. /etc/profile
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
service mysqld start
####mysql允许远程#####
#####GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘EdenMysql197‘ WITH GRANT OPTION;#####
#####FLUSH PRIVILEGES; #####
##############php##############
rpm -e php php-cli php-ldap php-common php-mysql --nodeps
yum install zlib-devel libxml2-devel -y
cd
wget https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar xf libmcrypt-2.5.8.tar.gz -C /usr/src/
cd /usr/src/libmcrypt-2.5.8/
./configure && make && make install
cd
ln -s /usr/local/lib/libmcrypt.* /usr/lib/
wget https://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
tar xf mhash-0.9.9.9.tar.gz -C /usr/src/
cd /usr/src/mhash-0.9.9.9/
./configure && make && make install
ln -s /usr/local/lib/libmhash.* /usr/lib/
cd
wget https://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
c
cd /usr/src/mcrypt-2.6.8/
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
./configure && make && make install
cd
wget https://sourceforge.net/projects/libpng/files/libpng14/older-releases/1.4.3/libpng-1.4.3.tar.gz
tar xf libpng-1.4.3.tar.gz -C /usr/src/
cd /usr/src/libpng-1.4.3/
./configure && make && make install
cd
wget https://sourceforge.net/projects/freetype/files/freetype2/2.4.0/freetype-2.4.0.tar.gz
tar xf freetype-2.4.0.tar.gz -C /usr/src/
cd /usr/src/freetype-2.4.0/
./configure && make && make install
cd
cd /usr/src/jpeg-8b/
./configure --enable-shared && make && make install
cd
wget http://am1.php.net/distributions/php-5.6.21.tar.gz
tar xf php-5.6.21.tar.gz -C /usr/src/
cd /usr/src/php-5.6.21/
./configure --prefix=/usr/local/php5 --with-mcrypt --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php5 --enable-mbstring --with-gd --with-jpeg-dir=/usr/local/jpeg --with-zlib --with-png --with-freetype-dir=/usr/include/freetype2/freetype --enable-fpm --with-mysql=shared,mysqlnd
make && make install
cp /usr/src/php-5.6.21/php.ini-production /usr/local/php5/php.ini
cd /usr/local/php5/etc/
cp php-fpm.conf.default php-fpm.conf
useradd -M -s /sbin/nologin php
vim php-fpm.conf
pid = run/php-fpm.pid
user = php
group = php
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_children = 50
ln -s /usr/local/php5/sbin/php-fpm /usr/local/sbin/
php-fpm
netstat -anpt | grep php-fpm
vim /usr/local/nginx/conf/nginx.conf
location ~ \.php$ {
root    /usr/local/nginx/html/;
fastcgi_pass    127.0.0.1:9000;
fastcgi_index   index.php;
include         fastcgi.conf;
}
#firewall-cmd --zone=public --add-port=80/tcp --permanent
#firewall-cmd --reload

LNMP-GNINX1.8.1-MYSQL5.6.27-PHP

标签:default   hash   ges   public   sys   pre   vim   with   load   

原文地址:https://www.cnblogs.com/lupen/p/8624002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!