官术网_书友最值得收藏!

Installing the server

Now that we are aware, and presumably excited about the features JBoss portal server offers, let's get started with downloading and installing it.

The following sections provide an overview of the installation process, which should be sufficient for most installs. However, for complicated scenarios or for more in-depth information, it might be a good idea to also refer to the advanced documentation provided by JBoss at http://www.jboss.org/jbossportal/ docs/index.html.

Getting the software

Just like any other open source software, getting the JBoss portal server software is as simple as going to the JBoss web site and downloading it.

The web site offers different versions of software for different installation scenarios. Options include a version packaged along with JBoss application server platform, an independent binary for installs on existing servers or clustered environments, and a version in source code format that a user can use to build a binary. This allows us to choose from a wide array of options ranging from, standalone portal servers and pre-packaged version with application servers, to building from source.

System requirements

Before we go into the details of installation, let's quickly review the minimum system requirements to run JBoss Portal Server 2.7.0

  • JBoss Application Server(AS)4.2.3,JBoss Enterprise Application Platform(EAP) 4.2, and JBoss EAP 4.3. In addition to the JBoss application server, the portal is designed to work on application servers such as Weblogic and Websphere. However, it is recommended that JBoss servers are used, for maximum value.
  • The portal, being a 100 percent pure Java application, is independent of the underlying platform. Thus, JBoss portal server can be successfully deployed and run on any platform that supports a Java Virtual Machine(JVM).
  • JDK5
  • 512 MB RAM
  • Approximately 100MB hard disk space
  • A minimum 400MHz CPU
  • JBoss portal uses Hibernate to implement persistence. Hibernate provides extensive support for all the popular databases, hence making the portal server compatible with most databases.

Installation

The server can be installed in different ways depending on the type of software downloaded. The three versions are:

  1. JBoss portal and JBoss AS bundle
  2. JBoss portal server binary
  3. JBoss portal source

In the next few sections, we will discuss the server installation for each of these versions. The complexity of the installation ranges from a simple installation of the bundled software version to complex source compilation and independent installation on an existing application server.

JBoss portal packaged with JBoss application server

This is probably the easiest installation method, and is recommended for anybody who is a beginner with JBoss portal, or wishes to install and explore the product. This version includes JBoss portal server and the underlying JBoss application server. The server comes with default set of configuration options along with a inbuilt Hypersonic SQL database.

We need to execute the following steps to install JBoss portal and JBoss application server bundle:

  1. After downloading the ZIP file containing the bundled software, extract the ZIP file into a convenient directory. Please note that in this installation method, the directory chosen is permanent and will be used for every JBoss portal artifact. In other words, there won't be any installation files or software binaries outside this directory, making it a very clean and convenient install. A typical directory on Windows is c:\jboss-portal-2.7.0. >

    After expanding the ZIP file, the structure looks like this:

    JBoss portal packaged with JBoss application server
  2. Run the executable in the JBOSS_PORTAL_INSTALLATION/bin/ directory. The executables are run.bat for a Windows installation, or run.sh for UNIX systems. During startup, the server uses a default configuration. However, if we want to provide an alternate configuration file, we need to use the -c option along with run.bat or run.sh .
  3. Point your browser to the URL http://localhost:8080/portal, and you should see the default portal home page as shown in the following screenshot. The portal provides two accounts by default for user log-in. The login parameters for the first account are username user and password user, and for the second account are username admin and password: admin. Each of the IDs has special relevance and access rights associated with it. We will come back to this topic later when we talk about portal security, for now it is sufficient to use these IDs as listed.
    JBoss portal packaged with JBoss application server

During the execution of the run script, the console will show a few errors and warnings, as shown in the following screenshot. The reason is, during start-up, JBoss Portal looks for certain initial database tables and if it doesn't find them, it creates them, with a warning message. Given that this is the first time, it cannot find them. It is okay to ignore these errors and warnings.

JBoss portal packaged with JBoss application server

Tip

Sometimes, during startup, the server might give an OutOfMemoryError . This can be eliminated by adjusting the MaxPermSize in the startup options. Just add -XX:MaxPermSize=128M to JAVA_OPTS in the run script.

JBoss portal binary without the server

This installation method is recommended if you want to install only the portal binary and already have a pre-existing installation of JBoss AS or JBoss EAP on which the portal will run. This method is also used when you want to install JBoss portal in a clustered environment.

The following steps should be followed to install JBoss portal binary:

  1. Download and extract the ZIP archive in a temporary directory. After some configuration, we will move segments of the content to the permanent, application server tree.

    The binary version can be found on the same download page as was listed under the section JBoss Portal Binary.

    Once extracted, the structure looks like this:

    JBoss portal binary without the server

    The significant difference here is that the downloadable now consists primarily of a service archive, or a sar directory called jboss-portal.sar. This is where the portal software and configurations reside. It also has a setup directory, which has datasource descriptors and configurations for various databases, so that the portal can connect to the databases on the existing server platform.

    JBoss portal binary without the server
  2. Configure the JBoss application server or JBoss EAP. For our current purpose, it is assumed that either the JBoss application server or JBoss EAP has already been installed and configured. For more detailed documentation on the installation of these servers, please refer to the specific documentation provided by JBoss.
  3. Configure the database and datasources.

    As mentioned earlier, the binary install option is best suited for an existing application server. Hence, the likely scenario for its use will be in a non-development environment. JBoss portal requires a database to be run. Even though JBoss application server comes with in-built support for the HypersonicSQL database, it is recommended that the portal server does not use this database beyond development. It is recommended that a separate RDBMS be installed, and the portal configured to use it.

    Before we begin the configuration of the portal server, let's look at the installation and configuration of the external database, and briefly touch upon the parts that are relevant to the portal install.

    To use a database with the portal, the following are the salient steps:

    • i. Create a new database instance and name it, for example, jbportal .
    • ii. Grant access rights to a user on the portal that will actively use the database jbportal . The portal uses the user to create tables and modify data in the tables in the database. Hence, it will require the rights to do so. This same user will be used when we configure the database descriptor in the portal configuration.
    • iii. To connect an RDBMS database, J2EE application server leverage connectors, also called JDBC drivers, are provided by the database vendors. Drivers help connect applications, such as portals deployed on application servers, to RDBMS databases. The drivers can be found on the web sites of the database vendors. The JDBC driver jarfile is copied to the sever directory at $JBOSS_HOME/server/default/lib/ , where $JBOSS_HOME is the home directory of the server installation.
    • iv. To configure the datasources in the portal server, we will edit the XML descriptor file corresponding to our database in the setup directory under the extracted portal tree discussed in Step 1.

    Let's assume that our database is MySQL v5, so the descriptor we will edit is portal-mysql5-ds.xml .

    The file, edited with appropriate values, will appear as follows. Please refer to the documentation provided by the database vendor for advanced configuration options in the connection URL.

    JBoss portal binary without the server
  4. Deploy the JBoss portal binary.

    Once we are ready with the database and have configured our descriptor, we are ready to deploy the portal server software on the application server. The file mysql5-ds.xml is first copied to the $JBOSS_HOME/server/configuration/deploy/ directory, where configuration is either all, default, minimal , or production , depending on the type and installation of the application server. This step will ensure that the server is aware of the new database, and is ready to offer connections, when requested by the portal. However, when we add a new datasource configuration, we have to make sure that we remove the default Hypersonic SQL Db configuration file from the directory, to avoid conflicts.

    The whole subdirectory jboss-portal.sar , from the original downloaded binary as detailed in Step 1, is now copied to the $JBOSS_HOME/server/configuration/deploy/ directory, where again the configuration value is set depending on the type and installation of the application server. With this, the application server is aware of the existence of the JBoss portal in a service archive format, which will automatically get deployed and started when the application server starts up.

  5. As with the earlier install, we can now direct the browser to the URL http://localhost:8080/portal, and we should see the default portal home page. The userid/password options, as before, are user/user and admin/admin.

    During the start-up process, we should see the errors and warnings related to missing tables, as detailed in the bundled version section. Again, these can be ignored as they are simply the portal's first-time execution symptoms.

Building JBoss portal from source

As with all open source software, JBoss portal can also be downloaded in source form and built to create a deployable artifact. Needless to say, this option is recommended only for experts and individuals who are comfortable dealing with raw source code and the complexities associated with building from source.

We will not go into a lot of detail for this installation method, as the options are broad and subject to various preferences of the user. Exhaustive and specific information on building from sources can be found on the JBoss forums and in the associated documentation.

主站蜘蛛池模板: 屏南县| 沐川县| 博客| 新乐市| 玉林市| 秀山| 邹平县| 开封市| 长顺县| 靖州| 浏阳市| 仁布县| 阿克苏市| 偏关县| 清新县| 尚志市| 龙江县| 象山县| 广丰县| 井研县| 亳州市| 兖州市| 岢岚县| 新余市| 长泰县| 桂林市| 汕尾市| 孟村| 根河市| 漠河县| 博湖县| 祁连县| 瓮安县| 隆回县| 宁都县| 清新县| 登封市| 马鞍山市| 四子王旗| 乐业县| 广宗县|