CONTENTS


Lastmodified 2024-03-28 (木) 10:39:55


Debian 11

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

初期設定

https://korodes.com/debian11_02/

 apt update
 apt list --upgradable
 apt upgrade

Screen

https://bacchi.me/linux/how-2-use-screen/

# apt-get install screen

putty

端末 > 高度な設定 > Alternate 端末画面への切り替えを無効にする(W)

にチェックを入れます。スクロールバックが有効になる。

Debian 11 にPHP 7.4 をインストール

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

OSインストール時にインストール済みとのこと。

~# apachectl -v
Server version: Apache/2.4.56 (Debian)
Server built:   2023-04-02T03:06:01

https://linux.net-japan.info/bullseye03.html

設定

https://nanbu.marune205.net/2021/12/debian-apache2-dir.html?m=1

locate インストール

$ 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 インストール

https://korodes.com/debian11_09/

参考URLに従ってMySQLをインストールしようとするとMariaDBのコンポーネントがあって競合し、インストール出来ない。

どうやら、OSインストール時に標準でMariaDBがインストールされているような。

ので、移転元と同じ、MySQLをインストールしたいと。

MariaDBを消去してMySQL Comunnity Serverを入れる

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 : インストール

https://www.server-world.info/query?os=Debian_11&p=mariadb&f=1

How to Install phpMyAdmin in Debian 11

https://wiki.crowncloud.net/?How_to_Install_PhpMyAdmin_in_Debian_11

phpMyAdmin の設定で久しぶりにハマる!

https://qiita.com/mighty-n/items/8ec2bd5c140eee83d9b0

MariaDB [(none)]> set password for root@localhost=password('');

データのインポートで、

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 パスワードの設定

https://www-creators.com/archives/5574

Postfix

https://www.mk-mode.com/blog/2021/12/08/debian-11-postfix-installation/

OpenPNE3 移行

 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)

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 証明書の更新

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.

Apache2 : SSL/TLS の設定

Apache2 SSL/TLS の設定


Total access 457:本日 1:昨日 1

Counter: 457, today: 1, yesterday: 1

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-03-28 (木) 10:39:55