轻松搞定CentOS+Nginx+PHP+MySQL标准生产环境
PHP 5.3.1 MySQL 5.0.89 Nginx 0.8.33 或 0.7.65 (可选) 这个可比网上流传的什么一键安装包要好得多,强烈推荐此法安装,适合所有菜鸟和高手。我服务器上全用的源代码编译安装,也好不到哪 ...
??? PHP 5.3.1
??? MySQL 5.0.89
??? Nginx 0.8.33 或 0.7.65 (可选)
??? 这个可比网上流传的什么一键安装包要好得多,强烈推荐此法安装,适合所有菜鸟和高手。我服务器上全用的源代码编译安装,也好不到哪去,还很费劲。我这个装完已经包含 php 的一些常用扩展, PDO,eaccelerator,memcache,tidy等等。
??? CentOS 最小化安装,然后先新建一个 repo
??? # vi /etc/yum.repos.d/centos.21andy.com.repo
??? 放入如下内容
??? [21Andy.com]
??? name=21Andy.com Packages for Enterprise Linux 5 - $basearch
??? baseurl=http://www.21andy.com/centos/5/$basearch/
??? enabled=1
??? gpgcheck=0
??? protect=1
??? 启用 EPEL repo
??? CentOS i386 输入如下命令 (如果不知道系统是多少位的 用 uname -a 命令查看 )
??? rpm -ihv?http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
??? CentOS x86_64 输入如下命令
??? rpm -ihv?http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
??? 然后导入key
??? rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
??? 复制代码
??? OK,一键安装吧
??? yum -y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator
执行上面命令出现如下提示 可能是网络的问题(我的是未设置代理)
Loaded plugins: fastestmirror
Determining fastest mirrors
代理设置方法:修改 /etc/yum.conf ,http代理加入下面这一行 ,proxy=http://IP地址:端口
??? 最后 yum -y update 一下,全是最新的
??? 如果 nginx 你要用 0.7.65 最新稳定版,把
??? yum -y install nginx
??? 换成
??? yum -y install nginx-stable
??? 就可以了
??? 装完你已经可以这样玩了
??? service mysqld start
??? service php-fpm start
??? service nginx start
??? 别忘了设置开机启动
??? chkconfig --level 345 mysqld on
??? chkconfig --level 345 php-fpm on
??? chkconfig --level 345 nginx on
??? 配置文件都在 /etc 下自己找
??? 看看安装多自动
?
??? 作者:21Andy 来源:Andy's Blog
? ? 感谢作者分享 摘自?http://www.hackbase.com/tech/2010-02-25/59365.html
?