Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssl on reboot

Status
Not open for further replies.

treeoon

IS-IT--Management
Joined
Aug 12, 2004
Messages
5
Location
US
ez...

ive stripped apache from redhat 9, and put it my own install of 2.0.50 + php 4.3.7. after rebooting the box, the apache service comes up fine, just without the ssl module loaded. a quick :
/apache/bin/apachectl stop
and a
/apache/bin/apachectl startssl

solves the problem, but is a hassle whenever u reboot the box. is there a way to have apache startup in ssl mode by default?
 

You have to modify the init script to start with ssl.

Look in /etc/init.d/httpd

 
when i stipped out the redhat 9 version of apache, that file /etc/init.d/httpd got moved to /etc/init.d/httpd.rpmsave (i'm assuming for backup purposes)

where else would apache be starting from?

also...

why does linux have so many damn ways to install/start services?!#@!!@

 
Look in /etc/rc3.d (and other rc#.d directories) for something like "S77httpd". It'll probably be a link to the actual startup script.

When you installed your own version, how did you specify it to auto-start?
 
sure enough... in /etc/init.d/rc3.d/

lrwxrwxrwx 1 root root 19 Jul 3 02:12 S85apachectl -> ../init.d/apachectl


ive looked through the apachectl file it references but cannot figure out how to specify the startssl parameter.
 

Get rid of the link and write a shell script to fire up apachectl with startssl when called with a start parameter. Use the httpd.rpmsave as example code.
 

is it possible to move /etc/init.d/apachectl to /etc/init.d/apachectl2

and then create a file /etc/init.d/apachectl which just contains the text "/etc/init.d/apachectl2 startssl"

would this in fact start the service the way im tryin to do?
 
Here's what I have for /etc/init.d/apache:
Code:
#!/bin/sh
BIN="/usr/local/apache/bin/apachectl"
case "$1" in
        start)
                $BIN sslstart
                ;;
        stop)
                $BIN stop
                ;;
        restart)
                $BIN restart
                ;;
esac
exit 0

You could even modify the apachectl to include -DSSL as an option to httpd, but I generally don't like to monkey with the default files.

Also, I know that my script isn't a true init-script. You'll have to manually create the links in rc3.d, rc0.d, etc. if you want it to work.
 

Put this line:

Code:
# chkconfig: - 85 15

at the top of the file and chkconfig will pay attention to it allowing you to 'chkconfig http on'. That will create the sym links for you.
 
thanks for the help guys!

made the script like lgarner said, and put that extra line at the top.

WORKS GREAT!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top