- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2023-06-06T17:14:55+09:00","default:kuji","kuji")
#author("2024-06-07T08:11:55+09:00","default:kuji","kuji")
CONTENTS
#contents
----
Lastmodified &lastmod;
----
*Debian 11 [#e2d227b4]
https://kb.seeck.jp/archives/21576
バージョン確認
~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
**初期設定 [#yb8477bf]
https://korodes.com/debian11_02/
apt update
apt list --upgradable
apt upgrade
**Screen [#z4fc304f]
https://bacchi.me/linux/how-2-use-screen/
# apt-get install screen
***putty [#u9b3070e]
端末 > 高度な設定 > Alternate 端末画面への切り替えを無効にする(W)
にチェックを入れます。スクロールバックが有効になる。
**Debian 11 にPHP 7.4 をインストール [#n1b7b4c7]
https://qiita.com/witchcraze/items/8286bed367bb33338e47
# apt update;apt install -y php
root@debian:~# which php
/usr/bin/php
root@debian:~# php -v
PHP 7.4.33 (cli) (built: Feb 22 2023 20:07:47) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
# apt show php
Package: php
Version: 2:7.4+76
Priority: optional
Section: php
Source: php-defaults (76)
Maintainer: Debian PHP Maintainers <team+pkg-php@tracker.debian.org>
Installed-Size: 13.3 kB
Depends: php7.4
Download-Size: 6,340 B
APT-Manual-Installed: yes
APT-Sources: http://deb.debian.org/debian bullseye/main amd64 Packages
Description: サーバーサイド・HTML埋め込みスクリプト言語 (デフォルト)
PHP (PHP: Hypertext Preprocessor の再帰的頭字語) は広く使われている
オープンソースな汎用スクリプト言語で、特にウェブ開発に適しており、
HTML に組み込むことができます。
.
本パッケージは、最新安定版の PHP バージョン (現在 7.4) に
依存する依存性パッケージです。
**Apache2 [#uddb42f0]
OSインストール時にインストール済みとのこと。
~# apachectl -v
Server version: Apache/2.4.56 (Debian)
Server built: 2023-04-02T03:06:01
https://linux.net-japan.info/bullseye03.html
***設定 [#fa4fd55d]
https://nanbu.marune205.net/2021/12/debian-apache2-dir.html?m=1
**locate インストール [#ref2e9fd]
$ su #rootユーザーに切り替える
# apt-get install mlocate
https://tsukadaryo.com/debian%E3%81%ABlocate%E3%83%BBvim%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/
locate: stat () `'/var/lib/mlocate/mlocate.db' できません: そのようなファイルやディレクトリはありません
と言われたときには、
# updatedb
https://qiita.com/usizou/items/6b66ca4a77c67e1a1960
**MySQL インストール [#s089f092]
https://korodes.com/debian11_09/
参考URLに従ってMySQLをインストールしようとするとMariaDBのコンポーネントがあって競合し、インストール出来ない。
どうやら、OSインストール時に標準でMariaDBがインストールされているような。
ので、移転元と同じ、MySQLをインストールしたいと。
**MariaDBを消去してMySQL Comunnity Serverを入れる [#f7adf884]
https://www.servernote.net/article.cgi?id=remove-mariadb-and-install-mysql-community-server
Gitから直接ソースを取ってくるが、そのときキーが必要となる。
MySQLをインストールしようとしたが、結果として、Debian 11 Bulsseye は、Gitキーの期限切れで2023年5月22日現在、インストール出来なく成っている。
なので、今一度MariaDBをインストール。
**MariaDB 10.5 : インストール [#web0c5fd]
https://www.server-world.info/query?os=Debian_11&p=mariadb&f=1
**How to Install phpMyAdmin in Debian 11 [#w6ec59d6]
https://wiki.crowncloud.net/?How_to_Install_PhpMyAdmin_in_Debian_11
***phpMyAdmin の設定で久しぶりにハマる! [#cbbcb1f8]
https://qiita.com/mighty-n/items/8ec2bd5c140eee83d9b0
MariaDB [(none)]> set password for root@localhost=password('');
***データのインポートで、 [#sb07154d]
Fatal error: Maximum execution time of 300 seconds exceeded in /usr/share/php/PhpMyAdmin/SqlParser/Lexer.php on line 879
というエラー。
https://codeisle.info/blog/485/
~# locate config.default.php
/usr/share/phpmyadmin/libraries/config.default.php
$cfg['ExecTimeLimit'] = 300; ←ここを 0 とすると無制限だそう
***root パスワードの設定 [#qc82d7b1]
https://www-creators.com/archives/5574
**Postfix [#t27e3598]
https://www.mk-mode.com/blog/2021/12/08/debian-11-postfix-installation/
*OpenPNE3 移行 [#ge307abe]
461 cp -au /var/www/OpenPNE392/plugins/. /var/www/OpenPNE36/plugins
465 ./symfony doctrine:build-model
466 ./symfony cc
467 ./symfony openpne:migrate
468 ./symfony plugin:publish-assets
migrating of opBlogPlugin encountered the following errors:
Error #1 - SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP FOREIGN KEY `blog_rss_cache_member_id_member_id`; check that it exists. Failing Query: "ALTER TABLE `blog_rss_cache` DROP FOREIGN KEY blog_rss_cache_member_id_member_id"
SQLSTATE[HY000]: General error: 1005 Can't create table `PNE36`.`ashiato` (errno: 121 "Duplicate key on write or update"). Failing Query: "ALTER TABLE ashiato ADD CONSTRAINT ashiato_member_id_to_member_id FOREIGN KEY (member_id_to) REFERENCES member(id) ON DELETE SET NULL". Failing Query: ALTER TABLE ashiato ADD CONSTRAINT ashiato_member_id_to_member_id FOREIGN KEY (member_id_to) REFERENCES member(id) ON DELETE SET NULL
SQLSTATE[HY000]: General error: 1005 Can't create table `PNE36`.`ashiato` (errno: 121 "Duplicate key on write or update").
Failing Query: "ALTER TABLE ashiato ADD CONSTRAINT ashiato_member_id_to_member_id FOREIGN KEY (member_id_to) REFERENCES member(id) ON DELETE SET NULL".
Failing Query: ALTER TABLE ashiato ADD CONSTRAINT ashiato_member_id_to_member_id FOREIGN KEY (member_id_to) REFERENCES member(id) ON DELETE SET NULL
https://yakst.com/ja/posts/2851
*SSL 証明書を取得する (Let's Encrypt) [#g0873591]
https://www.server-world.info/query?os=Debian_11&p=ssl&f=2
~# certbot certonly --webroot -w /var/www/html -d k222.kuji-clinic.net
**SSL 証明書の更新 [#g8ab36de]
root@debian:~# apachectl stop
root@debian:~# certbot certonly --standalone -d sns.kuji-clinic.net
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Cert is due for renewal, auto-renewing...
Renewing an existing certificate for sns.kuji-clinic.net
Performing the following challenges:
http-01 challenge for sns.kuji-clinic.net
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/sns.kuji-clinic.net/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/sns.kuji-clinic.net/privkey.pem
Your certificate will expire on 2024-06-26. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again. To non-interactively renew *all* of your
certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
root@debian:~# apachectl start
Invoking 'systemctl start apache2'.
Use 'systemctl status apache2' for more info.
*** # 手動で更新する場合は以下 [#y5073a5f]
root@k221:~# apachectl stop
root@k221:~# certbot renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log
: :
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all renewals succeeded:
/etc/letsencrypt/live/k221.kuji-clinic.net/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
root@k221:~# apachectl start
Invoking 'systemctl start apache2'.
Use 'systemctl status apache2' for more info.
**Apache2 : SSL/TLS の設定 [#kcd071e9]
[[Apache2 SSL/TLS の設定:https://www.server-world.info/query?os=Debian_11&p=httpd&f=3]]
----
Total access &counter(total);:本日 &counter(today);:昨日 &counter(yesterday);
#counter([total|today|yesterday]);