Setting up IBM HTTP Server for starting/stopping from WAS console

Radek BaranowskiJava&Guidewire Senior Developer
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task.

You need three things to start/stop and administer IHS server from within WAS admin console:
1. IHS admin server configured and running
2. admin credential created with password on IHS admin server
3. IHS server defined on WAS side and admin credentials stored in there.

Configuring IBM HTTP Server administration server is in fact configuring separate apache instance (httpd process daemon) and the product provides scripting tools to do that. However, Windows and Linux versions differ a bit in that aspect.

When your IHS installation is on Windows and you want to start/stop it from WAS console, you need to have your web server based on Windows service (if you just want to start/stop it manually from shell scripts it is not necessary). Now, there’s a manual way to configure Windows service, but this a topic for a separate article, so let’s assume we’re installing IBM HTTP Server with Installation Manager and we create corresponding Windows service underway, which is shown as a screenshot from IM below. Please note that “Startup type”  option is set to “Manual” for greater control. Also, leave the setting for “Log on with local system account” as it is unless you need some specific account to use for your IHS.
2014-07-15-screen-003.pngHaving done that, after your installation successfully finishes, go to Task manager-> Services toi confirm the service has been successfully created.

Now, go to the directory where HIS has been installed and find subdirectory named “conf”. There’s a file named admin.conf there and we need to make some adjustments there. Open it with your favourite text-file editor and change the following options:
# Port used to access the Administration Server

Open in new window

Put your desired port (usually 8008) in place of @@AdminPort@@

Open in new window

Also go to the bottom of the file and change accordingly:
ServerName @@AdminPort@@

Open in new window

To your port and proper hostname, like:
ServerName my_hostname:8008

Open in new window

Save and close the file. Our Admin server config is ready for now (in future you may want to customize the configuration to add SSL support for example, but let’s leave it at that for the time being).

On Linux however, setting up admin server is a little bit different, also we don’t need to care about Windows service (there’s a way of setting up IHS as Linux service, but again, different topic). So, after you have installed IBM HTTP Server on your machine, go to installation’s directory /bin subdir and use tool to configure user and group for running administration server as in Linux (it must be non-root).

Detailed description for usage can be found here but let me give you example:
setupadm -create -usr ihsadmin -grp ihsgrp -cfg  /opt/IBM/HTTPServer/conf/httpd.conf
                      -adm /opt/IBM/HTTPServer/conf/admin.conf

Open in new window

You might also check admin.conf file to ensure there’s correct port setup (IHS installation on Linux should have set it up to 8008). That’s all to be done to set up admin server on Linux systems.
What we need next is to create a credential on IHS admin server for WAS to be able to use to connect to the server (please note this is a different user that we specified with setupadm command!). We do that by going to /bin subdir of our installation (both Windows and Linux) and use following command:

htpasswd –b ../conf/admin.passwd ihsadmin yourpasswd

Open in new window

 you should get response like:
“Adding password for user ihsadmin”

Open in new window

And that’s it. Now we are ready to run the admin server by

  • going to /bin subdir of HIS installation and typing in httpd –f conf/admin.conf (on Windows). This will keep your command line occupied (until you stop the admin server by cancelling the job).
  • going to /bin subdir and using adminctl start (on Linux). The control should return to shell
You might want to check if server is in fact running by finding port 8008 occupied In netstat output:
netstat –an | grep 8008 (linux) 
                      netstat –an | findstr 8008 (windows)

Open in new window

you should get something like that:
C:\Program Files (x86)\IBM\HTTPServer_1\bin>netstat -an | findstr 8008
                        TCP               LISTENING

Open in new window

And now the final part – configuring our HTTP Server in WebSphere Application Server console.

Log into the console, go to Servers -> Web Servers and create Web Server definition. Click New… and proceed through the screens inputing values accordingly:
2014-07-16-screen-005.jpg2014-07-16-screen-006.jpgPlease note that Port should have correct value - given during installation time. (82 my case, but standard is 80). Also note that windows service name should match the one we found previously in Task Manager (when on Windows). Click Finish on the last screen and save the changes to your WAS config.

Now, we should be ready to start our web server from WAS console:

Clipboard01.pngAs can be seen, server has been successfully started and status check shows that server is running (WAS checks if web server is running by verifying socket open on specified port - 82 this case). 

In this article we demonstrated how to set up IBM HTTP Server to be started/stopped from WebSphere Application Server's administrative console.  Follow up steps might include setting up Websphere Plugin generated for web server  to route requests from web server port to applications deployed on WAS, setting up SSL on external interface or between HTTP Server and WAS, but this shall be covered in separate articles.
Radek BaranowskiJava&Guidewire Senior Developer

Comments (1)

Radek BaranowskiJava&Guidewire Senior Developer


Very good point, indeed it lacked some wrap-up at the end. I do hope the paragrapgh added will be a sufficient summary.


Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.