{"id":1384,"date":"2009-12-07T17:17:36","date_gmt":"2009-12-07T22:17:36","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=1384"},"modified":"2013-12-10T10:56:27","modified_gmt":"2013-12-10T15:56:27","slug":"startstop-jboss","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=1384","title":{"rendered":"JBoss 4.2.2: Install"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#Versions\">Versions<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Install\">Install<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Setup\">Setup<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Setup_Env_Var\">Setup Env Var<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Setup_HTTPS\">Setup HTTPS<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Start_JBoss\">Start JBoss<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#run.sh_Command\">run.sh Command<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Stop_JBoss\">Stop JBoss<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Stop_Default_Configuration\">Stop Default Configuration<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Shutdown_Remote_Server\">Shutdown Remote Server<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Test\">Test<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Auto_Start\">Auto Start<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Reference\">Reference<\/a>\n\t<\/li>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"Versions\"><h2>Versions<\/h2><\/span>\n<p>* JBoss 4.2.2.GA<br \/>\n* CentOS 5.6<\/p>\n<span id=\"Install\"><h2>Install<\/h2><\/span>\n<p>* Download <em>jboss-4.2.2.GA.zip<\/em> from <a href=\"http:\/\/www.jboss.org\/jbossas\/downloads\/\">JBoss Download Site<\/a><br \/>\n* Unzip onto a local directory, e.g. <em>\/opt\/jboss<\/em><br \/>\n* JBoss is installed under <em>\/opt\/jboss\/jboss-4.2.2.GA<\/em> directory<\/p>\n<span id=\"Setup\"><h2>Setup<\/h2><\/span>\n<span id=\"Setup_Env_Var\"><h3>Setup Env Var<\/h3><\/span>\n<p>Add to <em>~\/.bashrc<\/em><\/p>\n<pre lang=\"bash\">\r\nexport JBOSS4_HOME=\/opt\/jboss\/jboss-4.2.2.GA\r\nexport JBOSS_HOME=$JBOSS4_HOME\r\nalias jboss4=\"cd $JBOSS4_HOME\"\r\n<\/pre>\n<span id=\"Setup_HTTPS\"><h3>Setup HTTPS<\/h3><\/span>\n<p>* Generate server keystore, e.g. <a href=\"?p=8956#Generate_keystore_using_Portecle\">use Portecle<\/a><br \/>\n* Copy keystore file, e.g. <em>jboss01.jks<\/em>, to <em>$JBOSS_HOME\/server\/default\/conf<\/em> directory<br \/>\n* Open web deployer <em>server.xml<\/em><\/p>\n<pre lang=\"bash\">\r\ncd $JBOSS_HOME\/server\/default\/deploy\/jboss-web.deployer\r\ncp server.xml server.xml.ori\r\nvi server.xml\r\n<\/pre>\n<p>* Comment out http connector:<\/p>\n<pre lang=\"xml\">\r\n   <!--\r\n    <Connector port=\"8080\" address=\"${jboss.bind.address}\"\r\n         maxThreads=\"250\" maxHttpHeaderSize=\"8192\"\r\n         emptySessionPath=\"true\" protocol=\"HTTP\/1.1\"\r\n         enableLookups=\"false\" redirectPort=\"8443\" acceptCount=\"100\"\r\n         connectionTimeout=\"20000\" disableUploadTimeout=\"true\" \/>\r\n    -->\r\n<\/pre>\n<p>* Add https connector and point to keystore:<\/p>\n<pre lang=\"xml\">\r\n\t<Connector port=\"8443\" protocol=\"HTTP\/1.1\" SSLEnabled=\"true\"\r\n\tmaxThreads=\"150\" scheme=\"https\" secure=\"true\"\r\n\tclientAuth=\"false\"\r\n\tstrategy=\"ms\" address=\"${jboss.bind.address}\"\r\n\tkeystoreFile=\"${jboss.server.home.dir}\/conf\/jboss01.jks\"\r\n\tkeystorePass=\"Welcome1\"\r\n\ttruststoreFile=\"${jboss.server.home.dir}\/conf\/jboss01.jks\"\r\n\ttruststorePass=\"Welcome1\"\r\n\tsslProtocol=\"TLS\"\/>\r\n<\/pre>\n<span id=\"Start_JBoss\"><h2>Start JBoss<\/h2><\/span>\n<p>* Start default configuration:<\/p>\n<pre lang=\"bash\">\r\ncd $JBOSS_HOME\/bin\r\n.\/run.sh -b jboss01\r\n<\/pre>\n<span id=\"run.sh_Command\"><h3>run.sh Command<\/h3><\/span>\n<p>* <em>run.sh<\/em> command syntax:<\/p>\n<pre lang=\"bash\">\r\ncd $JBOSS_HOME\/bin\r\n.\/run.sh -h\r\n=========================================================================\r\n  JBoss Bootstrap Environment\r\n  JBOSS_HOME: <JBOSS_HOME>\r\n  JAVA: <JAVA_HOME>\/bin\/java\r\n  JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx728m -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.awt.headless=true  -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true -Djava.net.preferIPv4Stack=true\r\n  CLASSPATH: <JBOSS_HOME>\/bin\/run.jar:<JAVA_HOME>\/lib\/tools.jar\r\n=========================================================================\r\nusage: run.sh [options]\r\noptions:\r\n    -h, --help                    Show this help message\r\n    -V, --version                 Show version information\r\n    --                            Stop processing options\r\n    -D<name>[=<value>]            Set a system property\r\n    -d, --bootdir=<dir>           Set the boot patch directory; Must be absolute or url\r\n    -p, --patchdir=<dir>          Set the patch directory; Must be absolute or url\r\n    -n, --netboot=<url>           Boot from net with the given url as base\r\n    -c, --configuration=<name>    Set the server configuration name\r\n    -B, --bootlib=<filename>      Add an extra library to the front bootclasspath\r\n    -L, --library=<filename>      Add an extra library to the loaders classpath\r\n    -C, --classpath=<url>         Add an extra url to the loaders classpath\r\n    -P, --properties=<url>        Load system properties from the given url\r\n    -b, --host=<host or ip>       Bind address for all JBoss services\r\n    -g, --partition=<name>        HA Partition name (default=DefaultDomain)\r\n    -u, --udp=<ip>                UDP multicast address\r\n    -l, --log=<log4j|jdk>         Specify the logger plugin type\r\n<\/pre>\n<p>* Example:<\/p>\n<pre lang=\"bash\">\r\n# Starts \"myserver\" instance and bind to address of 192.168.0.10\r\n.\/run.sh -c myserver -b 192.168.0.10\r\n\r\n# Start in the background\r\nnohup .\/run.sh -c myserver -b 192.168.0.10 &\r\n<\/pre>\n<span id=\"Stop_JBoss\"><h2>Stop JBoss<\/h2><\/span>\n<span id=\"Stop_Default_Configuration\"><h3>Stop Default Configuration<\/h3><\/span>\n<pre lang=\"bash\">\r\ncd $JBOSS_HOME\/bin\r\n.\/shutdown -S\r\n<\/pre>\n<span id=\"Shutdown_Remote_Server\"><h3>Shutdown Remote Server<\/h3><\/span>\n<p>* Find <strong>ServiceBindingManager<\/strong> mbean by looking in &#8220;<JBOSS_HOME>\/server\/myserver\/conf\/jboss-service.xml&#8221; file.<\/p>\n<pre lang=\"xml\">\r\n<mbean code=\"org.jboss.services.binding.ServiceBindingManager\"\r\n name=\"jboss.system:service=ServiceBindingManager\">\r\n <attribute name=\"ServerName\">ports-default<\/attribute>\r\n <attribute name=\"StoreURL\">${jboss.home.url}\/docs\/examples\/binding-manager\/sample-bindings.xml<\/attribute>\r\n <attribute name=\"StoreFactoryClassName\">\r\n   org.jboss.services.binding.XMLServicesStoreFactory\r\n <\/attribute>\r\n<\/mbean>\r\n<\/pre>\n<p>* Locate server section named &#8220;ServerName&#8221; (i.e. ports-default) in &#8220;StoreURL&#8221; file (i.e. ${jboss.home.url}\/docs\/examples\/binding-manager\/sample-bindings.xml).<br \/>\n* In &#8220;service-config element, find the binding port number (1098 in the following example).<\/p>\n<pre lang=\"xml\">\r\n<server name=\"ports-default\">\r\n<!-- ********************* jboss-service.xml ****************** -->\r\n<service-config name=\"jboss:service=Naming\" delegateClass=\"org.jboss.services.binding.AttributeMappingDelegate\">\r\n   <delegate-config portName=\"Port\" hostName=\"BindAddress\">\r\n      <attribute name=\"RmiPort\">1098<\/attribute>\r\n   <\/delegate-config>\r\n   <binding port=\"8085\" host=\"${jboss.bind.address}\"\/>\r\n<\/service-config>\r\n<\/pre>\n<p>* If <em>ServiceBindingManager<\/em> is commented out, try look for value for the <em>Port<\/em> attribute of <em>NamingService<\/em> mbean in <em>jboss-service.xml<\/em> file, e.g.:<\/p>\n<pre lang=\"xml\">\r\n   <mbean code=\"org.jboss.naming.NamingService\"\r\n      name=\"jboss:service=Naming\"\r\n      xmbean-dd=\"resource:xmdesc\/NamingService-xmbean.xml\">\r\n      <!-- The call by value mode. true if all lookups are unmarshalled using\r\n         the caller's TCL, false if in VM lookups return the value by reference.\r\n      -->\r\n      <attribute name=\"CallByValue\">false<\/attribute>\r\n      <!-- The listening port for the bootstrap JNP service. Set this to -1\r\n         to run the NamingService without the JNP invoker listening port.\r\n      -->\r\n      <attribute name=\"Port\">1098<\/attribute>\r\n<\/pre>\n<p>* Shutdown remote server:<\/p>\n<pre lang=\"bash\">\r\n.\/shutdown.sh -s jnp:\/\/192.168.0.10:1098 -u admin -p password\r\n<\/pre>\n<span id=\"Test\"><h2>Test<\/h2><\/span>\n<p>* Point browser to:<br \/>\n<a href=\"https:\/\/jboss01.mytest.local:8443\/web-console\/\">https:\/\/jboss01.mytest.local:8443\/web-console\/<\/a><\/p>\n<span id=\"Auto_Start\"><h2>Auto Start<\/h2><\/span>\n<p>\/\/TODO<\/p>\n<span id=\"Reference\"><h2>Reference<\/h2><\/span>\n<p>* <a href=\"http:\/\/www.jboss.org\/community\/wiki\/StartStopJBoss\">http:\/\/www.jboss.org\/community\/wiki\/StartStopJBoss<\/a><br \/>\n* <a href=\"http:\/\/docs.jboss.org\/jbossas\/docs\/Server_Configuration_Guide\/4\/html\/\">JBoss Application Server 4.2.2<\/a><br \/>\n* <a href=\"https:\/\/www.google.com\/url?sa=t&#038;rct=j&#038;q=&#038;esrc=s&#038;source=web&#038;cd=6&#038;cad=rja&#038;sqi=2&#038;ved=0CGEQFjAF&#038;url=https%3A%2F%2Faccess.redhat.com%2Fsite%2Fdocumentation%2Fen-US%2FJBoss_Enterprise_Application_Platform%2F4.2%2Fpdf%2FServer_Configuration_Guide%2FJBoss_Enterprise_Application_Platform-4.2-Server_Configuration_Guide-en-US.pdf&#038;ei=qAJ5UtCFB_TTsATZpYCIAw&#038;usg=AFQjCNGjzsjmsRp4-kyBLvOGuWdKGIx3Yw&#038;sig2=-V3wvX-qeNT0TWasG0q6kA\">JBoss Enterprise Application Platform 4 &#8211; Red Hat Customer Portal<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Versions * JBoss 4.2.2.GA * CentOS 5.6 Install * Download jboss-4.2.2.GA.zip from JBoss Download Site * Unzip onto a local directory, e.g. \/opt\/jboss * JBoss is installed under \/opt\/jboss\/jboss-4.2.2.GA directory Setup Setup Env Var Add to ~\/.bashrc export JBOSS4_HOME=\/opt\/jboss\/jboss-4.2.2.GA export &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=1384\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[30],"tags":[],"class_list":["post-1384","post","type-post","status-publish","format-standard","hentry","category-jboss"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-mk","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1384"}],"version-history":[{"count":8,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1384\/revisions"}],"predecessor-version":[{"id":9380,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1384\/revisions\/9380"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}