This updates a post that I wrote back in 2012, which was based around Red Hat Enterprise Linux 6.
I've had another go at this, testing on Red Hat Enterprise Linux 7.4, and have a different solution.
In essence, RHEL 7 is now using systemd rather than chkconfig, so here's an alternative: -
Create the Service - as root
vi /etc/systemd/system/ibmhttpd.service
[Unit]
Description=IBM HTTP Server
After=network.target
[Service]
Type=forking
PIDFile=/opt/ibm/HTTPServer/MFP/logs/httpd.pid
User=wasadmin
ExecStart=/opt/ibm/HTTPServer/bin/apachectl -k start -f /opt/ibm/HTTPServer/MFP/conf/httpd.conf
ExecStop=/opt/ibm/HTTPServer/bin/apachectl -k stop -f /opt/ibm/HTTPServer/MFP/conf/httpd.conf
PrivateTmp=true
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
Reload systemd - as root
sudo systemctl daemon-reload
Start the service - as root
systemctl start ibmhttpd
Check the service status - as root
systemctl status ibmhttpd
Stop the service - as root
systemctl stop ibmhttpd
Register the service to auto-start - as root
systemctl enable ibmhttpd
This is somewhat simpler than the older chkconfig approach.
With thanks to this: -
and this: -
for inspiration.
No comments:
Post a Comment