{"id":3715,"date":"2022-07-12T23:15:27","date_gmt":"2022-07-12T14:15:27","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=3715"},"modified":"2022-07-12T23:15:29","modified_gmt":"2022-07-12T14:15:29","slug":"apache-httpd-2-4-return-503","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2022\/07\/12\/apache-httpd-2-4-return-503\/","title":{"rendered":"Apache httpd 2.4\u3067\u3082503\u3092\u8fd4\u3059\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<div class=\"paragraph\">\n<p>\u81ea\u5b85\u30b5\u30fc\u30d0\u304c\u8d77\u52d5\u3057\u306a\u304f\u306a\u3063\u305f\u306e\u3067Lighttpd\u3067\u5168\u30da\u30fc\u30b8503\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><a href=\"https:\/\/matoken.org\/blog\/2022\/06\/28\/lighttpd-returns-all-pages-503\/\">Lighttpd\u3067\u5168\u30da\u30fc\u30b8503\u3092\u8fd4\u3059 \u2013 matoken\u2019s meme<\/a><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u601d\u3063\u305f\u3088\u308a\u30a2\u30af\u30bb\u30b9\u304c\u591a\u3044\u306e\u3067\u30a2\u30af\u30bb\u30b9\u306e\u591a\u3044\u30c9\u30e1\u30a4\u30f3\u306eDNS\u3092\u5909\u66f4\u3057\u3066\u5916\u306e\u30b5\u30fc\u30d0\u306b\u5411\u3051\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0e<br \/>\n\u3053\u306e\u30b5\u30fc\u30d0\u306fApache httpd\u304c\u52d5\u3044\u3066\u3044\u308b\u306e\u3067Lighttpd\u3068\u540c\u3058\u8a2d\u5b9a\u306f\u4f7f\u3048\u306a\u3044\u306e\u3067\u5c11\u3057\u8abf\u3079\u3066\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"paragraph\">\n<p>\u5bfe\u8c61\u30c9\u30e1\u30a4\u30f3\u306e\u8a2d\u5b9a\u3092\u4f5c\u6210\uff0e\u3053\u3053\u3067\u306f\u300c <code>sub1.example.org<\/code> \u300d\u3068\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">`\/etc\/apache2\/sites-enabled\/090-sub1.example.org.conf<\/div>\n<div class=\"content\">\n<pre>&lt;VirtualHost *:80&gt;\n        ServerName sub1.example.org\n        Redirect permanent \/ https:\/\/sub1.example.org\/\n&lt;\/VirtualHost&gt;\n&lt;IfModule mod_ssl.c&gt;\n&lt;VirtualHost *:443&gt;\n        ServerName sub1.example.org\n        ServerAdmin webmaster@example.org\n        DocumentRoot \/var\/www\/sub1.example.org\/\n        RedirectMatch 503 ^\/(?!503\\.html) <b class=\"conum\">(1)<\/b>\n        ErrorDocument 503 \/503.html\n        ErrorLog ${APACHE_LOG_DIR}\/error_sub1.example.org.log\n        CustomLog ${APACHE_LOG_DIR}\/access_sub1.example.org.log combined\n        SSLCertificateFile \/etc\/letsencrypt\/live\/sub1.example.org\/fullchain.pem\n        SSLCertificateKeyFile \/etc\/letsencrypt\/live\/sub1.example.org\/privkey.pem\n&lt;\/VirtualHost&gt;\n&lt;\/IfModule&gt;<\/pre>\n<\/div>\n<\/div>\n<div class=\"colist arabic\">\n<ol>\n<li>\u3059\u3079\u3066\u306eURL\u3092 <code>\/503.html<\/code> \u306b\u8ee2\u9001\u3057\u307e\u3059\uff0e<\/li>\n<\/ol>\n<\/div>\n<div class=\"paragraph\">\n<p>\u5bfe\u8c61\u30c9\u30e1\u30a4\u30f3\u306e\u8a3c\u660e\u66f8\u3092\u65e7\u30b5\u30fc\u30d0\u304b\u3089\u30b3\u30d4\u30fc\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4f5c\u6210<\/div>\n<div class=\"content\">\n<pre>$ sudo mkdir -p \/etc\/letsencrypt\/tmp\/sub1.example.org\/<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u30ea\u30e2\u30fc\u30c8\u30b5\u30fc\u30d0\u306e <code>\/etc\/letsencrypt\/live\/sub1.example.org\/fullchain.pem<\/code> \u3068 <code>\/etc\/letsencrypt\/live\/sub1.example.org\/privkey.pem<\/code> \u3092 <code>\/etc\/letsencrypt\/tmp\/sub1.example.org\/<\/code> \u4ee5\u4e0b\u306b\u7f6e\u304f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u6a29\u9650\u8a2d\u5b9a\u3057\u3066\u30ea\u30f3\u30af\u3092\u8cbc\u308a\u307e\u3059\uff0e<\/div>\n<div class=\"content\">\n<pre>$ sudo chown -R root.ssl-cert \/etc\/letsencrypt\n$ sudo ln -s \/etc\/letsencrypt\/tmp\/sub1.example.org\/fullchain.pem \/etc\/letsencrypt\/live\/sub1.example.org\/fullchain.pem\n$ sudo ln -s \/etc\/letsencrypt\/tmp\/sub1.example.org\/privkey.pem \/etc\/letsencrypt\/live\/sub1.example.org\/privkey.pem<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>503\u7528\u306ehtml\u3092\u7528\u610f\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo -u www-data mkdir \/var\/www\/sub1.example.org\n$ sudo -u www-data vi \/var\/www\/sub1.example.org\/503.html<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>apache httpd\u518d\u8d77\u52d5<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo service apache2 restart<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>DNS\u66f8\u304d\u63db\u3048\u524d\u306b\u691c\u8a3c\u306e\u884c\u3048\u308b\u30ed\u30fc\u30ab\u30eb\u306ePC\u306ehosts\u66f8\u304d\u63db\u3048\u3066\u52d5\u4f5c\u30c6\u30b9\u30c8\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ echo \"192.0.2.5 sub1.example.org\" | sudo tee -a \/etc\/hosts <b class=\"conum\">(1)<\/b>\n$ w3m -dump_head head http:\/\/sub1.example.org\/piyo | grep ^HTTP\/ <b class=\"conum\">(2)<\/b>\nHTTP\/1.1 503 Service Unavailable\n$ w3m -dump_extra head http:\/\/sub1.example.org\/piyo | lv <b class=\"conum\">(3)<\/b><\/pre>\n<\/div>\n<\/div>\n<div class=\"colist arabic\">\n<ol>\n<li>\u65b0\u3057\u3044\u30b5\u30fc\u30d0\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3059\u308b\uff0e<\/li>\n<li>503\u304c\u5e30\u3063\u3066\u304f\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/li>\n<li>\u8a3c\u660e\u66f8\u3082\u78ba\u8a8d<\/li>\n<\/ol>\n<\/div>\n<div class=\"paragraph\">\n<p>\u52d5\u4f5c\u78ba\u8a8d\u304c\u51fa\u6765\u305f\u3089 <code>\/etc\/hosts<\/code> \u3092\u623b\u3057\u3066\u304a\u304f\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3053\u306e\u5f8c\uff0cDNS\u66f8\u304d\u63db\u3048\u3092\u884c\u3044DNS\u304c\u4f1d\u64ad\u3057\u3066\u304b\u3089\u518d\u5ea6\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3046\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u5bfe\u8c61\u30c9\u30e1\u30a4\u30f3\u306eSSL\u8a3c\u660e\u66f8\u66f4\u65b0\u3082\u3057\u3066\u304a\u304f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo certbot certonly -d sub1.example.org<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\u30b5\u30fc\u30d0\u79fb\u884c\u3057\u307e\u3057\u305f\uff0e<br \/>\n\u305d\u308c\u307e\u3067\u81ea\u5b85\u306b9000\u30a2\u30af\u30bb\u30b9\u307b\u3069\u6709\u308a\u307e\u3057\u305f\u304c8500\u7a0b\u306f\u5916\u306e\u30b5\u30fc\u30d0\u306b\u884c\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre>$ dpkg-query -W apache2 certbot\napache2 2.4.38-3+deb10u7\ncertbot 0.31.0-1+deb10u1\n$ lsb_release -dr\nDescription:    Debian GNU\/Linux 10 (buster)\nRelease:        10\n$ arch\nx86_64<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u5b85\u30b5\u30fc\u30d0\u304c\u8d77\u52d5\u3057\u306a\u304f\u306a\u3063\u305f\u306e\u3067Lighttpd\u3067\u5168\u30da\u30fc\u30b8503\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u307e\u3057\u305f\uff0e Lighttpd\u3067\u5168\u30da\u30fc\u30b8503\u3092\u8fd4\u3059 \u2013 matoken\u2019s meme \u601d\u3063\u305f\u3088\u308a\u30a2\u30af\u30bb\u30b9\u304c\u591a\u3044\u306e\u3067\u30a2\u30af\u30bb\u30b9\u306e\u591a\u3044\u30c9\u30e1\u30a4\u30f3\u306eDNS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[428,7,6],"tags":[734,77,733],"class_list":["post-3715","post","type-post","status-publish","format-standard","hentry","category-buster","category-debian-linux","category-linux","tag-734","tag-apahce-httpd","tag-httpstatuscode"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=3715"}],"version-history":[{"count":2,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3715\/revisions"}],"predecessor-version":[{"id":3717,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3715\/revisions\/3717"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=3715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=3715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=3715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}