CentOS6.5 LNMP环境搭建
来源:互联网 发布:帕森斯火箭数据 编辑:程序博客网 时间:2024/04/29 19:00
CentOS6.5 配置好IP后,开始LNMP环境配置。
1,添加repo源
rpm --import https://fedoraproject.org/static/0608B895.txt
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install yum-priorities
编辑 /etc/yum.repos.d/epel.repo...
vi /etc/yum.repos.d/epel.repo
... and add the line priority=10 to the [epel] section:
[epel]name=Extra Packages for Enterprise Linux 6 - $basearch#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearchmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearchfailovermethod=priorityenabled=1priority=10gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6[...]
Then do the same for the [remi] section in /etc/yum.repos.d/remi.repo, plus change enabled to 1:
编辑remi
vi /etc/yum.repos.d/remi.repo
[remi]name=Les RPM de remi pour Enterprise Linux $releasever - $basearch#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirrorenabled=1priority=10gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remifailovermethod=priority
2, Installing MYSQL 5
yum install mysql mysql-server
chekconfig --levels 235 mysqld on
service mysqld start
检查
netstat -tap | grep mysql
It should show something like this:
[root@server1 ~]# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 1279/mysqld
[root@server1 ~]#
mysql_secure_installation
3,Installing Nginx
yum install nginx
chkconfig --level 235 nginx on
service nginx start
如果自带了apache 先删除
apachectl stop
yum remove httpd
chkconfig --level 235 httpd off
chekconfig --levels 235 nginx on
service nginx start
打开浏览器输入IP看看是否显示welconme to nginx
如果未显示,设置开放80端口
vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
service iptables restart
4,Installing PHP5
yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy
yum install php-pecl-apc
vi /etc/php.ini
cgi.fix_pathinfo=1
date.timezone = "Asia/Shanghai"
chkconfig --levels 235 php-fpm on
service php-fpm start
5,Configuting nginx
vi /etc/nginx/nginx.conf
[...]worker_processes 4;[...] keepalive_timeout 2;[...]
mkdir /usr/wwwroot
vi /etc/nginx/conf.d/default.conf
service nginx reload
vi /usr/wwwroot/info.php
6,
Making PHP-FPM Use A Unix Socket
By default PHP-FPM is listening on port 9000 on 127.0.0.1. It is also possible to make PHP-FPM use a Unix socket which avoids the TCP overhead. To do this, open /etc/php-fpm.d/www.conf...
vi /etc/php-fpm.d/www.conf
... and make the listen line look as follows:
[...];listen = 127.0.0.1:9000listen = /tmp/php5-fpm.sock[...]
service php-fpm reload
vi /etc/nginx/conf.d.default.conf
service nginx reload
- CentOS6.5 LNMP环境搭建
- CentOS6.5搭建LNMP环境
- yum搭建lnmp环境(CentOS6.5)
- Centos6.5下源码搭建lnmp环境
- centos6.5下搭建lnmp环境
- Centos6.5 LNMP环境、git服务器搭建
- yum搭建lnmp环境(CentOS6)
- CentOS6.3搭建lnmp环境
- yum搭建lnmp环境(CentOS6)
- yum搭建lnmp环境(CentOS6)
- CentOS6.6搭建LNMP环境
- CentOS6.6搭建LNMP环境
- CentOS6.3搭建lnmp环境
- CentOS6.7搭建LNMP环境
- CentOS6.8搭建LNMP环境
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- CentOS6.5搭建LNMP
- IOS数组无法添加数据
- 如何设置一台电脑双网卡双线上网
- linux文件系统命令(3)---mount和umount
- ios开发UI篇—使用纯代码自定义UItableviewcell实现一个简单的微博界面布局
- GRIN光学器件,非线性光学
- CentOS6.5 LNMP环境搭建
- IT忍者神龟之LDAP 入门知识
- struts+hibernate增删改查(一)
- 深入JVM的OOM
- [Android widget] 导入library后,android private library消失
- 简单的malloc,free实现函数
- struts+hibernate增删改查(二)
- [gevent源码分析] libev cython绑定core.pyx
- 课程设计报告,简单的银行管理系统