lnmp
2016-07-03 16:18
363 查看
1、操作系统
CentOSrelease6.5(final)
2、安装mysql
#yuminstallmysql-server
#vi/etc/my.cnf+default-character-set=utf8
#chkconfig--addmysqldchkconfig--level35mysqldon//开机启动查看#chkconfig--list|grepmysql*
#servicemysqldstop//停止restart//重启start//启动
#mysqladmin-urootpassword123456//设置管理员密码
#UPDATEuserSET`Host`='%'WHERE`User`='root'LIMIT1;FLUSHPRIVILEGES;//所有主机root连接
#vi/etc/sysconfig/iptables
增加:-AINPUT-mstate--stateNEW-mtcp-ptcp--dport3306-jACCEPT
#serviceiptablesrestart
3、安装nginx
先安装nginx的yum源
http://nginx.org/en/linux_packages.html#stable找到链接,安装:
#rpm-ivhhttp://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
查看:
#yuminfonginx
安装:
#yuminstallnginx
#servicenginxstart
默认配置:/etc/nginx/conf.d/
4、安装php
#wgethttp://cn2.php.net/get/php-5.6.23.tar.gz/from/this/mirror
#tar–zxvfphp-5.6.23.tar.gz
#yuminstallepel-release
或者
CentOSrelease6.5(final)
2、安装mysql
#yuminstallmysql-server
#vi/etc/my.cnf+default-character-set=utf8
#chkconfig--addmysqldchkconfig--level35mysqldon//开机启动查看#chkconfig--list|grepmysql*
#servicemysqldstop//停止restart//重启start//启动
#mysqladmin-urootpassword123456//设置管理员密码
#UPDATEuserSET`Host`='%'WHERE`User`='root'LIMIT1;FLUSHPRIVILEGES;//所有主机root连接
#vi/etc/sysconfig/iptables
增加:-AINPUT-mstate--stateNEW-mtcp-ptcp--dport3306-jACCEPT
#serviceiptablesrestart
3、安装nginx
先安装nginx的yum源
#rpm-ivh
查看:
#yuminfonginx
安装:
#yuminstallnginx
#servicenginxstart
默认配置:/etc/nginx/conf.d/
4、安装php
#wget
#tar–zxvfphp-5.6.23.tar.gz
#yuminstallepel-release
或者
#rpm-Uvh'target='_blank'>http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm[/code]
#yuminstallgccbisonbison-develzlib-devellibmcrypt-develmcryptmhash-developenssl-devellibxml2-devellibcurl-develbzip2-develreadline-devellibedit-develsqlite-devellibpng-devel
#cdphp-5.6.23
#./configure\
--prefix=/usr/local/php56\
--with-config-file-path=/usr/local/php56/etc\
--enable-inline-optimization\
--disable-debug\
--disable-rpath\
--enable-shared\
--enable-opcache\
--enable-fpm\
--with-fpm-user=nginx\
--with-fpm-group=nginx\
--with-mysql=mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--with-gettext\
--enable-mbstring\
--with-iconv\
--with-mcrypt\
--with-mhash\
--with-openssl\
--enable-bcmath\
--enable-soap\
--with-libxml-dir\
--enable-pcntl\
--enable-shmop\
--enable-sysvmsg\
--enable-sysvsem\
--enable-sysvshm\
--enable-sockets\
--with-curl\
--with-zlib\
--enable-zip\
--with-bz2\
--with-gd\
--with-freetype\
--with-readline#make-j8#makeinstall配置PHP配置文件:#cpphp.ini-development/usr/local/php56/etc/php.iniphp-fpm服务#cp/usr/local/php56/etc/php-fpm.conf.default/usr/local/php56/etc/php-fpm.conf#cpsapi/fpm/init.d.php-fpm/etc/init.d/php-fpm56#chmod+x/etc/init.d/php-fpm56启动php-fpm#servicephp-fpm56startStartingphp-fpmdonephp-fpm可用参数start|stop|force-quit|restart|reload|status添加PHP命令到环境变量编辑~/.bash_profile,将:PATH=$PATH:$HOME/bin改为:PATH=$PATH:$HOME/bin:/usr/local/php56/bin使PHP环境变量生效:#.~/.bash_profile查看看PHP版本#php-v
相关文章推荐
- CLion 2016.1.1 下载 附注册激活码 破解版方法
- Html & CSS 思维导图整理[JK原创]
- 关于Java中静态代码块以及构造函数的执行先后顺序
- poj3187
- 牛客网算法题之All-in-All
- vuejs动态组件给子组件传递数据
- django 多数据库
- MyBatis集合Spring(四)之使用Spring处理事务
- HTML、CSS、JavaScript判断 IE
- js获取子节点childNodes和children的区别
- Hibernate - DetachedCriteria 的完整用法(转)
- Linux考试易忘命令
- PHP性能优化-编译级别的缓存
- C++ linux线程安全单例Singleton
- 跟我一起学Multiple View Geometry多视图几何(4)
- BTrace系列之五:实现原理
- Java 集合系列18之 Iterator和Enumeration比较
- Android中如何解决Thread is already started问题
- androd 集成alipay
- HTML5