当前位置: > CentOS > CentOS服务器 > 环境配置 >

Centos上安装tengine+php+mysql+wordpress

时间:2015-03-15 02:01来源:linux.it.net.cn 作者:IT

一、tengine

 


 
  1. wget tengine.taobao.org/download/tengien-2.1.0.tar.gz  
  2. tar xf tengine-2.1.0.tar.gz  
  3. cd tengine-2.1.0  
  4. yum install pcre-devel openssl-devel jemalloc-devel -y  
  5. ./configure --prefix=/usr/local/nginx --user=nobody --group=nobody --with-http_stub_status_module --without-http-cache --with-http_ssl_module --with-http_gzip_static_module --with-http_concat_module --with-jemalloc  

 
  1. ln -s /usr/local/nginx/sbin/nginx /usr/sbin/nginx  

 
  1. nginx  

 

二、php

 

 


 
  1. yum install php php-fpm php-gd php-mbstring php-mcrypt php-mysql -y  

 
  1. cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.bk  

 
  1. sed -i -r "s/(user|group)\ =.*/\1 = nobody/g" /etc/php-fpm.d/www.conf  
 
  1. /etc/init.d/php-fpm start  

 

三、mysql

 


 
  1. yum install mysql mysql-server -y  

 
  1. service mysqld start  

 
  1. /usr/bin/mysql_secure_installation(第一次回车,第二次输入Y回车,再输入两次数据root用户的密码,第三次输入Y回车以移除匿名用户,第四次输入Y回车以禁止root远程登录数据库,第五次输入Y回车以移除测试数据库,第六次输入Y回车以立即刷新权限)  

 
  1. mysql -u root -p(输入root的密码)  

 
  1. create database wordpress;(创建一个名为wordpress的数据库)  

 
  1. grant all privileges on wordpress.* to "newusername"@"localhost" identified by "newpassword";(创建一个用户名为"newusername"密码为"newpassword"的用户,并赋予该用户操作数据库"wordpress"的所有权限,并赋予该用户本地登录数据库的权利)  

 
  1. flush privileges;(刷新权限分配)  

 
  1. quit;(退出数据库)  

 

四、wordpress


 
  1. cd /usr/local/nginx/html  
  2. wget wordpress.org/latest.tar.gz  
  3. tar xf latest.tar.gz  
  4.  






(责任编辑:IT)
------分隔线----------------------------