FreeKB - Start Stop Restart web server using the apachectl command
IBM IHS Web Server - Start Stop Restart web server using the apachectl command

The apachectl or command can be used to start, stop, and restart an IBM IHS web server, like this. 

<web_server_root>/bin/apachectl -k restart
<web_server_root>/bin/apachectl -k start
<web_server_root>/bin/apachectl -k stop
<web_server_root>/bin/apachectl -k graceful
<web_server_root>/bin/apachectl -k graceful-stop

 

The above command will use the <web_server_root>/conf/httpd.conf file. The -f option can be used to specify some other conf file, like this.

<web_server_root>/bin/apachectl -k start -f conf/foo.conf

 

The ps command can be used to determine if the web server is running. If the web server is running, the ps command should return processes associated with the web server. If the ps command fails to return any output, check the web server error_log.

Note

Notice the ps command returns "httpd" processes. apachectl is a wrapper script that invokes the httpd command to start, stop, or restart the web server, thus you could use the httpd command instead.

ps -ef | grep httpd
. . .
root      2330     1  0 21:41 ?        00:00:00 /opt/IBM/IHS/bin/httpd -d /opt/IBM/IHS -k start
nobody    2333  2330  0 21:41 ?        00:00:00 /opt/IBM/IHS/bin/httpd -d /opt/IBM/IHS -k start
nobody    2334  2330  0 21:41 ?        00:00:00 /opt/IBM/IHS/bin/httpd -d /opt/IBM/IHS -k start
nobody    2335  2330  0 21:41 ?        00:00:00 /opt/IBM/IHS/bin/httpd -d /opt/IBM/IHS -k start

 

When the ps command displays processes associated with the web server, you should be able to request resources from the web server. By default, the httpd.conf file has the following.

ServerName localhost:80
Listen 80

 

With this configuration, you should be able to enter the hostname of your web server in a browser and the following should be displayed.

 


Multiple web server

If you have two or more web servers on the same machine, you will have a unique conf file for each web server, like this.

<web_server_root>/conf/httpd1.conf
<web_server_root>/conf/httpd2.conf

 

The -f option can be used to target a specific web server. In this example, only the web server using httpd1.conf will be restarted.

<web_server_root>/bin/apachectl -k restart -f <web_server_root>/conf/httpd1.conf

 

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 6b963 in the box below so that we can be sure you are a human.




Comments