Archive

Posts Tagged ‘CentOS5’

softlayer centos5主机mysql重新安装

February 27th, 2009 No comments

购买的centos5主机自带的mysql版本是5.0的,很老的版本。准备安装最新的mysql 6.0.首先删除原先mysql,执行yum remove mysql删除。到http://dev.mysql.com/downloads/mysql/6.0.html 

Compressed GNU TAR archive (tar.gz)   6.0.7-alpha 30.0M Download | Pick a mirror
MD5: 6db5cb7cbcbde8011d129e26091e3fe0 | Signature

下载6.0安装包,执行命令

wget  ftp://mirror.anl.gov/pub/mysql/Downloads/MySQL-6.0/mysql-6.0.7-alpha.tar.gz

解压tar vxzf mysql-6.0.7-alpha.tar.gz

进入目录  cd mysql-6.0.7-alpha

执行 ./configure –sysconfdir=/etc

然后make(时间比较久),

安装make install

安装完了之后,我们拷贝一个配置文件,当作以后mysql的配置文件
cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf

  • Share/Bookmark
Categories: centos Tags: , ,

在CentOS5下安装配置nginx+fastcgi php+mysql

December 21st, 2008 No comments

下载RPM包:

wget http://vpsblog.rashost.com/wp-content/uploads/2008/06/nginx-0631-2i386.rpm
rpm -ivh nginx-0631-2i386.rpm
chkconfig nginx on
/etc/init.d/nginx start

然后访问本机的80端口,就可以看到页面了,这表示安装一切正常。

修改/etc/nginx/nginx.conf文件中的server_name部分,修改IP地址为本机IP地址:

server_name 192.168.0.104;

修改/etc/nginx/nginx.conf文件的index部分,加入index.php

index index.php index.html index.htm;

安装php

wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/lighttpd-fastcgi-1.4.18-1.el5.rf.i386.rpm
wget ftp://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/lighttpd-1.4.18-1.el5.rf.i386.rpm
rpm -ivh lighttpd-*.i386.rpm # CentOS不自带lighttpd, 我们只好从别处下载,安装
chkconfig –del lighttpd #我们只用到lighttpd中的一个文件,不需要lighttpd开机自启动
yum install php-cgi php-mysql
spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u nginx -f /usr/bin/php-cgi
cd /usr/share/nginx/html/
echo “< ?phpinfo();?>” >i.php

然后修改/etc/nginx/nginx.conf文件的如下部分:

location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}

重启nginx:

/etc/init.d/nginx stop
/etc/init.d/nginx start

然后访问本机的i.php文件 http://192.168.1.104/i.php 应该能正确的到php的配置信息,这就成功了!

最后要注意的是,在CentOS下nginx的默认html目录是/usr/share/nginx/html,这个和ubuntu下不同

另外,为了让php cgi程序开机自启动,请在/etc/rc.local文件的最后加入下面这行:

spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u nginx -f /usr/bin/php-cgi

如转载,请注明转载自: http://vpsblog.rashost.com/20080602-centos-nginx-php/

  • Share/Bookmark
Categories: Php Tags: , ,