centos安装nginx php mysql redis mongodb 并配置kohana环境

安装nginx

43 wget http://nginx.org/download/nginx-1.9.9.tar.gz

44 tar -zxvf nginx-1.9.9.tar.gz

45 cd nginx-1.9.9

47 mkdir /work

48 ./configure --prefix=/work/nginx-1.9.9 --with-pcre

49 cd /work/

50 ls

51 cd /download/

52 cd nginx-1.9.9

53 yum install pcre-devel pcre bzip2* libcurl-devel libcurl libjpeg-devel libpng-devel gd-devel libmcrypt* bison gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel libtool-ltdl-devel*

54 ./configure --prefix=/work/nginx-1.9.9 --with-pcre

55 make

56 make install

57 cd /work/nginx-1.9.9/

59 ln -s nginx-1.9.9 nginx

60 cd nginx

63 ./sbin/nginx

73 vi /etc/sysconfig/iptables

-A INPUT -i lo -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

74 /etc/init.d/iptables restart

安装php

87 wget http://cn2.php.net/get/php-7.0.6.tar.gz/from/this/mirror -O php-7.0.6.tar.gz

82 wget http://cn2.php.net/get/php-5.6.21.tar.gz/from/this/mirror

84 mv mirror php-5.6.21.tar.gz

88 wget http://cn2.php.net/get/php-5.5.35.tar.gz/from/this/mirror -O php-5.5.35.tar.gz

89 tar -zxvf php-5.5.35.tar.gz

90 tar -zxvf php-5.6.21.tar.gz

100 wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz

101 tar -zxvf libmcrypt-2.5.7.tar.gz

102 cd libmcrypt-2.5.7

103 ./configure --disable-posix-threads

104 make && make install

5.6

105 cd ../php-5.6.21

106 ./configure --prefix=/work/php-5.6.21 --enable-fpm --enable-bcmath --with-gd --enable-gd-native-ttf --with-gd --with-png-dir --with-curl --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --enable-soap --with-pear=PREFIX/pear --enable-gd-native-ttf --enable-mbstring --enable-exif --disable-cgi --enable-cli --with-jpeg-dir --enable-bcmath --enable-sockets --disable-ipv6 --with-mcrypt --with-mysql=mysqlnd --enable-mysqlnd --with-mysqli=mysqlnd --enable-embedded-mysqli --enable-embedded-mysqli --disable-mysqlnd-compression-support --with-pdo-mysql=mysqlnd

107 make && make install

5.5

39 cd php-5.5.35

40 ./configure --prefix=/work/php-5.5.35 --enable-fpm --enable-bcmath --with-gd --enable-gd-native-ttf --with-mysql=mysqlnd --with-gd --with-png-dir --with-curl --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --enable-soap --with-pear=PREFIX/pear --enable-gd-native-ttf --enable-mbstring --enable-exif --disable-cgi --enable-cli --with-jpeg-dir --enable-bcmath --enable-sockets --disable-ipv6 --with-mcrypt --enable-mysqlnd --with-mysqli=mysqlnd --enable-embedded-mysqli --enable-enmbedded-mysqli --disable-mysqlnd-compression-support --with-pdo-mysql=mysqlnd

41 make && make install

5.3

./configure --prefix=/work/php-5.3.29 --enable-fpm --enable-bcmath --with-gd --enable-gd-native-ttf --with-mysql=mysqlnd --with-gd --with-png-dir --with-curl --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --enable-soap --with-pear=PREFIX/pear --enable-gd-native-ttf --enable-mbstring --enable-exif --disable-cgi --enable-cli --with-jpeg-dir --enable-bcmath --enable-sockets --disable-ipv6 --with-mcrypt --enable-mysqlnd --with-mysqli=mysqlnd --enable-embedded-mysqli --enable-embedded-mysqli --disable-mysqlnd-compression-support --with-pdo-mysql=mysqlnd

7.0

37 tar -zxvf php-7.0.6.tar.gz

38 cd php-7.0.6

40 ./configure --prefix=/work/php-7.0.6 --enable-fpm --enable-bcmath --with-gd --enable-gd-native-ttf --with-gd --with-png-dir --with-curl --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --enable-soap --with-pear=PREFIX/pear --enable-gd-native-ttf --enable-mbstring --enable-exif --disable-cgi --enable-cli --with-jpeg-dir --enable-bcmath --enable-sockets --disable-ipv6 --with-mcrypt --enable-mysqlnd --with-mysqli=mysqlnd --enable-embedded-mysqli --enable-embedded-mysqli --disable-mysqlnd-compression-support --with-pdo-mysql=mysqlnd

41 make && make install

配置nginx+php5.6

123 cd /download/php-5.6.21/

124 php -i | grep 'php.ini'

125 find . -name 'php.ini*'

126 cp php.ini-development /work/php-5.6.21/lib/php.ini

127 vi /work/php-5.6.21/lib/php.ini

date.timezone = PRC

130 cd /work/

131 mkdir wwwroot

132 mv wwwroot code

133 cd code/

134 mkdir localhost

135 cd ..

136 cd nginx/conf

138 cp nginx.conf nginx.confbak

139 vi nginx.conf

user nobody;

worker_connections 32;

location / { | location / {

root /work/code/localhost

location ~ \.php { \| #location \~ \\.php {

root /work/code/localhost; | # root html;

fastcgi_pass 127.0.0.1:9000; | # fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php; | # fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME document_rootfastcgi_script_n| # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;

include fastcgi_params; | # include fastcgi_params;

}

142 /work/php-5.6.21/sbin/php-fpm

143 cp /work/php-5.6.21/etc/php-fpm.conf.default /work/php-5.6.21/etc/php-fpm.conf

144 /work/php-5.6.21/sbin/php-fpm

145 /work/nginx/sbin/nginx -s reload

146 cd /work/code/localhost/

147 vi index.html

148 vi phpinfo.php

开机启动nginx php-fpm

root@localhost \~\]# vi /etc/rc.local /work/nginx/sbin/nginx /work/php-5.6.21/sbin/php-fpm 安装mysql 156 yum install mysql mysql-server 157 /etc/init.d/mysqld start 158 chkconfig mysqld on 159 mysql_secure_installation 160 mysql -uroot -p 161 /etc/init.d/mysqld restart -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT mysql\> grant all privileges -\> on \*.\* to [email protected] identified by '111111'; 安装redis 安装mongodb 配置kohana nginx配置, 支持kohana server { listen 80; server_name kohana; root /cygdrive/d/github/kohana; location / { index index.php; try_files $uri $uri/ /index.php?$uri\&$args; } location \~ \\.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } } *** ** * ** *** CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL) http://www.jb51.net/article/37986.htm 年终福利,PHP7+Apache2.4+MySQL5.6 源码编译安装,环境配置,搭建你自己的LAMP环境, [http://www.bkjia.com/Linuxjc/1096474.html](http://www.bkjia.com/Linuxjc/1096474.html "http://www.bkjia.com/Linuxjc/1096474.html") 配置开机自动启动Nginx + PHP http://blog.chinaunix.net/uid-20178201-id-3070174.html

相关推荐
2501_911121231 小时前
Nginx+Tomcat 负载均衡群集
nginx·tomcat·负载均衡
小鱼小鱼.oO11 小时前
阿里云服务器安装nginx并配置前端资源路径(前后端部署到一台服务器并成功访问)
服务器·nginx·阿里云
广东数字化转型14 小时前
nginx怎么使用nginx-rtmp-module模块实现直播间功能
linux·运维·nginx
啵啵学习14 小时前
Linux 里 su 和 sudo 命令这两个有什么不一样?
linux·运维·服务器·单片机·ubuntu·centos·嵌入式
Yungoal15 小时前
php & apache构建 Web 服务器
服务器·php·apache
浩浩测试一下16 小时前
Authpf(OpenBSD)认证防火墙到ssh连接到SSH端口转发技术栈 与渗透网络安全的关联 (RED Team Technique )
网络·网络协议·tcp/ip·安全·网络安全·php
孤寂大仙v17 小时前
【计算机网络】网络层IP协议与子网划分详解:从主机通信到网络设计的底层逻辑
tcp/ip·计算机网络·php
龙仔72518 小时前
华为云CentOS配置在线yum源,连接公网后,逐步复制粘贴,看好自己对应的版本即可,【新手必看】
linux·centos·华为云
tiging18 小时前
centos实现SSH远程登录
linux·centos·ssh
vortex521 小时前
浅谈 Linux 防火墙:从原理到实践
linux·网络·php