Common Pitfalls in Deploying Axis2/C in Apache Server
By Supun Kamburugamuva
- 24 Aug, 2008
You can find the installation guidelines for Axis2/C in the manual page. Here I'm not going to discuss those details. Instead I will focus on the things that can go wrong when trying to deploy Axis2/C in Apache Server.
Apache Server loads Axis2/C as a module when it starts. Axis2/C uses the LoadModule directive of Apache to specify the Axis2/C module which connects Apache and Axis2/C. The module name is mod_axis2. The binary can be found in the <AXIS2C_BIN_DIR>/lib folder. You don't have to copy the Axis2/C module to the Apache modules directory, but it is a good practice. You can keep it in anywhere you like and give the complete path to the LoadModule directive.
Axis2/C Apache module depends on the Axis2/C libraries. Some of these dependencies are axis2_engine, axutil, axiom etc. So, make sure these libraries are in the library path of Linux or Path in windows. If these libraries are not specified in the path, the module will complain that it cannot find these libraries and will fail. The best thing to do is to add the <AXIS2C_BIN_DIR>/lib directory to the system path.
If something goes wrong with the configuration, Apache server won’t start and the error will be logged in the Apache error log i.e invalid configuration names. Also, please note that the configuration that you specify for Axis2/C in the httpd.conf is case sensitive.
User access rights
Typically, Apache server runs as an unprivileged user. So make sure that this user has read access to the location where Axis2/C libraries are kept, with] write access to the Axis2/C log file. The user and user group under which Apache runs is specified in the httpd.conf.
Axis2/C services and Modules
Axis2/C can fail due to invalid service and module configurations. Some of these include:
- A module is built with an earlier version of Axis2/C binary
- Errors in module.xml file or module xml file is missing
- A service is built with a previous version of Axis2/C
- A service links to a library which is not in the library path
- Services xml is missing or invalid
- Empty services folders
Axis2/C looks for the axis2.xml services folder and modules folder in the Axis2RepoPath you specify in the httpd.conf. So make sure these three essential items are in that path.
Note: If you don’t configure the log file correctly Apache will write the Axis2/C log file into its error log.
Here I’m not going to talk about the specific errors that are reported in the logs under these circumstances. But generally, by looking at the log files, you are able to figure out what goes wrong.
I have described the most common mistakes that users make when deploying Axis2/C in the Apache Web server.
Supun Kamburugamuva, Software Engineer, WSO2 Inc. supun AT wso2 DOT com