码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS6.5搭建LNMP环境

时间:2016-06-29 22:03:07      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

配置防火墙

vi /etc/sysconfig/iptables

-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT 
-A INPUT -p icmp -j ACCEPT -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 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8082 -j ACCEPT 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT 
-A INPUT -j REJECT --reject-with icmp-host-prohibited 
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

/etc/init.d/iptables restart

二、编译安装Nginx

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel
wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
./configure
make && make install

yum install -y gcc gcc-c++

wget http://nginx.org/download/nginx-1.6.2.tar.gz
./configure --prefix=/usr/local/nginx --without-http_rewrite_module
--without-http_gzip_module
make && make install
/usr/local/webserver/nginx/sbin/nginx -v
/usr/local/webserver/nginx/sbin/nginx
ps -ef|grep nginx

wget http://cn2.php.net/distributions/php-5.6.0.tar.xz

#添加组
groupadd www
#添加php-fpm用户
useradd -c php-fpm-user -g www -M php-fpm
 



 



CentOS6.5搭建LNMP环境

标签:

原文地址:http://www.cnblogs.com/wangwanchao/p/5628118.html

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