li
  当前位置:主页 > 基础知识 > 文章内容
li
在sun solaris下编译安装apache+tomcat一例
来源: www.ixdba.net  作者: IXDBA.NET官方    时间:2007-05-25   阅读:32  

今天给客户移植了一套web系统,从原来的linux上移植到sun solaris上,web系统是基于apachetomcat的。本来以为是很简单的事情,但是中间却遭遇了很多的挫折,看来IT行业没有很简单的事情。

 

1:登陆系统:

 

Last login: Fri May 25 10:19:40 2007 from 61.185.28.126

Sun Microsystems Inc.   SunOS 5.9       Generic May 2002

$ su -

Password:

Sun Microsystems Inc.   SunOS 5.9       Generic May 2002

IXDBA.NET社区论坛

# bash

bash-2.05# gcc

bash: gcc: command not found

经过检查,gcc确实没有安装,看来要先安装gcc编译器了。

 

2:安装gcc编译器

 

sun solarisgcc的安装有两种方式,源码编译安装和sun提供的pkgadd方式。

为了方便期间,采用pkgadd方式安装,从http://www.sunfreeware.com/programlistsparc9.html下载

适合的gcc版本,我下载的是gcc-3.3.2-sol9-sparc-local.gz,安装如下:

bash-2.05#gunzip gcc-3.3.2-sol9-sparc-local.gz

bash-2.05#pkgadd gcc-3.3.2-sol9-sparc-local

在接下来的安装中,会有一个交互性安装过程。分别按照提示输入allyes等即可。

 

3:安装apache

 

apache的安装也有两种方式,分别介绍;

 

源码安装:

 

http://www.sunfreeware.com/programlistsparc9.html下载适合的版本,

我下载的是httpd-2.0.59.tar.gz

bash-2.05#gunzip httpd-2.0.59.tar.gz

bash-2.05#tar xvf httpd-2.0.59.tar

bash-2.05#cd httpd-2.0.59

bash-2.05#./configure --prefix=/usr/local/apache2 \

--enable-mods-shared=all  \

--enable-ssl=shared \

--enable-ssl --with-ssl=/usr/local/ssl \

--enable-proxy \

--enable-proxy-connect \

--enable-proxy-ftp \

 --enable-proxy-http

bash-2.05#make

bash-2.05#make install

这样就完成了安装,

The modules that were compiled with this package can be found in /usr/local/apache2/modules

 

pkgadd安装:

 

http://www.sunfreeware.com/programlistsparc9.html下载适合的版本,

我下载的是apache-2.0.59-sol9-sparc-local.gz

由于是打包安装,会有很多的管理包必须安装,大概的关联如下;

This apache package was configured with openssl support. Dependencies: expat, libiconv,

gdbm, zlib, db-4.2.52.NC, openssl-0.9.8e, and you may need /usr/local/lib/libgcc_s.so.1

either from the libgcc-3.3 or gcc-3.3.2 or higher packages.

 

因此必须安装上面的所有关联包,apache才能正常的安装。expat, libiconv, gdbm, zlib, db-4.2.52.NC, openssl-0.9.8egcc-3.3.2等这些包可以从从http://www.sunfreeware.com/programlistsparc9.html下载,安装方式和apache安装相同,不再讲述。

 

下面开始安装apache

 

bash-2.05#gunzip apache-2.0.59-sol9-sparc-local.gz

bash-2.05#pkgadd d apache-2.0.59-sol9-sparc-local

接下来,按照提示输入ally等,完成安装

The configuration files in /usr/local/apache2/conf must be edited to fit your site's needs,

including ssl support. The httpd-std.conf there should be copied to httpd.conf and any edits

you must make included. Suggested special edits for httpd.conf include changing the line

 

 

4jk模块安装

 

jk是连接apachetomcat的调度器,可以编译产生相应的模块,也可以寻找bin方式的jk模块。

 

jk二进制版本安装

 

jk二进制版本下载

http://archive.apache.org/dist/jakarta/tomcat-connectors/jk2/binaries/

然后把jk2模块放入<apache-root-directory>/modules即可。

 

编译产生jk模块方法如下:

 

1);从http://archive.apache.org/dist/jakarta/tomcat-connectors/jk2下载源码的jk

2. Uncompress it and extract the tar file.

3. cd to

  jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2

4. chmod u+x configure

5. Run configure with:

   ./configure \

    --with-apxs2=<apache-root-directory>/bin/apxs \

    --with-tomcat41=<tomcat-root-directory> \

    --with-java-home=<java-root-directory> \

    --with-jni \

    --with-pcre

For example:

  ./configure --with-apxs2=/home/apache/bin/apxs \

       --with-tomcat41=/home/tomcat \

       --with-java-home=/usr/java \

       --with-jni \

       --with-pcre

6. Run make

7. The two .so files (mod_jk2.so and jkjni.so) will be

  in: jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2

8. Copy those to files to

<apache-root-directory>/modules with the proper permissions.

编译jk模块完毕。

 

编辑httpd.conf,在支持模块加载处添加类似:

LoadModule jk2_module     modules/mod_jk2-2.0.43.so

 

5:启动apachetomcat

 

在启动apache后,报出如下错误:

[Fri May 25 09:41:13 2007] [warn] pid file /usr/local/apache2/logs/httpd.pid overwritten --

Unclean shutdown of previous Apache run?

[Fri May 25 09:41:13 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:41:13 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:41:13 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:41:13 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:41:13 2007] [notice] Apache/2.0.59 (Unix) DAV/2 mod_jk2/2.0.2 configured --

resuming normal operations

[Fri May 25 09:41:13 2007] [alert] Child 12795 returned a Fatal error... Apache is exiting!

[Fri May 25 09:41:13 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:46:43 2007] [notice] Digest: generating secret for digest authentication ...

[Fri May 25 09:46:43 2007] [notice] Digest: done

[Fri May 25 09:46:44 2007] [warn] pid file /usr/local/apache2/logs/httpd.pid overwritten --

Unclean shutdown of previous Apache run?

[Fri May 25 09:46:44 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:46:44 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:46:44 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:46:44 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:46:44 2007] [notice] Apache/2.0.59 (Unix) DAV/2 mod_jk2/2.0.2 configured --

resuming normal operations

[Fri May 25 09:46:44 2007] [alert] Child 12805 returned a Fatal error... Apache is exiting!

[Fri May 25 09:46:44 2007] [alert] (22)Invalid argument: setgid: unable to set group id to

Group 4294967295

[Fri May 25 09:50:49 2007] [notice] Digest: generating secret for digest authentication ...

 

经过检查,在httpd.conf文件中,一定要保证如下信息存在,

 

user nobody

group nogroup或者是group nobody

 

httpd.conf文件在linux下,只存在这样的信息,

user nobody

Group #-1

即没有指定group组的信息,这种方式在linux下是可以的,但是转移到sun系统后,apache配置文件要变化一下。

 

6;安装mysql

 

http://www.sunfreeware.com/programlistsparc9.html下载适当版本的mysql,然后安装方法与apache方法相同,不再说明。

 

配置系统,成功启动apachetomcatjk正常工作,应用启动正常,数据库连接正常,移植完毕。

 

If you have already been using apache2, MAKE SURE that you backup any files in the conf, htdocs, modules, or other subdirectories of /usr/local/apache2 where you might have changed or added files so that installing the updated apache2 will not cause your configuration or other files to be lost.




  上一篇: Mysql中max_allowed_packet参数设...   下一篇: Sun solaris好站点推荐
li
 §相关评论  
 热点文章

·RewriteRule重写规则的语法:A
·apache配置文件httpd.conf参数
·Apache的配置文件http.conf参数
·HTTP协议中POST、GET、HEAD等参
·XAMPP命令之LAMPP
·Linux中安装XAMPP(LAMPP)服务器
·网页禁止右键、禁止复制等代码
·java.lang.OutOfMemoryError:
·Mysql数据库在Linux系统常用命
·mysql问答:MySQL数据库连接过多
·MySQL数据库中Show命令的用法
li
 编辑推荐
·RewriteRule重写规则的语法:A
·apache配置文件httpd.conf参数
·Apache的配置文件http.conf参数
·HTTP协议中POST、GET、HEAD等参
·XAMPP命令之LAMPP
·Linux中安装XAMPP(LAMPP)服务器
·网页禁止右键、禁止复制等代码
·java.lang.OutOfMemoryError:
·Mysql数据库在Linux系统常用命
·mysql问答:MySQL数据库连接过多
·MySQL数据库中Show命令的用法
li
 相关篇章
·Mysql中max_allowed_packet参数设...
·java defunct产生的原因和解决办...
·Jdk Installation of Solaris Pa...
·Unison使用参考大全
·Lvs调度策略研究
·Linux as4.2下Xfs文件系统的安装...
·Apache Prefork和Worker模式的性...
·神秘的DUAL
·drbd安装使用指南
·vmware三种网络连接
·Sun solaris好站点推荐
·Rsh无密码登录设置
·Linux下修改网卡工作模式
·solaris系统管理员认证指南
·tomcat中的几点配置说明
·在Tomcat下禁止目录浏览功能
·mysql:如何让mysql支持中文gbk字...
·完美解决mysql数据库字符编码问题...
·命令总结:DB2常用的命令
·solaris的语言包问题
 
li
设为首页 | 关于我们 | 技术服务 | 收藏本站 | 网站地图 | 联系方式 | 本站友情连接