升级yum源
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/i386/ius-release-1.0-11.ius.centos6.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/i386/epel-release-6-5.noarch.rpm
rpm -ivh epel-release-6-5.noarch.rpm
rpm -ivh ius-release-1.0-11.ius.centos6.noarch.rpm
yum update
yum install nginx mysql55-server php53-dom php53-fpm php53-mysql php53-mbstring php53-mcrypt php53-cli
配置php
cd /etc/php-fpm.d
vi www.conf
vi php-fpm.conf
启动php-fpm
/etc/init.d/php-fpm start
查看是否启动,应该启用了9000端口
netstat –an
停止系统自带的apache:
/etc/init.d/httpd stop
查看80端口是否被占用
netstat -an
配置mysql,第一步是查看默认的mysql数据库存放位置和mysql_install_db所在处
vi /etc/init.d/mysqld
默认在/usr/bin
cd /usr/bin
初始化mysql
./mysql_install_db
注意,这句应该出个failed,因为还没有做mysql的权限处理
/etc/init.d/mysqld start
赋于mysql系统表的权限
chown -R mysql:mysql /var/lib/mysql/
再次启动mysql,应该出on了
/etc/init.d/mysqld start
查看端口,应该启用了3360,或者是存在mysql.socket
netstat -an
修改默认的root密码:
/usr/bin/mysqladmin -u root password 'abcdef123456'
登录测试一下:
mysql -uroot -p
下载并解压phpmyadmin
wget http://jaist.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.2.3/phpMyAdmin-4.2.3-all-languages.tar.gz
tar -xzvf phpMyAdmin-4.2.3-all-languages.tar.gz
安装xcache模块,如果喜欢用VPC或memcached,可以直接用yum install php53-memcached或yum install php53-vpc,我习惯用国产的xcache:
wget http://xcache.lighttpd.net/pub/Releases/3.1.0/xcache-3.1.0.tar.gz
tar -xzvf xcache-3.1.0.tar.gz
cd xcache-3.1.0
phpize
不要忘了安装gcc
yum install gcc
./configure
make
make install
复制xcache.ini,这样才能启作用
cp xcache.ini /etc/php.d/
vi /etc/php.d/xcache.ini
检查一下xcache是否已经启用
php -m
重启php-fpm:
/etc/init.d/php-fpm restart
nginx配置,这个就简单多了:
vi /etc/nginx/conf.d/default.conf
/etc/init.d/nginx start
netstat –an
最后,别忘了设置为自启动,否则重启用要手动启动这些程序了:
chkconfig --level 3 sendmail off
chkconfig --level 3 httpd off
chkconfig --level 3 php-fpm on
chkconfig --level 3 mysqld on
chkconfig --level 3 nginx on
该贴被wulcan编辑于2014-6-20 8:28:24
该贴由hui.chen转至本版2014-11-5 17:04:58