httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RYAN vAN GINNEKEN <r...@shaw.ca>
Subject Re: [users@httpd] startssl at boot time
Date Fri, 02 Apr 2004 11:12:42 GMT
Brent Bailey wrote:

>Ummm the explanation below in regards to having apache start from boot is
>more so for solaris....NOT Freebsd...on a freebsd machine you will want to
>look for start up scripts that are usually in /usr/local/etc/rc.d
>
>Look for apache.sh ...it is usually installed if you install apache from the
>ports collection. ...if its not there then use this.  While in the
>/usr/local/etc/rc.d   directory...  create and edit a file called apache.sh
>And add the below script to it then save..
>
>----------------------snip--------------------------
>#!/bin/sh
>
>case "$1" in
>start)
>        [ -x /usr/local/sbin/apachectl ] && /usr/local/sbin/apachectl
>startssl > /dev/null && echo -n ' apache'
>        ;;
>stop)
>        [ -r /var/run/httpd.pid ] && /usr/local/sbin/apachectl stop >
>/dev/null && echo -n ' apache'
>        ;;
>*)
>        echo "Usage: `basename $0` {start|stop}" >&2
>        ;;
>esac
>
>exit 0
>
>---------------snip-----------------------------------
>
>Brent Bailey CCNA 
>
>-----Original Message-----
>From: Boyle Owen [mailto:Owen.Boyle@swx.com] 
>Sent: Thursday, April 01, 2004 5:42 AM
>To: users@httpd.apache.org
>Subject: RE: [users@httpd] startssl at boot time
>
>  
>
Thank you all i tried the suggestions i received but none seemed to 
work.  Tried your script but it did not work in fact it did not start 
apache at all here is my that only starts regular apache.  I know little 
to no programming wish i would not have dropped out of that c++ class i 
was taking years ago.   However they look very similar except for the 
cert stuff dont know what is happening exactly.
#!/bin/sh
PREFIX=/usr/local

case "$1" in
start)
        [ "ssl" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt" ] 
&& SSL=
        [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl 
start${SSL}
        ;;
stop)
        [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > 
/dev/null &
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

here is my apache error log during the boot process seems the script 
does something  but then apache exits


[Fri Apr 02 03:21:18 2004] [debug] prefork.c(955): AcceptMutex: flock 
(default: flock)
[Fri Apr 02 03:40:54 2004] [info] removed PID file /var/run/httpd.pid 
(pid=3782)
[Fri Apr 02 03:40:54 2004] [notice] caught SIGTERM, shutting down
[Fri Apr 02 03:40:56 2004] [info] mod_unique_id: using ip addr 192.168.0.202
[Fri Apr 02 03:40:57 2004] [info] mod_unique_id: using ip addr 192.168.0.202
[Fri Apr 02 03:40:58 2004] [notice] Apache/2.0.49 (Unix) PHP/4.3.5 
configured -- resum
[Fri Apr 02 03:40:58 2004] [info] Server built: Mar 30 2004 04:02:47
[Fri Apr 02 03:40:58 2004] [debug] prefork.c(955): AcceptMutex: flock 
(default: flock)
[Fri Apr 02 03:41:22 2004] [info] removed PID file /var/run/httpd.pid 
(pid=3903)
[Fri Apr 02 03:41:22 2004] [notice] caught SIGTERM, shutting down
[Fri Apr 02 03:41:26 2004] [info] mod_unique_id: using ip addr 192.168.0.202
[Fri Apr 02 03:41:27 2004] [info] Init: Initializing OpenSSL library
[Fri Apr 02 03:41:27 2004] [info] Init: Seeding PRNG with 136 bytes of 
entropy
[Fri Apr 02 03:41:27 2004] [info] Init: Generating temporary RSA private 
keys (512/102
[Fri Apr 02 03:41:30 2004] [info] Init: Generating temporary DH 
parameters (512/1024 b
[Fri Apr 02 03:41:30 2004] [debug] ssl_scache_dbm.c(403): Inter-Process 
Session Cache
[Fri Apr 02 03:41:30 2004] [info] Init: Initializing (virtual) servers 
for SSL
[Fri Apr 02 03:41:30 2004] [info] Server: Apache/2.0.49, Interface: 
mod_ssl/2.0.49, Li
[Fri Apr 02 03:41:31 2004] [info] mod_unique_id: using ip addr 192.168.0.202
[Fri Apr 02 03:41:32 2004] [info] Init: Initializing OpenSSL library
[Fri Apr 02 03:41:32 2004] [info] Init: Seeding PRNG with 136 bytes of 
entropy
[Fri Apr 02 03:41:32 2004] [info] Init: Generating temporary RSA private 
keys (512/102
[Fri Apr 02 03:41:37 2004] [info] Init: Generating temporary DH 
parameters (512/1024 b
[Fri Apr 02 03:41:37 2004] [debug] ssl_scache_dbm.c(403): Inter-Process 
Session Cache
[Fri Apr 02 03:41:37 2004] [info] Init: Initializing (virtual) servers 
for SSL
[Fri Apr 02 03:41:37 2004] [info] Server: Apache/2.0.49, Interface: 
mod_ssl/2.0.49, Li
[Fri Apr 02 03:41:37 2004] [notice] Apache/2.0.49 (Unix) PHP/4.3.5 
mod_ssl/2.0.49 Open
[Fri Apr 02 03:41:37 2004] [info] Server built: Mar 30 2004 04:02:47
[Fri Apr 02 03:41:37 2004] [debug] prefork.c(955): AcceptMutex: flock 
(default: flock)
[Fri Apr 02 03:42:01 2004] [warn] child process 3916 still did not exit, 
sending a SIG
[Fri Apr 02 03:42:02 2004] [info] removed PID file /var/run/httpd.pid 
(pid=3915)
[Fri Apr 02 03:42:02 2004] [notice] caught SIGTERM, shutting down








>>-----Original Message-----
>>From: RYAN vAN GINNEKEN [mailto:rmvg@shaw.ca]
>>
>>I use freebsd 4.9 stable and apache 2.0.0.49 with mod_ssl when i type 
>>startssl everything seems to work ie my non ssl sites and my 
>>ssl site.  
>>However on reboot my ssl site does not come up until i run apachectl 
>>startssl.  How do i make apache start the ssl stuff at boot 
>>    
>>
>
>Quick answer: remove <IfDefine SSL> conditional from httpd.conf. This
>will cause SSL directives to be executed unconditonally.
>
>Explanation:
>
>When a unix machine boots, the start-up shell looks in the run-control
>directories for start-up scripts. These directories vary from system to
>system but are usually /etc/rc.local/rc2.d and similar. If it finds a
>file beginning with S, eg, S50apache, it will execute that script with
>the argument "start". So it will execute "S50apache start". You will
>find that S50apache is either a copy of or a symlink to apachectl so
>this is equivalent to "apachectl start" which in turn does "httpd" and
>so starts apache. (In case you're wondering; the number part, ie "50",
>is for ordering the scripts and the "K" is for killing the processes
>during "halt" - it executes "S50apache stop". 
>
>Usually, your ssl-aware config will have the SSL VH wrapped up in a
><IfDefine SSL> container which means that it will only get read if the
>you do "apachectl startssl" which translates to "httpd -DSSL". Read the
>apachectl script (it's a shell-script) to see how it works and all will
>become clear.
>
>Rgds,
>Owen Boyle
>Disclaimer: Any disclaimer attached to this message may be ignored. 
>
>  
>
>>time THANK 
>>YOU  in advance.
>>
>>
>>---------------------------------------------------------------------
>>The official User-To-User support forum of the Apache HTTP 
>>Server Project.
>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>    
>>
>Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
>keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
>e-mail is of a private and personal nature. It is not related to the
>exchange or business activities of the SWX Group. Le présent e-mail est
>un message privé et personnel, sans rapport avec l'activité boursière du
>Groupe SWX.
>
>This message is for the named person's use only. It may contain
>confidential, proprietary or legally privileged information. No
>confidentiality or privilege is waived or lost by any mistransmission.
>If you receive this message in error, please notify the sender urgently
>and then immediately delete the message and any copies of it from your
>system. Please also immediately destroy any hardcopies of the message.
>You must not, directly or indirectly, use, disclose, distribute, print,
>or copy any part of this message if you are not the intended recipient.
>The sender's company reserves the right to monitor all e-mail
>communications through their networks. Any views expressed in this
>message are those of the individual sender, except where the message
>states otherwise and the sender is authorised to state them to be the
>views of the sender's company. 
>
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>  
>
#!/bin/sh
PREFIX=/usr/local

case "$1" in
start)
        [ "ssl" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt" ] 
&& SSL=
        [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl 
start${SSL}
        ;;
stop)
        [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > 
/dev/null &
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0


Thank you i tried some of the suggestions i recived but none seemed to 
work this on seem to fit and wor

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message