Chinaunix首页 | 论坛 | 博客
  • 博客访问: 573368
  • 博文数量: 111
  • 博客积分: 3478
  • 博客等级: 中校
  • 技术积分: 1327
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-28 22:37
文章分类

全部博文(111)

文章存档

2013年(4)

2012年(57)

2011年(15)

2010年(7)

2009年(28)

分类: LINUX

2010-01-22 16:33:22

操作系统:Red Hat Enterprise Linux AS release 4 (Nahant Update 7)2.6.9-34.EL

软件版本:httpd-2.2.3.tar.gz

        mysql-5.0.18.tar.gz

        php-5.0.4.tar.gz

 

1安装mysql

         shell#tar xzvf mysql-5.0.15.tar.gz

              #解开安装包

 

         shell#cd mysql-5.0.1

         shell#./configrue --prefix=/usr/local/mysql  --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=all

         shell# make && make install

         shell#make install

               #进入安装目录,设置安装路径.编译并安装

 

         shell#groupadd mysql

         shell#useradd -g mysql mysql

              #新建名为mysql的组,并新建名为mysql的用户,并且默认属于mysql

 

         shell#chgrp -R mysql /usr/local/mysql

              #改变/usr/local/mysql及下属文件与目录的属组

 

         shell#cp support-files/my-large.cnf /etc/my.cnf

              #copymy-large.cnf /etc,替换原有的my.cnf

 

         shell#scripts/mysql_install_db

              #建立初始数据

 

         shell#chown -R mysql:mysql /usr/local/mysql/var

              #更改var及下面的文件目录的属组与属主

 

         shell#cp support-files/mysql.server /etc/init.d/mysqld

              #copymysql.serverinit.d目录中并重命名为mysqld,启动文件

 

         shell#chmod 755 /etc/init.d/mysqld

              #设置启动文件的权限有为755

 

         shell#chkconfig --add mysqld

         shell#chkconfig mysqld on

              #把此服务添加到系统启动中,add为添加至/etc/rc.d/init.d,on默认在3\5级别服务默认启动

           

         shell#/etc/init.d/mysqld start

         shell#/usr/local/mysql/bin/mysqld_safe &

                  启动myhsql

        

 

 

         shell#mysql –u root

         sql>grant all on *.* to root@”localhost” identified by “123456”;

        这样我们就可以用密码登录默认是空密码不安全的我们可以用密码登陆的

        mysql> grant select on test.* to 'hhf' @'%' identified by'hhf' with grant option;

               #添加一个名称为ttt,密码为tttmysql账户,test数据库有修改权限

     

         

2安装apache-2.2.3

         shell#tar xzvf httpd-2.2.3.tar.gz

         shell#cd httpd-2.2.3

         shell#./configure --prefix=/usr/local/apache --enable-so

         shell#make && make install

              #解包设置安装信息编译安装

        

         shell#cp /usr/local/apache/bin/apachectl /etc/init.d/httpd

              #把服务cp至启动文件中        

 

         shell#chmod 755 /etc/init.d/httpd

              #设置服务权限

 

 

3安装php

         shell#tar xvzf php-5.0.4.tar.gz

         shell#cd php-5.0.4

         shell#./configure --with-mysql=/usr/local/mysql --with-  apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/php

         shell#make && make instal

              #解包设置安装信息编译安装

 

         shell#echo AddType application/x-httpd-php .php >> /usr/local/apache/conf/httpd.conf

         shell#echo AddType application/x-httpd-php .sulpx >> /usr/local/apache/conf/httpd.conf

        shell#echo AddType application/x-httpd-php-source .phps >> /usr/local/apache/conf/httpd.conf

        shell#echo DirectoryIndex index.php index.html index.htm index.html.var >> /usr/local/apache/conf/httpd.conf

             #http.conf中加入对php的支持

 

shell#/usr/local/apache/bin/apachectl start

             #启动http

 

测试,/usr/local/apache/htdocs 下建一文件名为test.php,内容为:,然后在打开IE输入本机IP地址查看,如显示php页面,则建立成功

阅读(836) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~