例えば、ドキュメントルートに “test.htm" が存在しない場合は、404 Not Found が返ります。
$ curl -vv http://localhost/test.htm
* Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /test.htm HTTP/1.1
> Host: localhost
> User-Agent: curl/7.76.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Date: Mon, 19 Feb 2024 02:45:04 GMT
< Server: Apache/2.4.58 () OpenSSL/1.0.2k-fips
< Content-Length: 196
< Content-Type: text/html; charset=iso-8859-1
<
<!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 was not found on this server.</p>
</body></html>
* Connection #0 to host localhost left intact
次に、ドキュメントルートに “test.htm" が存在する場合は、200 OK が返ります。
$ curl -vv http://localhost/test.htm
* Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /test.htm HTTP/1.1
> Host: localhost
> User-Agent: curl/7.76.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Mon, 19 Feb 2024 02:54:25 GMT
< Server: Apache/2.4.58 () OpenSSL/1.0.2k-fips
< Last-Modified: Mon, 19 Feb 2024 02:54:18 GMT
< ETag: "c-611b335bfc51f"
< Accept-Ranges: bytes
< Content-Length: 12
< Content-Type: text/html; charset=UTF-8
<
Hello world
* Connection #0 to host localhost left intact