Versions
- CentOS 6.3
- Oracle Java JDK 1.6
- WSO2 API Manager 1.3.1
Prerequisties
Install
1. Download
Download API Manager from WSO2 website: http://wso2.com/products/api-manager/
Note: can’t link directly since currently requires filling out a form to download.
2. Extract
1 |
unzip wso2am-1.3.1.zip |
Note: update version as required
2. Move
1 2 |
sudo mv wso2am-1.3.1 /usr/lib sudo ln -s /usr/lib/wso2am /usr/lib/wso2am |
Configure
1. Create wso2 user if missing
1 |
sudo useradd --system --user-group wso2 |
2. Update permissions
1 |
sudo chown -R wso2:wso2 /usr/lib/wso2am-1.3.1 |
3. Create service script /etc/init.d/wso2am
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#!/bin/sh # # chkconfig: 2345 80 80 # # Bash script to run wso2server.sh as a service # # Note: Normal env variables are discarded by service. So must export JAVA_HOME here, see http://serverfault.com/questions/374404/service-command-and-environment-variables export JAVA_HOME=/usr/java/latest WSO2_HOME=/usr/lib/wso2am WSO2_DAEMON=bin/wso2server.sh WSO2_USER=wso2 START_OPTIONS=start STOP_OPTIONS=stop start() { echo "Starting WSO2 API Manager..." su --preserve-environment $WSO2_USER -c "cd $WSO2_HOME && $WSO2_DAEMON $START_OPTIONS" return 0 } stop() { echo "Stopping WSO2 API Manager..." su --preserve-environment $WSO2_USER -c "cd $WSO2_HOME && $WSO2_DAEMON $STOP_OPTIONS" return 0 } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac exit $? |
Note: the script hard codes JAVA_HOME, but this can be deferred to the /etc/sysconfig/wso2am script (which you must create) if desired. Note that the normal /etc/profile.sh is *not* run for system accounts.
TODO: find better way of setting JAVA_HOME, can’t execute /etc/profile or /etc/profile.d/java.sh directly
4. Make it executable
1 |
sudo chmod +x /etc/init.d/wso2am |
5. Start service
1 |
sudo service wso2am start |
6. Start service on boot
1 |
sudo chkconfig wso2am on |
7. Open the following ports as required:
- 9443 – carbon admin, publisher and store applications
- 8243 – http port used by gateway to access API services
- 8280 – https port used by gateway to access API services
Verify
Watch wso2dss logs:
1 |
sudo tail -F /usr/lib/wso2am/repository/logs/wso2carbon.log |
Should see the following:
1 |
... |
Visit your new Carbon website: https://XXX.XXX.XXX.XXX:9443/carbon/
Initial login:
- Username: admin
- Password: admin