标签:进程 partition art too mat enable systemctl 创建 sof
mysql版本:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.30.tar.gz /home/
准备工作,安装依赖库
关闭防火墙
Redirecting to /bin/systemctl stop iptables.service
service iptables stop
安装环境需要的依赖:
yum -y install gcc automake autoconf libtool make gcc-c++ glibc libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel pcre pcre-devel libmcrypt libmcrypt-devel cmake swoole
1.安装nginx
第一步:下载nginx到指定目录
nginx版本: wget http://nginx.org/download/nginx-1.8.1.tar.gz /usr/local/src
第二步:解压安装:
tar xf nginx-1.8.1.tar.gz
cd nginx-1.8.1
//创建用户www和用户组www
groupadd www
useradd -g www www
./configure --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module
make && make install
nginx安装成功,启动报以下错误表示端口被占用,使用lsof -i:80查看谁占用了80端口并用kill -9 进程号杀死
启动nginx:
cd /usr/sbin
./nginx
2.安装php
第二步:下载php:
php版本:php-7.0.21.tar.gz
第二步:解压安装:
tar -zxvf php-7.0.21.tar.gz
cd php-7.0.21/
./configure --prefix=/usr/local/php --with-curl --with-bz2 --with-zlib --with-mhash --with-pcre-regex --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-openssl --with-pdo-mysql --with-libxml-dir --with-freetype-dir --with-iconv --enable-opcache --enable-bcmath --enable-ftp --enable-shmop --enable-fpm --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-calendar --enable-zip --enable-mbstring --enable-pdo
make && make install
// 配置php-fpm
cd /usr/local/php/etc
cp php-fpm-default.conf php-fpm.conf
//修改php-fpm.conf vim php-fpm.conf
将;pid = run/php-fpm.pid 前面的分号删掉
cd /usr/local/php/etc/php-fpm.d/
cp www.conf.default www.conf
cp /usr/local/src/php-7.0.21/php.ini-production /usr/local/php/lib/php.ini
//拷贝php-fpm脚本至/etc/init.d目录
cp /usr/local/src/
php-7.0.21
/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
//设置权限并启动php-fpm:
chmod 755 /etc/init.d/php-fpm
/etc/init.d/php-fpm start
//最后,给出php-fpm以服务的方式启动、停止和重启:
service php-fpm start
service php-fpm stop
service php-fpm reload
配置支持php
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
重启nginx /usr/sbin/nginx -s reload
启动nginx /usr/sbin/nginx
停止nginx /usr/sbin/nginx -s stop
3.安装mysql
tar -zxvf mysql-5.6.30.tar.gz
cd mysql-5.6.30/
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
安装完成
安装依赖bison和ncurses-devel否则下面会报错
make && make install
mysql正式安装完成
标签:进程 partition art too mat enable systemctl 创建 sof
原文地址:http://www.cnblogs.com/caiji/p/7261125.html