How can I start Web Agent using systemctl instead apachectl?
search cancel

How can I start Web Agent using systemctl instead apachectl?


Article ID: 107936


Updated On:


CA Single Sign On Secure Proxy Server (SiteMinder) CA Single Sign On SOA Security Manager (SiteMinder) CA Single Sign-On


We just installed and configured a new Web Agent on an Apache 2.4 server running in RHEL7. The installation and configuration went fine, but when we start the service we get the following errors:

‚óŹ httpd.service - The Apache HTTP Server
   Loaded: loaded (/etc/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2018-07-26 08:57:56 EDT; 5s ago
     Docs: man:httpd(8)
  Process: 8830 ExecStopPost=/usr/bin/kdestroy -A (code=exited, status=0/SUCCESS)
  Process: 8827 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 8824 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
  Process: 8822 ExecStartPre=/usr/libexec/<service> (code=exited, status=0/SUCCESS)
 Main PID: 8824 (code=exited, status=1/FAILURE)

Jul 26 08:57:48 <host> systemd[1]: Starting The Apache HTTP Server...
Jul 26 08:57:56 <host> <service>[8822]: ipa         : WARNING  Unable to connect to dirsrv: Timeout exceeded
Jul 26 08:57:56 <host> <service>[8822]: ipa         : WARNING  Disabling KDC proxy
Jul 26 08:57:56 <host> httpd[8824]: httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Cannot load /CA/webagent/bin/ into server: cannot open shared object file: No such file or directory
Jul 26 08:57:56 <host> systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 26 08:57:56 <host> kill[8827]: kill: cannot find process ""
Jul 26 08:57:56 <host> systemd[1]: httpd.service: control process exited, code=exited status=1
Jul 26 08:57:56 <host> systemd[1]: Failed to start The Apache HTTP Server.
Jul 26 08:57:56 <host> systemd[1]: Unit httpd.service entered failed state.
Jul 26 08:57:56 <host> systemd[1]: httpd.service failed.

We have sourced the environment variables, and the user has full rights on all the files in the bin folder and the files mentioned in the error. 

How can we solve this problem?


Web Agent R12.52 SP1 on RHEL7 (Apache web server)


In order to start the Apache web server as a service with the systemctl commands (systemctl stop/start httpd.service), you need to ensure the sysconfig httpd file has the environment variables added into it. To do this, edit the /etc/sysconfig/httpd file and add the following:

# This file can be used to set additional environment variables for
# the httpd process, or pass additional options to the httpd
# executable.
# Note: With previous versions of httpd, the MPM could be changed by
# editing an "HTTPD" variable here.  With the current version, that
# variable is now ignored.  The MPM is a loadable module, and the
# choice of MPM can be changed by editing the configuration file
# /etc/httpd/conf.modules.d/00-mpm.conf.
# To pass additional options (for instance, -D definitions) to the
# httpd binary at startup, set OPTIONS here.
# This setting ensures the httpd process is started in the "C" locale
# by default.  (Some modules will not behave correctly if
# case-sensitive string comparisons are performed in a different
# locale.)

export PATH

Note that "/CA/webagent" is the path used as a sample, but it should be your Web Agent home path.