`
xiaoboss
  • 浏览: 650091 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

JBOSS 5.1 on Ubuntu 11.4

阅读更多

Requirements : JDK 6
Ubuntu : 11.4

Download Jboss from link : JbossDownload

Create Directory :

sudo mkdir /usr/local/jboss

Extract contents of the downloaded file into this directory

sudo unzip [downloaded_file_name]

Add user called jboss with this command :

sudo useradd -d /usr/local/jboss -s /bin/sh jboss

Now set ownership of this directory to jboss :

sudo chown -R jboss:jboss /usr/local/jboss

Make a copy of the jboss_init_redhat.sh in the bin directory like so

sudo cp /usr/local/jboss/bin/jboss_init_redhat.sh /usr/local/jboss/bin/jboss_init_ubuntu.sh

Now edit this script to make certain changes

sudo gedit /usr/local/jboss/bin/jboss_init_ubuntu.sh

To set the correct path for Java — > Change line

JAVAPTH=${JAVAPTH:-”/usr/local/jdk/bin”}

to

JAVAPTH=${JAVAPTH:-”/usr/bin”}

And change line

JBOSS_BIND_ADDR=${JBOSS_HOST:+”-b $JBOSS_HOST”}

To

JBOSS_BIND_ADDR=${JBOSS_HOST:+”-b 0.0.0.0″}

Explanation : This binds it on all IP addresses. To bind to a specific address, replace the 0.0.0.0.

Now copy this file to the startup scripts folder

sudo cp /usr/local/jboss/bin/jboss_init_ubuntu.sh /etc/init.d/jboss

To add Jboss to the init system

sudo update-rc.d jboss defaults

Result :

update-rc.d: warning: /etc/init.d/jboss missing LSB information
update-rc.d: see
Adding system startup for /etc/init.d/jboss …
/etc/rc0.d/K20jboss -> ../init.d/jboss
/etc/rc1.d/K20jboss -> ../init.d/jboss
/etc/rc6.d/K20jboss -> ../init.d/jboss
/etc/rc2.d/S20jboss -> ../init.d/jboss
/etc/rc3.d/S20jboss -> ../init.d/jboss
/etc/rc4.d/S20jboss -> ../init.d/jboss
/etc/rc5.d/S20jboss -> ../init.d/jboss

Note : In case you want to remove previous instances of Jboss in the init system run :

sudo update-rc.d -f jboss remove

Now just to be sure about the permissions

sudo chown -R jboss:jboss /usr/local/jboss
sudo chmod -R 755 /usr/local/jboss

Now you can start the server by

sudo /etc/init.d/jboss start

And stop the server by

sudo /etc/init.d/jboss stop

 

 

Installing Tomcat6 on Ubuntu 9.04

If you are running Ubuntu use the manual installation process shown here.

Make sure that Java is installed. Check with the dpkg command like this:

dpkg –get-selections | grep sun-java

This should give this output if java is installed on the system:

sun-java6-bin install
sun-java6-jdk install
sun-java6-jre install

If no results, install the latest version with this command:

sudo apt-get install sun-java6-jdk

Installation

Now we’ll download and extract Tomcat from the apache site . Check latest version number and adjust accordingly.Replace “6.0.14″ below with the latest version number

wget http://apache.hoxt.com/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.tar.gz
tar xvzf apache-tomcat-6.0.14.tar.gz

Move the tomcat folder to a permanent location. Use for example /usr/local/tomcat.

sudo mv apache-tomcat-6.0.14 /usr/local/tomcat

Tomcat requires setting the JAVA_HOME variable. The best way to do this is to set it in your .bashrc file. You could also edit your startup.sh file.The better method is editing your .bashrc file and adding the bolded line there. Logout of the shell for the change to take effect. Also while you are at it, set the CATALINA_OPTS variable to whatever is suitable. Incase you have a dedicated server use a large memory allocation.

vi ~/.bashrc

If you have large amount of RAM you can set Tomcat to use minimum of 512mb and maximum of 1024mb (Like in the example below). Add the following lines:

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export CATALINA_OPTS=”-Xms512m -Xmx1024m”

You could also run the JVM in server mode with the -server flag in CATALINA_OPTS. There is supposed to be a speed advantage in the server mode although it is a little slow to start up. Use the following line to run the JVM in server mode.

export CATALINA_OPTS=”-server -Xms512m -Xmx1024m”

Tomcat can be started by just executing the startup.sh script in the tomcat/bin folder.

Automatic Starting

To make tomcat automatically start when we boot up the computer, Add a script to make it auto-start and shutdown.

sudo vi /etc/init.d/tomcat

Now paste in the following:

# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid
export JAVA_HOME=/usr/lib/jvm/java-6-sun
case $1 in
start)
sh /usr/local/tomcat/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/bin/shutdown.sh
sh /usr/local/tomcat/bin/startup.sh
;;
esac
exit 0

Make the script executable by running the chmod command:

sudo chmod 755 /etc/init.d/tomcat

The last step is actually linking this script to the startup folders with a symbolic link. Execute these two commands and we should be on our way.

sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

Tomcat should now be fully installed !

Setup the Manager Role

As a final step you need to login to the tomcat manager. To do that open up the tomcat/conf/tomcat-users.xml file.

sudo vi /usr/local/tomcat/conf/tomcat-users.xml

Now add the following lines at the end of the file just before the closing ‘</tomcat-users>’. Replace with your username and password at the appropriate places below.

<role rolename=”manager”/>
<user username=”your_user_name_here” password=”your_password_here” roles=”manager”/>

Now all you have to do is to restart tomcat once again.

sudo /etc/init.d/tomcat restart

Now go to the tomcat server – usually found at http://localhost:8080. Click on the link to the manager. Give the username/password you set before – and voila you can now deploy your WAR files !

*****************************************************************
*********** Follow Up 1 – RISKY step ***************************
*****************************************************************

For removing the default install of tomcat6 from ubuntu, first remove the package tomcat6 and any related packages with tomcat6 in the name via synaptic. After that type in terminal

sudo updatedb
locate tomcat6

When you get the list of all files with tomcat6 in the name, go to each of them and delete all of them one by one. That way you are sure there are no traces of the default tomcat6 install left on your system ( You may have to use root permissions to clear certain files – so be careful about what you delete)

分享到:
评论

相关推荐

    jboss5.1集群操作说明 apache2.2.4

    JBoss 5.1 是一个基于 Java 的应用服务器,提供了高度可扩展性和高可用性,支持集群部署。集群操作能够使多个 JBoss 实例协同工作,以提高应用程序的性能和容错能力。Apache 2.2.4 是一个常用的开源 Web 服务器,它...

    JBOSS5.1安装配置说明

    JBOSS5.1安装配置说明 JBOSS 是一个基于 Java 的开源应用服务器,可以运行在 Windows、Linux、Unix 等多种操作系统平台上。为了在 Windows 下安装和配置 JBOSS,我们需要按照以下步骤进行操作。 安装 JAVA 环境 ...

    ejb课程测试代码,eclipse+jboss5.1 ant编译等代码

    在本课程测试代码中,我们将探讨如何在Eclipse集成开发环境(IDE)下使用Apache Ant构建工具,配合JBoss 5.1应用服务器进行EJB的开发和部署。 【Eclipse】是广泛使用的开源Java IDE,支持多种Java项目类型,包括EJB...

    替换两个文件解决Tomcat6项目移植到JBoss5.1下的Logging异常

    除了加入jboss-web.xml,删除xerces-2.6.2.jar和xml-apis.jar之外, &lt;!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web ...原因是旧版本的slf4j-api不包含以上方法,附件解压后覆盖jboss5.1GA/common/lib下的同名文件即可

    JBOSS旧版本(3~6)下载地址

    JBOSS旧版本(3~6)下载地址、JBOSS旧版本(3~6)下载地址、JBOSS旧版本(3~6)下载地址、JBOSS旧版本(3~6)下载地址

    Jboss-5.1的集群搭建完整配置

    本文是作者精心写作的完整配置搭建Jboss-5.1集群的文档,只要按照步骤来做绝对不会出错,一些重要部分俺还加以标注和详细说明,呕心沥血的一大完整安装文档.

    jboss-5.1.0.GA _01

    jboss-5.1.0.GA, 因为太大了,我分了两部分上传,这是第一部分,我把里面的service目录的内容放到第二部分了,下载的时候 记得我的上传目录找第二部分资源,然后解压到server目录 便可

    jboss与mysql的连接

    这个驱动程序应该被添加到JBoss的类路径中,通常是`JBOSS_HOME/server/default/lib`目录。 2. **环境变量设置**:设置两个环境变量,`CLASSPATH`和`JBOSS_HOME`,以确保JBoss能找到所需的库文件和启动配置。 3. **...

    JBOSS 安装成 windows的服务

    **JBoss 安装成 Windows 服务的详细指南** JBoss 是一个开源的应用服务器,它提供了基于Java EE的平台来部署和管理企业级应用程序。在Windows操作系统上将JBoss安装为服务,可以让JBoss在系统启动时自动启动,提供...

    xfire生成webservice

    本文将详细讲解如何在Eclipse集成开发环境中使用XFire生成Web服务,并在JBoss 5.1应用服务器上进行部署和运行。 首先,我们需要理解Web服务的基本概念。Web服务是基于开放标准(如SOAP、WSDL和UDDI)的自包含、自...

    JBoss7配置Mysql5.1数据源.pdf

    根据文件提供的信息,本文将详细介绍JBoss7配置Mysql5.1数据源的过程。 JBoss是一个开源的应用服务器,支持Java EE应用程序,而Mysql是一个广泛使用的开源关系数据库管理系统。在JBoss上配置Mysql数据源是一个常见...

    jboss-5.1的原文件。。

    jboss的文件。。希望大家都能下载学习。。。

    java项目tomcat迁移到jboss

    在我们的项目中,使用的是 Spring 2.5 版本,但是在 JBoss 5.1 中,可能会出现版本不兼容的问题。解决这个问题的方法是,在 WEB-INF 目录下添加一个名为 jboss-web.xml 的文件,并在其中配置 class-loading 信息。 ...

    linux下jboss安装与配置

    3. 解压 JBoss 5.1:`unzip jboss-5.1.0.GA-jdk6.zip -d /usr/local/`,解压到 `/usr/local/` 目录下。 4. 将 jboss-5.1.0.GA 目录重命名为 jboss:`mv jboss-5.1.0.GA jboss`。 五、配置环境变量 1. 编辑 `/etc/...

    ubuntu安装jboss

    在Ubuntu系统上安装JBoss是开发和部署Java应用程序的关键步骤。JBoss是一个开源的应用服务器,由Red Hat公司维护,主要用于运行Java EE应用。本篇将详细介绍如何在Ubuntu上安装和配置JBoss,以及如何利用其进行开发...

    jboss-migration:JBoss WindRide-用于将JBoss AS 5或EAP 5配置迁移到AS 7,WildFly 8或EAP 6的工具

    JBoss AS 5.1+ JBoss EAP 5.x 适用于目标服务器: JBoss AS 7.1.1以上 JBoss EAP 6.x(支持6.1+) Wildfly 8.x 它能做什么 该应用程序自动执行将源服务器的配置迁移到目标服务器所需的操作。 这包括: 从源...

    pager-taglib 分页扩展实例

    pager-taglib 是个很好的jsp分页标签,使用它结合jstl可以实现灵活的分页导航功能...2.只在jboss5.1内测试通过,注意检查jdbc驱动包等相关依赖,tomcat可能出现缺包等问题,相信入门级别的朋友们应该可以找到解决方案的

Global site tag (gtag.js) - Google Analytics