{"id":1305,"date":"2025-11-11T20:24:44","date_gmt":"2025-11-11T11:24:44","guid":{"rendered":"https:\/\/eng.miteel.net\/?page_id=1305"},"modified":"2025-12-19T10:37:53","modified_gmt":"2025-12-19T01:37:53","slug":"nginx%e3%81%a7zoneminder-zm%e3%82%92%e5%8b%95%e3%81%8b%e3%81%99","status":"publish","type":"page","link":"https:\/\/eng.miteel.net\/?page_id=1305","title":{"rendered":"nginx\u3067zoneminder (Zm)\u3092\u52d5\u304b\u3059"},"content":{"rendered":"\n<p>ZoneMinder\u3092Nginx\u3067\u904b\u7528\u3059\u308b\u969b\u306e\u30b3\u30c4<\/p>\n<p>\u2460\u3000PHP\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306b\u3064\u3044\u3066<br \/>\n\u3000\u3000PHP\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u304c\u672a\u8a2d\u5b9a\u306e\u5834\u5408\u3001<br \/>\n\u3000\u3000\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u3060\u3051\u306b\u306a\u308b<\/p>\n<p><pre><code>\u3000\u3000\/etc\/php\/7.0\/fpm\/php.ini<\/pre><\/code><\/p>\n<p>\u3000\u3000\u306e\u4e2d\u306e [DATE]\u30bb\u30af\u30b7\u30e7\u30f3\u306e<\/p>\n<p><pre><code>\u3000\u3000;date.timezone =<\/code><\/pre><\/p>\n<p>    \u3092\u63a2\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b<\/p>\n<p><pre><code>\u3000\u3000date.timezone = \"Asia\/Tokyo\"<\/code><\/pre><\/p>\n<p>\u3000\u3000\u305d\u306e\u3042\u3068\u3001<\/p>\n<p><pre><code>\u3000\u3000service php-7.0fpm restart<\/code><\/pre><\/p>\n<p>\u3000\u3000\u3053\u308c\u3084\u3089\u306a\u3044\u3068\u3001\u3046\u307e\u304f\u3086\u304b\u306a\u3044<\/p>\n<p>\u2461\u3000config\u3000\u306b\u3064\u3044\u3066<\/p>\n<p><pre><\/code>\u3000\u3000\/etc\/nginx\/sites-enabled\/default<\/code><\/pre><\/p>\n<p>\u3000\u3000\u306eserver{}\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u4ee5\u4e0b\u3092\u66f8\u304f<\/p>\n<pre><p>        <code>location \/zm {\n                alias '\/usr\/share\/zoneminder\/www';\n                index index.php;\n                autoindex on;\n                autoindex_exact_size off;\n                autoindex_localtime on;\n                charset UTF-8;\n           location ~ \\.php$ {\n               include snippets\/fastcgi-php.conf;\n               fastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;\n               fastcgi_param SCRIPT_FILENAME $request_filename;\n           }\n           location ~ \\.(jpg|jpeg|gif|png|ico)$ {\n               access_log          off;\n               expires         33d;\n           }\n        }<\/code><\/p><\/pre>\n<pre><p>        <code>location \/zm\/cgi-bin\/ {\n          gzip off;\n          root \"\/usr\/lib\/zoneminder\/\";\n          allow all;\n          try_files $uri $uri\/ =404;\n          fastcgi_pass  unix:\/var\/run\/fcgiwrap.socket;\n          include \/etc\/nginx\/fastcgi_params;<br \/>\n          fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;\n          location ~ \/.*(\\|\\.sh|\\.pl|\\.cgi)$ {\n                gzip off;\n                fastcgi_pass unix:\/var\/run\/fcgiwrap.socket;\n                include \/etc\/nginx\/fastcgi.conf;\n          }\n        }<\/code><br \/><\/p><\/pre>\n<p>\n\u203b apache\u3067\u52d5\u4f5c\u3055\u305b\u308b\u5834\u5408\u3001alias\u5148\u3068\u5b9f\u969b\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<br \/>\n\u3000\u3000\u69cb\u9020\u304c\u9055\u3063\u3066\u3044\u3066\u3082\u554f\u984c\u7121\u3044\u304c\u3001nginx\u306e\u5834\u5408\u3001\u5408\u308f\u305b\u308b<br \/>\n\u3000\u3000\u5fc5\u8981\u304c\u3042\u308b\u6a21\u69d8(\u56de\u907f\u7b56\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069\u308f\u304b\u3089\u306a\u3044(\u7b11))<br \/>\n\u3000\u3000\u306a\u305c\u305b\u3089\u3001cgi\u306falias\u3060\u3068forbidden\u3068\u306a\u308a\u52d5\u4f5c\u3057\u306a\u3044\u304b\u3089<br \/>\n\u3000\u3000root \u3067\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044<\/p>\n<p>\u3000\u3000\u3053\u306e\u305f\u3081\u3001\u5b9f\u4f53\u304c\"\/usr\/lib\/zoneminder\/cgi-bin\"\u306b\u3042\u308b\u3082\u306e\u3092<br \/>\n\u3000\u3000location \/zm\/cgi-bin\/\u3000\u3068\u8a2d\u5b9a\u3067\u304d\u306a\u3044\u306e\u3067<br \/>\n\u3000\u3000apache\u3068\u4e92\u63db\u3092\u3082\u305f\u305b\u308b\u306a\u3089\u3001\/usr\/lib\/zoneminder\/cgi-bin\u3092<br \/>\n\u3000\u3000\/usr\/lib\/zoneminder\/zm\/cgi-bin \u306b\u30b3\u30d4\u30fc\u3057\u3066\u3001\u4e0a\u8a18\u306econfig<br \/>\n\u3000\u3000\u3067\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044<\/p>\n<pre><p>        <code>location \/zm\/api\/ {\n            root  \"\/usr\/share\/zoneminder\/www\/\";\n            allow all;\n            rewrite ^\/zm\/api(.+)$ \/zm\/api\/index.php?p=$1 last;\n        }<\/code><\/p><\/pre>\n<p>\u203b cgi-bin\u3068\u540c\u3058\u7406\u7531\u3067<br \/>\n\u3000\u3000\"\/usr\/share\/zoneminder\/www\/api\"\u3092<br \/>\n\u3000\u3000\"\/usr\/share\/zoneminder\/www\/zm\/api\"\u306b\u30b3\u30d4\u30fc\u3057\u3066\u3001root\u306b\u3088\u308b<br \/>\n\u3000\u3000\u53c2\u7167\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308b<\/p>\n<p>\u3000\u3000\u8a2d\u5b9a\u304c\u7d42\u308f\u3063\u305f\u3089 service nginx restart \u5fd8\u308c\u305a\u306b!<\/p>\n\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ZoneMinder\u3092Nginx\u3067\u904b\u7528\u3059\u308b\u969b\u306e\u30b3\u30c4 \u2460\u3000PHP\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306b\u3064\u3044\u3066 \u3000\u3000PHP\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u304c\u672a\u8a2d\u5b9a\u306e\u5834\u5408\u3001 \u3000\u3000\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u3060\u3051\u306b\u306a\u308b \u3000\u3000\/etc\/php\/7.0\/fpm\/php.ini \u3000\u3000 &hellip; <a href=\"https:\/\/eng.miteel.net\/?page_id=1305\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">nginx\u3067zoneminder (Zm)\u3092\u52d5\u304b\u3059<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":584,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1305","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/eng.miteel.net\/index.php?rest_route=\/wp\/v2\/pages\/1305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eng.miteel.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/eng.miteel.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/eng.miteel.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/eng.miteel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1305"}],"version-history":[{"count":4,"href":"https:\/\/eng.miteel.net\/index.php?rest_route=\/wp\/v2\/pages\/1305\/revisions"}],"predecessor-version":[{"id":1357,"href":"https:\/\/eng.miteel.net\/index.php?rest_route=\/wp\/v2\/pages\/1305\/revisions\/1357"}],"up":[{"embeddable":true,"href":"https:\/\/eng.miteel.net\/index.php?rest_route=\/wp\/v2\/pages\/584"}],"wp:attachment":[{"href":"https:\/\/eng.miteel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}