-
Notifications
You must be signed in to change notification settings - Fork 30
Installation
Installing AProx on JBoss AS7 is fairly straightforward. However, one piece that may confuse many people used to working with WAR files is the configuration, which is located on the filesystem in the /etc/aprox/ directory. This may be a matter of co-locating the /etc/aprox directory structure on the same drive letter as the WAR deployment for Windows users; I simply haven't tried that yet.
##Install Prerequisites
By default, AProx stores its repository, group, and deploy-point definitions - along with expiration information for artifacts it caches - in a CouchDB instance. In order to run the plain-vanilla AProx WAR, then, you'll need to have a CouchDB instance running somewhere.
###On Linux
$ sudo yum -y install couchdb
$ sudo chkconfig couchdb on
$ sudo service couchdb start
###On OS X
I was able to get CouchDB running on my MacbookPro using CouchBase Server. Since the development team for CouchBase isn't strictly related to the Apache CouchDB project anymore, it's reasonable to expect CouchBase and CouchDB to drift apart. If you want to install the Real Thing(tm), you can try this instead.
###On Windows
I've never tried this, and may the deity of your choice forgive you for doing this sort of work on Windows. Seriously. It's not a real platform, it's a toy.
It looks like CouchBase Server is available for Windows, and the CouchDB project itself has these instructions for installing the real Couch.
##Configuration Files
###/etc/aprox/main.conf
This is the main configuration file for AProx. It's designed to configure the options that will not vary depending on the specific mix of backend storage or add-ons included in the AProx WAR.
Currently, it only has a single configuration option:
/etc/aprox/main.conf:
---------------------
storage.dir=/var/lib/aprox/storage
You'll notice that I've got my AProx instance configured to conform to the Linux standards. Of course, it doesn't have to be this way.
###/etc/aprox/couch.conf
This configuration file controls access to a CouchDB backing datastore, which is the default in the basic WAR. The simplest configuration for this file consists of a single line:
/etc/aprox/couch.conf:
----------------------
db.url=http://localhost:5984/aprox
NOTE: If this CouchDB database doesn't exist, AProx will try to create it on startup. In any event, AProx will always replace its design doc - proxy-logic - in the specified Couch database, to ensure it contains up-to-date view logic.
NOTE(2): If you have your CouchDB database locked down and require username/password, you can include it in this URL. AProx will parse the URL to pull out username/password credentials, and supply them only in response to an authentication challenge.
The couch.conf file also supports the following additional options:
-
db.connections.max
This is the maximum number of simultaneous connections AProx is allowed to make to the CouchDB database. The default value is 20.
##Directory Setup
Now, you need to create the directory structure you referred to in storage.dir within your /etc/aprox/main.conf file:
$ sudo mkdir -p /var/lib/aprox/storage
Also, make sure the directory is owned by the user that will run the AS7 instance:
$ sudo chown -R jboss-as /var/lib/aprox/storage
##Install the AProx WAR
Simply stand up an instance of JBoss AS7 and deploy your freshly-Built AProx WAR:
- Unzip the AS7 distribution .ZIP
- Execute
bin/standalone.sh - Go to http://localhost:8080/
- Follow the link for
Administration Console - Click on
Manage Deploymentsnear the bottom left of the console UI. - Click
Add Contentnear the top right of the console UI. - Browse to your AProx WAR (
<aprox-source-dir>/wars/basic/target/aprox.war) - Approve the
NameandRuntime Namesettings (should be okay by default), and Save - Click
Enablenext to theaprox.warentry, and confirm.