-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bash cgi でカウンター作成 #3
Comments
Github で描画できないmarkdown の画像を描画する方法で、Github ではレンダリングされない事象が発生。 同じことをローカルでやったら、無事表示される 🤔 h2 のせい?デベロッパーツールを見ると、h2 で fix されてそう。 現状、h2 でアクセスしても h1.1 に回されてそう curl --http2 -v https://kokoichi0206.mydns.jp/cgi-bin/counter
* Trying 240f:74:c9f6:1:dea6:32ff:feb4:6b83:443...
* Connected to kokoichi0206.mydns.jp (240f:74:c9f6:1:dea6:32ff:feb4:6b83) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: CN=kokoichi0206.mydns.jp
* start date: Aug 9 08:41:19 2022 GMT
* expire date: Nov 7 08:41:18 2022 GMT
* subjectAltName: host "kokoichi0206.mydns.jp" matched cert's "kokoichi0206.mydns.jp"
* issuer: C=US; O=Let's Encrypt; CN=R3
* SSL certificate verify ok.
> GET /cgi-bin/counter HTTP/1.1
> Host: kokoichi0206.mydns.jp
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Thu, 06 Oct 2022 13:35:03 GMT
< Server: Apache
< Vary: Accept-Encoding
< Content-Length: 1001
< Connection: close
< Content-Type: image/svg+xml;charset=utf-8\n
... h2 に変更できない? sudo service apache2 restart これで有効になったことになるのか? $ curl -Iks --http2 https://kokoichi0206.mydns.jp/cgi-bin/counter
HTTP/1.1 200 OK
Date: Thu, 06 Oct 2022 14:13:11 GMT
Server: Apache
Upgrade: h2
Connection: Upgrade, close
Vary: Accept-Encoding
Content-Length: 1001
Content-Type: image/svg+xml;charset=utf-8\n |
h2 を有効にする。。。$ cat error.log | grep AH100
[Thu Oct 06 14:26:27.793461 2022] [http2:warn] [pid 238346] AH10034: The mpm
module (prefork.c) is not supported by mod_http2. The mpm determines how things
are processed in your server. HTTP/2 has more demands in this regard and the currently
selected mpm will just not do. This is an advisory warning. Your server will continue
to work, but the HTTP/2 protocol will be inactive. Temporary failure resolving 'ppa.launchpad.net'$ sudo apt-get install php7.4-fpm
Temporary failure resolving 'ppa.launchpad.net'
Err:13 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main arm64 php7.4-fpm arm64 1:7.4.32-1+ubuntu20.04.1+deb.sury.org+2 このサイトに従ったらできるよになった $ sudo vi /etc/resolv.conf 以下を追加。
また、ネットワークファイルにも追加。(https://github.com/kokoichi206/routines/issues/3#issuecomment-1269516533) 実際にやたことgrep LoadModule -r . # https://idkuu.com/package-php7-4-fpm-is-not-available-but-is-referred-to-by-another-package
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
# https://http2.co/how-to-fix-ah10034-the-mpm-module-prefork-c-is-not-supported-by-mod_http2/
sudo apt-get install php7.4-fpm
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.4-fpm
sudo a2dismod php7.4
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo apachectl start h2 にはなったが、Type が document ??curl -Iks --http2 https://kokoichi0206.mydns.jp/cgi-bin/counter
HTTP/2 200
vary: Accept-Encoding
content-length: 1001
content-type: image/svg+xml;charset=utf-8\n
date: Thu, 06 Oct 2022 16:01:33 GMT
server: Apache |
何が悪いかわからんやったこと
わかってしまった!なんかGithubに画像表示されんなーって思ったら、ラズパイのプライベート IP 変えたことによる影響やった! CERTIFICATE なんとかっていうエラー出たから、証明書関連かと思って調べてた。 mydns が 401 で弾かれてたから、直接ブラウザでアクセスしたときに、IP の設定?っていう観点から思い出した。 |
実装
camo からのアクセスログ
TODO
リンク |
http2 は一旦元に戻した |
CGI 環境変数
http://bashhp.web.fc2.com/WWW/header.html
アクセステスト
https://kokoichi0206.mydns.jp/cgi-bin/counter
リファラーチェック
https://kokoichi0206.mydns.jp/cgi-bin/referer
Internal server error
多分一番多いのは、permission を
755
にしてないことかな?リンク
The text was updated successfully, but these errors were encountered: