查看完整版本: apache2+php5+mysql4 安装配置 AS4

43005198 2007-7-11 22:31

apache2+php5+mysql4 安装配置 AS4

<P>From <A href="http://www.xjtusky.com/article.asp?id=49"><FONT color=#0240a3>http://www.xjtusky.com/article.asp?id=49</FONT></A><BR>&nbsp;平台:RedHat LINUX AS4<BR>版本:httpd-2.0.54<BR>PHP-5.0.4<BR>MYsql4.0.24<BR><BR>1、安装目录<BR>MYSQL /usr/local/mysql<BR>APACHE /usr/local/apache2<BR><BR>2、MYSQL安装<BR># groupadd mysql <BR># useradd mysql -g mysql -M -s /bin/false <BR># cd /usr<BR># tar zxvf mysql-4.0.24.tar.gz<BR># cd /mysql-4.0.24<BR># ./configure --prefix=/usr/local/mysql \ 指定安装目录 <BR>--with-client-ldflags=-all-static \ <BR>--with-mysqld-ldflags=-all-static \以纯静态方式编译服务端和客户端<BR># make \要15分钟左右,如果电脑差的话可能会更长<BR># make install <BR># scripts/mysql_install_db \生成mysql用户数据库和表文件<BR># cp support-files/my-medium.cnf /etc/my.cnf \copy配置文件,有large,medium,small三个环境下的,根据机器性能选择,如果负荷比较大,可修改里面的一些变量的内存使用值 <BR># cp support-files/mysql.server /etc/init.d/mysqld \copy启动的mysqld文件<BR># chmod 700 /etc/init.d/mysqld <BR><BR>#cd /usr/local<BR># chmod 750 mysql -R <BR># chgrp mysql mysql -R \更改文件所属的组<BR># chown mysql mysql/var -R \如果没有这个目录可以mkdir mysql/var<BR># cd /usr/local/mysql/libexec <BR># cp mysqld mysqld.old <BR># strip mysqld \删除可执行程序中的调试信息<BR># chkconfig --add mysqld <BR># chkconfig --level 345 mysqld on <BR># service mysqld start <BR># netstat -atln <BR>看看有没有3306的端口打开,如果mysqld不能启动,看看/web/mysql/var下的出错日志,一般都是目录权限没有设置好的问题 <BR># ln -s /usr/local/mysql/bin/mysql /sbin/mysql <BR># ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin <BR># mysqladmin -u root password "youpassword" #设置root帐户的密码 <BR># mysql -u root -p <BR># 输入你设置的密码 <BR>mysql&gt;use mysql; <BR>mysql&gt;delete from user where password=""; #删除用于本机匿名连接的空密码帐号 <BR>mysql&gt;flush privileges; <BR>mysql&gt;quit <BR><BR>安装MYSQL完成<BR><BR>3、安装APAHCE2(HTTP)\这步相对简单<BR><BR>#cd /usr<BR>#tar ?zxvf /home/server/httpd-2.0.54.tar.gz<BR>#./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-module-so --enable-ssl<BR>#make <BR>#make install <BR>编译安装完成后,启动apache <BR>#cd /usr/local/apache2/bin<BR>#./apachectl start <BR>这样就启动了apache服务器<BR><BR>4、安装PHP<BR><BR># cd /usr<BR># tar -zxvf /home/server/php-5.0.4.tar.gz<BR># cd php-5.0.4<BR>#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/lib --enable-track-vars --with-xml<BR># make<BR># make install <BR>安装完成的,修改apache的配置文件httpd.conf<BR>在相应的位置加入以下语句: </P>
<DIV class=code>AddType application/x-httpd-php .php <BR>AddType application/x-httpd-php-source .phps <BR>AddType application/x-httpd-php .php3 </DIV>
<P>重启apache即可;<BR>测试PHP<BR>编写 info.php文件,内容如下: </P>
<DIV class=code>&lt;?php<BR>phpinfo();<BR>?&gt;</DIV>
<P>将其存放在apache的文档路径下,在浏览器中输入:<BR><A title=http://127.0.0.1/info.php href="http://127.0.0.1/info.php" target=_blank><FONT color=#0240a3>http://127.0.0.1/info.php</FONT></A><BR>即可看到php 的配置信息,如果报错,请先查看该文件的权限设置,如果不行则查看日志<BR><BR>apache的开机自动启动:<BR>#cd /etc/rc.d/init.d<BR>#ln -s /usr/local/apache/bin/apachectl httpd<BR>chmod 700 httpd<BR>vi httpd<BR>把文件头的部分的chkconfig 和 description改成:<BR># chkconfig: 2345 10 90<BR># description: Activates/Deactivates Apache Web Server<BR><BR>最后,运行chkconfig把Apache添加到系统的启动服务组里面:<BR><BR># /sbin/chkconfig --del httpd<BR># /sbin/chkconfig --add httpd&nbsp;<!--StartFragment --> </P>

[[i] 本帖最后由 43005198 于 2007-7-11 22:32 编辑 [/i]]

xjw520 2007-7-24 10:56

谢谢楼主分享

学习中~

ppen 2007-8-3 15:51

也在搞一个测试的网络CRM,正好可以试试看了。

gongyiyi 2007-9-14 17:45

一直没有试过linux,  什么时候心血来潮试试看:lol:

南国紫藤 2007-9-19 13:39

我也想要,可是怎么没看到下载

dwg520 2007-10-29 20:50

只是文章没有视频的?
页: [1]
查看完整版本: apache2+php5+mysql4 安装配置 AS4