在我的 Debian 机器上(运行由 Debian 打包的 apache,包 2.4.7-1),每次 apache 通过apache2ctl restart
or重新启动时apache2ctl graceful
,它都会忘记我的 cgi-bin 目录:
me@aram:~$ sudo apache2ctl graceful-stop
me@aram:~$ sudo apache2ctl graceful
httpd not running, trying to start
me@aram:~$ curl -s http://localhost/cgi-bin/hello
Hello world, from a cgi script.
me@aram:~$ sudo apache2ctl graceful
me@aram:~$ curl -s http://localhost/cgi-bin/hello
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /cgi-bin/hello was not found on this server.</p>
<hr>
<address>Apache/2.4.7 (Debian) Server at localhost Port 80</address> …
Run Code Online (Sandbox Code Playgroud)