05.02.2013 Aufrufe

Firewall Handbuch für LINUX 2.0 und 2.2 - zurück

Firewall Handbuch für LINUX 2.0 und 2.2 - zurück

Firewall Handbuch für LINUX 2.0 und 2.2 - zurück

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

entry looks something like:<br />

blah:run_level:once:/usr/local/bin/httpd /wtree >>/tmp/httpd.log<br />

2>&1<br />

An example wrapper follows. The 'uMsg()' calls are just home-brewed function<br />

calls that output error messages. Substitute your own error messages:<br />

/** wrapper BEGINS **/<br />

#include <br />

#include <br />

#include "uUtil.h" /* for uMsg() */<br />

void main( int argc, char *argv[] )<br />

{<br />

uid_t uid = your_web_user_uid_here;<br />

gid_t gid = your_web_user_gid_here;<br />

int ierr = 1;<br />

char *p;<br />

if( argc != 2 )<br />

{<br />

fprintf( stderr, "USAGE: %s WEB_ROOT\n", argv[0] );<br />

fprintf( stderr, "WHERE: WEB_ROOT - is the root of the web tree\n" );<br />

}<br />

else<br />

{<br />

p = argv[1];<br />

if( chdir(p) )<br />

{<br />

uMsg( U_FATAL, "chdir to %s failed: %S", p );<br />

}<br />

else if( chroot(p) )<br />

{<br />

uMsg( U_FATAL, "chroot to %s failed: %S", p );<br />

}<br />

else if( setuid(uid) != 0 )<br />

{<br />

uMsg( U_FATAL, "setuid failed: %S" );<br />

}<br />

else if( setgid(gid) != 0 )<br />

{<br />

uMsg( U_FATAL, "setuid failed: %S" );<br />

}<br />

else<br />

{<br />

execl( "/bin/httpd","httpd",(char *)0 );<br />

uMsg( U_FATAL, "execl failed for httpd: %S" );<br />

}<br />

}<br />

exit( ierr );<br />

}<br />

/** wrapper ENDS **/<br />

Now you have to install your existing html files into your new tree. If<br />

people have been using relative pathnames in their html files, then there<br />

won't be many difficulties. In my case I just copied all necessary trees<br />

into the new location (using korn-shell syntax):<br />

cd /old_web_tree<br />

for i in dir1 dir2 dir3 dir4 blahblahblah ; do<br />

cp -r $i /wtree/$i<br />

done<br />

You will have to correct any html files that have full pathnames in their<br />

Erstellt von Doc Gonzo - http://kickme.to/plugins

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!