stop.cgi

来自「Unix下基于Web的管理工具」· CGI 代码 · 共 40 行

CGI
40
字号
#!/usr/local/bin/perl# stop.cgi# Stop the running apache serverrequire './apache-lib.pl';&ReadParse();&error_setup($text{'stop_err'});$access{'stop'} || &error($text{'stop_ecannot'});if ($config{'stop_cmd'}) {	# use the configured stop command	$out = `$config{'stop_cmd'} 2>&1`;	if ($?) {		&error("<tt>$out</tt>");		}	}elsif (-x $config{'apachectl_path'}) {	# use the apachectl program	$out = `$config{'apachectl_path'} stop 2>&1`;	if ($out !~ /httpd stopped/) {		&error("<tt>$out</tt>");		}	}else {	# kill the process	$conf = &get_config();	$pidfilestr = &find_directive_struct("PidFile", $conf);	$pidfile = $pidfilestr ? $pidfilestr->{'words'}->[0]			       : "logs/httpd.pid";	$pidfile = &server_root($pidfile, $conf);	open(PID, $pidfile) || &error(&text('stop_epid', $pidfile));	<PID> =~ /(\d+)/ || &error(&text('stop_epid2', $pidfile));	close(PID);	kill('TERM', $1) || &error(&text('stop_esig', $1));	}sleep(1);&redirect($in{'redir'});

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?