jackylau 回复于:2003-12-22 18:58:00 |
因为php简单。应用服务器比如tomcat,专门解析jsp. 而web,如apache,解析除html,htm之类以外所有的服务。
你的系统为solaris,要运行web,若脚本是php,可以直接在solaris下建好环境(apache+php),若脚本是jsp,可以用apache+tomcat,具体看下面的。若有什么问题可以发站内短信。 apache1.3.26+solaris5.7+mysql4.0.14+php4.3.2 分别到www.apache.org,www.mysql.com,www.php.net下载相应的源代码 分别装上一些GNU的小东东:perl,tar,gzip,gclearcase/" target="_blank" >cc, libstdc, #gunzip *.gz #tar –xvf apache_1.3.26,mysql4.0.1,php4.3.2 #PATH=/bin:/usr/bin:/usr/sbin:/etc/:/usr/local/bin:/usr/ccs/bin #cd /mysql.4.3.2 #which perl(检查你系统的perl的位置,若为/bin/perl) #cd tests把这个目录中所有以pl结尾的文件的perl解释器的位置改为#!/bin/perl #CC=gcc CFLAGS="-O6" CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" CFLAGS=-DHAVE_CURSES_H CXXFLAGS=-DHAVE_CURSES_H ./ configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-charset=gbk --with-extra-charsets=all #make ;make install # #cd apache-1.3.26 #./configure –-prefix=/usr/local/httpd #cd ../php4.3.2 #./configure –with-mysql=/usr/local/mysql –with-apache=../apache-1.3.26 –with-enable-track-vars #make #make install #cd apache-1.3.26 #./configure –prefix=/usr/local/httpd –activate-module=src/modules/php4/libmodphp4.a #make #make install #make clean 4.配置Apache + MySQL + PHP 首先,需要在 /etc/profile 或 .profile 中加入以下两行,并在 /usr/local/mysql/share/mysql/mysql.server 的开头处也加如这两行: LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH 安装 MySQL 的初始数据库: #cp /usr/local/lib/libstdc++.so.2.10.0 /usr/local/mysql/lib/mysql/ #cd /usr/local/mysql/bin #./mysql_install_db #cd /usr/local/mysql/share/mysql #./mysql.server start 测试MYSQL #cp /usr/local/mysql/share/mysql/mysql.server /bin/mysql # cd /usr/local/mysql/bin/ # ./mysqld_safe --user=mysql Starting mysqld daemon with databases from /usr/local/mysql/var #./mysql mysql>show databases; mysql>exit; 配置 Apache 的配置文件 /usr/local/httpd/conf/httpd.conf : 加这一行:AddType application/x-httpd-php .php 查看 Apache 能否启动: #/usr/local/httpd/bin/apachectl start 5.验证 Apache + MySQL + PHP 的有效性: 根据在 /usr/local/httpd/conf/httpd.conf 中设置的 DocumentRoot(默认为 /usr/local/httpd/htdocs) ,在对应的目录下建立一个 index.php 文件,其内容如下: #vi index.php <? echo phpinfo(); ?> wq! # 在/usr/local/httpd/conf/httpd.conf中的DirectoryIndex段中要加入就.php文件的支持 DirectoryIndex index.php index.htm index.html 这样才能访问一个目录的缺省index.php页面 然后打开浏览器在地址中访问 http://ipaddress/ 如果能看到浏览器输出的一张关于 PHP 4.0.2 输出参数的表,并能在其中有关于 MySQL 的支持信息,那么 Apache + MySQL + PHP 就安装成功了。 SOLARIS5.7+APACHE1.3.26+TOMCAT3.2.1+SYBASE11.9 基本工具的安装:tar,bash,libtool,automake,autoconf,gcc,gzip,perl(最好都是新版的) 先装gzip tar BASH的安装: #gunzip /opt/bash-2.05-sol7-sparc-local.gz #pkgadd –d bash-2.05-sol7-sparc-local #ln –s /usr/local/bin/bash /sbin/bash #vi /etc/passwd root shells /sbin/sh ?/sbin/bash #touch /etc/shells #vi /etc/shells /sbin/sh /sbin/bash 环境变量的设置:#vi /etc/profile PATH=/bin:/sbin:/usr/bin:/usr/sbin:/etc:/usr/ccs/bin:/usr/local/bin:/opt/tomcat/bin:/usr/java1.2/bin:/usr/java1.2/jre/bin export PATH JAVA_HOME=/usr/java1.2 export JAVA_HOME JRE_HOME=/usr/java1.2/jre export JRE_HOME TOMCAT_HOME=/opt/tomcat export TOMCAT_HOME CLASSPATH=/usr/java1.2/lib:/usr/java1.2/jre/lib export CLASSPATH CATALINA_BASE=/opt/tomcat export CATALINA_BASE CATALINA_HOME=/opt/tomcat export CATALINA_HOME APACHE的安装:#gunzip /opt/apache_1.3.26.tar.gz #tar –xvf /opt/apache_1.3.26.tar #cd /opt/apache_1.3.26 #./configure --prefix=/opt/apache --enable-module=so #make #make install #make clean TOMCAT的安装:#gunzip /opt/Jakarta-tomcat-3.2.1tar.gz #tar –xvf /opt/Jakarta-tomcat-3.2.1.tar TOMCAT和APACHE的接合: #ln –s /opt/Jakarta-tomcat-3.2.1 /opt/tomcat #gunzip /optJakarta-tomcat-3.2.1-src.tar.gz #tar –xvf /opt/Jakarta-tomcat-3.2.1-src.tar #cd tomcat-src/src/native/apache1.3 #/opt/apache/bin/apxs -o mod_jk.so -DSOLARIS –I ../jk –I /usr /java1.2/include-I/usr/java1.2/include/solaris -lposix4 -c *.c ../jk/*.c #cp mod_jk.so /opt/apache/libexec/mod_jk.so #chmod 755 /opt/apache/libexec/mod_jk.so #vi /opt/apache/conf/httpd.conf ServerName 169.254.1.11 #vi /opt/tomcat/conf/server.xml # <AutoDeploy source="webapps" target="webapps" /> <Context path=" " docBase=" /opt/apache/htdocs" debug="0" > </Context> 把你的JSP网页放入/opt/apache/htdocs #/opt/apache/bin/apachectl start #nohup /opt/tomcat/bin/startup.sh 输入http://169.254.1.11/index.jsp 即可看到你的JSP网页 实现全部自起动WEB服务: #touch /etc/init.d/autoapache /etc/init.d/autotomcat #vi /etc/init.d/autoapache echo "now the apache will be started automaticly" APACHE_HOME=/opt/apache export APACHE_HOME su - root -c "$APACHE_HOME/bin/apachectl start" $ echo " the apache start has be done" #vi /etc/init.d/autotomcat echo "now the tomcat will be started automaticly" TOMCAT_HOME=/opt/tomcat export TOMCAT_HOME su - root -c "nohup $TOMCAT_HOME/bin/startup.sh" $ echo " the tomcat start has be done" #ln –s /etc/init.d/autoapache /etc/rc2.d/S99apache #ln –s /etc/init.d/autotomcat /etc/rc2.d/S99tomcat |
redjean 回复于:2003-12-24 08:53:10 |
请问#tar –xvf apache_1.3.26,mysql4.0.1,php4.3.2这一步,解压缩之后apache的目录就是apache_1.3.26,对于apache的目录有没有特殊规定呢?是不是它自己解成什么名字的目录就直接用就可以了?
#cd tests把这个目录中所有以pl结尾的文件的perl解释器的位置改为#!/bin/perl这里的tests是什么? 谢谢 |