nginx php 编译安装mysql_编译安装nginx+php+mysql

nginx-1.8.1下载地址http://nginx.org/download/nginx-1.8.1.tar.gz

yum install gcc gcc-c++ automake pcre pcre-devel zlip zlib-devel openssl openssl-devel

./configure --user=nginx --group=nginx --prefix=/usr/local/nginx  --with http_gzip_static_module --with-http_stub_status_module  --with-http_ssl_module

make && make install

/usr/local/nginx/sbin/nginx                      //启动nginx

/usr/local/nginx/sbin/nginx -t                   //检查nginx配置文件

/usr/local/nginx/sbin/nginx -v                   // 查看版本

/usr/local/nginx/sbin/nginx -V                   // 查看编译参数

/usr/local/nginx/sbin/nginx -s reload            // 重新载入配置文件

/usr/local/nginx/sbin/nginx -s reopen            // 重启 Nginx

/usr/local/nginx/sbin/nginx -s stop             // 停止 Nginx

https://dev.mysql.com/downloads/mysql/5.6.html#downloads

解压后复制到/usr/local/mysql

useradd mysql

chown -R mysql:mysql mysql/

chmod -R 777 mysql/

./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --user=mysql

cd mysql/support-files/

cp mysql.server /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig mysqld on

[root@VM_21_183_centos mysql]# cat /etc/my.cnf

[mysqld]

datadir=/usr/local/mysql/data

basedir=/usr/local/mysql

socket=/tmp/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

/etc/init.d/mysqld start

php-5.5.38下载地址http://cn.php.net/distributions/php-5.5.38.tar.gz

yum install libxml2-devel bzip2-devel libxml2

yum install libjpeg libpng freetype libjpeg-devel libpng-devel freetype-devel -y

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath

make && make install

cp php.ini-production /usr/local/php/etc/php.ini

ln -s /usr/local/php/etc/php.ini /etc/php.ini

chmod 775 -R php

chown nginx:nginx -R php

vi /usr/local/php/etc/php-fpm.conf #编辑

user = nginx #设置php-fpm运行账号为nginx

group = nginx #设置php-fpm运行组为nginx

pid = run/php-fpm.pid#取消前面的分号

忘记安装GD了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值