PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : apache in rl3 einbinden mit pwd



pablovschby
05.05.03, 18:18
hallo

beim start des apache fragt er nach dem rsa-passwort... (RSA pass phrase..)

wie starte ich apache über die runlevel mit einem script... (init.d/apachectl start), wo ich ihm auch noch das passwort dann mitgeben kann?? ohne passwort geht ja nix....
gruss&danke
pablo

pablovschby
05.05.03, 19:34
dass diese sache völlig unsicher ist, weiss ich ja .....aber es geht doch, oder..?
gruss&danke
pablo

pablovschby
05.05.03, 22:12
ich wäre wirklich froh, wenn man nur auch schon schreiben würde: vergiss es, es ist net möglich so, wie du das willst...
gruss

PigPen|tuX
06.05.03, 17:02
huhu,

nun ja dann antworte ich mal, ich hoffe das es das richtige ist,

habe heute was durch Zufall gefunden

-> http://www.linuxnetmag.com/de/issue8/m8lamp1.html

dort unter Punkt 3.15

kannst ja antworten wenn es das gewesen ist.

see you
thom

lausl
06.05.03, 17:33
kuck Dir doch mal das Script an. Denke das hilft Dir weiter.

lausl
06.05.03, 17:35
hubs, wo ist die Anlage. Okey. Probiers nochmal

lausl
06.05.03, 17:37
eieiei, falsches Format - Geduld, Geduld - ich tüftels um - kommt gleich

lausl
06.05.03, 17:44
Entschuldigung, ich paste das mal da rein, bekommst so schnell nicht inst DOSen-Format umgewandelt:

#!/bin/sh
#
#
# The exit codes returned are:
# 0 - operation completed successfully
# 1 -
# 2 - usage error
# 3 - httpd could not be started
# 4 - httpd could not be stopped
# 5 - httpd could not be started during a restart
# 6 - httpd could not be restarted during a restart
# 7 - httpd could not be restarted during a graceful restart
# 8 - configuration syntax error
#
# When multiple arguments are given, only the error from the _last_
# one is reported. Run "apachectl help" for usage info
#
#
# |||||||||||||||||||| START CONFIGURATION SECTION ||||||||||||||||||||
# -------------------- --------------------
#
# the path to your PID file
PIDFILE=/opt/web/apache/logs/httpd.pid
#
# the path to your httpd binary, including options if necessary
HTTPD="/opt/web/apache/bin/httpd -f /opt/web/apache/conf/httpd.conf"
#
# a command that outputs a formatted text version of the HTML at the
# url given on the command line. Designed for lynx, however other
# programs may work.
LYNX="lynx -dump"
#
# the URL to your server's mod_status status page. If you do not
# have one, then status and fullstatus will not work.
STATUSURL="http://localhost/server-status"
#
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/ssl/lib
export LD_LIBRARY_PATH
#
# -------------------- --------------------
# |||||||||||||||||||| END CONFIGURATION SECTION ||||||||||||||||||||

ERROR=0
ARGV="$@"
if [ "x$ARGV" = "x" ] ; then
ARGS="help"
fi

for ARG in $@ $ARGS
do
# check for pidfile
if [ -f $PIDFILE ] ; then
PID=`cat $PIDFILE`
if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
STATUS="httpd (pid $PID) running"
RUNNING=1
else
STATUS="httpd (pid $PID?) not running"
RUNNING=0
fi
else
STATUS="httpd (no pid file) not running"
RUNNING=0
fi

case $ARG in
startnossl)
if [ $RUNNING -eq 1 ]; then
echo "$0 $ARG: httpd (pid $PID) already running"
continue
fi
if $HTTPD ; then
echo "$0 $ARG: httpd started"
else
echo "$0 $ARG: httpd could not be started"
ERROR=3
fi
;;
start|startssl|sslstart|start-SSL)
if [ $RUNNING -eq 1 ]; then
echo "$0 $ARG: httpd (pid $PID) already running"
continue
fi
if $HTTPD -DSSL; then
echo "$0 $ARG: httpd started"
else
echo "$0 $ARG: httpd could not be started"
ERROR=3
fi
;;
stop)
if [ $RUNNING -eq 0 ]; then
echo "$0 $ARG: $STATUS"
continue
fi
if kill $PID ; then
echo "$0 $ARG: httpd stopped"
else
echo "$0 $ARG: httpd could not be stopped"
ERROR=4
fi
;;
restart)
if [ $RUNNING -eq 0 ]; then
echo "$0 $ARG: httpd not running, trying to start"
if $HTTPD ; then
echo "$0 $ARG: httpd started"
else
echo "$0 $ARG: httpd could not be started"
ERROR=5
fi
else
if $HTTPD -t >/dev/null 2>&1; then
if kill -HUP $PID ; then
echo "$0 $ARG: httpd restarted"
else
echo "$0 $ARG: httpd could not be restarted"
ERROR=6
fi
else
echo "$0 $ARG: configuration broken, ignoring restart"
echo "$0 $ARG: (run 'apachectl configtest' for details)"
ERROR=6
fi
fi
;;
graceful)
if [ $RUNNING -eq 0 ]; then
echo "$0 $ARG: httpd not running, trying to start"
if $HTTPD ; then
echo "$0 $ARG: httpd started"
else
echo "$0 $ARG: httpd could not be started"
ERROR=5
fi
else
if $HTTPD -t >/dev/null 2>&1; then
if kill -USR1 $PID ; then
echo "$0 $ARG: httpd gracefully restarted"
else
echo "$0 $ARG: httpd could not be restarted"
ERROR=7
fi
else
echo "$0 $ARG: configuration broken, ignoring restart"
echo "$0 $ARG: (run 'apachectl configtest' for details)"
ERROR=7
fi
fi
;;
status)
$LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
;;
fullstatus)
$LYNX $STATUSURL
;;
configtest)
if $HTTPD -t; then
:
else
ERROR=8
fi
;;
*)
echo "usage: $0 (start|stop|restart|fullstatus|status|graceful|con figtest|help)"
cat <<EOF

startnossl - start httpd without SSL
start - start httpd with SSL enabled
stop - stop httpd
restart - restart httpd if running by sending a SIGHUP or start if
not running
fullstatus - dump a full status screen; requires lynx and mod_status enabled
status - dump a short status screen; requires lynx and mod_status enabled
graceful - do a graceful restart by sending a SIGUSR1 or start if not running
configtest - do a configuration syntax test
help - this screen

EOF
ERROR=2
;;

esac

done

exit $ERROR

Jasper
06.05.03, 18:09
Original geschrieben von pablovschby
dass diese sache völlig unsicher ist, weiss ich ja .....aber es geht doch, oder..?


ja es geht. du musst die passphrase aus dem rsa-key entfernen.

openssl rsa -in key.pem -out newkey.pem

aber wie du schon selbst herausgefunden hast, ist das etwas unsicher, weil der secret-key dann völlig ungeschützt ist, es kann ihn dann jeder frei nach belieben verwenden (sofern er ihn in die finger bekommt). deshalb für niemanden leserechte auf diesen key!

-j

pablovschby
06.05.03, 21:31
Original geschrieben von Jasper
ja es geht. du musst die passphrase aus dem rsa-key entfernen.

openssl rsa -in key.pem -out newkey.pem

aber wie du schon selbst herausgefunden hast, ist das etwas unsicher, weil der secret-key dann völlig ungeschützt ist, es kann ihn dann jeder frei nach belieben verwenden (sofern er ihn in die finger bekommt). deshalb für niemanden leserechte auf diesen key!

-j ok, danke, das ssl wurde ausgeschaltet und dat geht jetet so...thx
pablo