dd if=Rocky-10.2-x86_64-dvd1.iso of=/dev/sda bs=4M status=progress oflag=direct
timedatectl set-timezone Asia/Tokyo
localectl set-locale LANG=ja_JP.utf8
nmcli general hostname rockyi7
nmcli c delete internet
nmcli c add type ethernet ifname enp4s0 con-name "internet" ethernet.mtu 1500
nmcli connection modify internet ipv4.method manual ipv4.addresses 192.168.1.197/24
nmcli connection modify internet ipv4.dns 8.8.8.8
nmcli connection modify internet ipv4.gateway 192.168.1.1
nmcli connection modify internet connection.autoconnect yes
nmcli connection up internet
systemctl daemon-reload
systemctl restart NetworkManager
nmcli connection modify internet 802-3-ethernet.wake-on-lan magic
nmcli connection up internet
ethtool enp4s0 # 確認
Supports Wake-on: pumbg
Wake-on: g
# CRB リポジトリの有効化
dnf config-manager --set-enabled crb
# EPEL リポジトリのインストールと有効化
dnf install -y epel-release
# パッケージキャッシュの更新
dnf makecache
dnf install -y ibus ibus-anthy
GNOME 設定から
日本語(Anthy)
英語(US)
[epel]
...
excludepkgs=zabbix*
# rpm -Uvh https://repo.zabbix.com/zabbix/8.0/release/rocky/10/noarch/zabbix-release-latest-8.0.el10.noarch.rpm
# dnf clean all
# dnf install zabbix-agent2 zabbix-agent2-plugin-postgresql
# systemctl restart zabbix-agent2
# systemctl enable zabbix-agent2
# firewall-cmd --add-port=10050/tcp --zone=public --permanent
# firewall-cmd --reload
# dnf install zabbix-selinux-policy
# vi /etc/zabbix/zabbix_agent2.conf
Server=192.168.1.xxx
# dnf install gnome-tweaks # 古いのでいらない。
$ sudo dnf install gnome-browser-connector
$ dnf search gnome-shell-extension
$ sudo dnf install gnome-shell-extension-apps-menu gnome-shell-extension-places-menu
$ sudo dnf install gnome-shell-extension-desktop-icons
$ sudo dnf install gnome-shell-extension-system-monitor
$ sudo dnf install gnome-shell-extension-no-overview
$ sudo dnf install gnome-shell-extension-window-list
$ sudo dnf install gnome-shell-extension-user-theme
$ sudo dnf install gnome-shell-extension-dash-to-dock.noarch
$ sudo dnf install gnome-shell-extension-places-menu
$ dnf list installed |grep gnome-shell-extension
gnome-shell-extension-appindicator.noarch 61-1.el10_2 @epel
gnome-shell-extension-apps-menu.noarch 49.0-7.el10_3 @appstream
gnome-shell-extension-background-logo.noarch 49.0-1.el10 @AppStream
gnome-shell-extension-blur-my-shell.noarch 70-1.el10_2 @epel
gnome-shell-extension-caffeine.noarch 58-1.el10_2 @epel
gnome-shell-extension-common.noarch 49.0-7.el10_3 @appstream
gnome-shell-extension-dash-to-dock.noarch 102-1.el10 @appstream
gnome-shell-extension-desktop-icons.noarch 49.0-7.el10_3 @appstream
gnome-shell-extension-drive-menu.noarch 49.0-7.el10_3 @appstream
gnome-shell-extension-just-perfection.noarch 35.0-1.el10_2 @epel
gnome-shell-extension-launch-new-instance.noarch 49.0-7.el10_3 @appstream
gnome-shell-extension-no-overview.noarch 49-1.el10 @crb
gnome-shell-extension-places-menu.noarch 49.0-7.el10_3 @appstream gnome-shell-extension-system-monitor.noarch 49.0-7.el10_3 @appstream
gnome-shell-extension-user-theme.noarch 49.0-7.el10_3 @appstream
gnome-shell-extension-window-list.noarch 49.0-7.el10_3 @appstream
$ gnome-extensions list
$ gnome-extensions enable apps-menu@gnome-shell-extensions.gcampax.github.com
$ gnome-extensions enable places-menu@gnome-shell-extensions.gcampax.github.com
$ gnome-extensions-app #手動でEnable
【Appsメニューカスタマイズ】
# find /usr/share ~/.local/share -path "*/ja/*" -name "*gnome-shell-extension*.mo" 2>/dev/nullMO_FILE="/home/takahab/.local/share/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/locale/ja/LC_MESSAGES/gnome-shell-extension-apps-menu.mo"
cp "$MO_FILE" "${MO_FILE}.bak"
msgunfmt "$MO_FILE" -o ~/apps-menu.po
sed -i '/msgid "Apps"/{n;s/msgstr "アプリ"/msgstr "アプリケーション"/}' ~/apps-menu.po
msgfmt ~/apps-menu.po -o "$MO_FILE"
logout→login
【CPU温度、ファン】
https://extensions.gnome.org/extension/1460/vitals/
cd /usr/src
sudo git clone https://github.com/Fred78290/nct6687d ※TOMAHAWK X670Ecd nct6687d
$ pip install gunicorn
$ sudo vi /etc/systemd/system/gunicorn.service << __EOF__
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=nginx
Group=nginx
WorkingDirectory=/var/www/DjangoNextAuth/backend
Environment="PYTHONPATH=/var/www/DjangoNextAuth/.venv/lib/python3.14/site-packages"
ExecStart=/usr/bin/python3.14 /var/www/DjangoNextAuth/.venv/bin/gunicorn \
--workers 3 \
--bind 127.0.0.1:8000 \
Config.wsgi:application
[Install]
WantedBy=multi-user.target
__EOF__
# systemctl daemon-reload
# systemctl restart gunicorn
# systemctl status gunicorn
sudo make dkms/install
sudo modprobe nct6687
sudo dnf install -y lm_sensors
sudo sensors-detect
sensors
再起動後も自動読み込み
echo "nct6687" | sudo tee /etc/modules-load.d/nct6687.conf
下記は、古い拡張機能がはいってしまうので、上記手順で拡張機能をON
Apps Menu
Places Status Indicator
Places Status Indicator
#Dash to Panel #古い
Vitals
windows list
【Google chrome】
# cat << 'EOF' > /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub
EOF
#dnf makecache
# dnf install -y google-chrome-stable
※Googleアカウント移行
【LibreOffice】
# flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# flatpak install flathub org.libreoffice.LibreOffice
再ログイン(一回ログアウトするとアプリメニューに登録される)
【GIMP】
# flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# flatpak install flathub org.gimp.GIMP
# dnf install ImageMagick
【プリンタードライバ】
# rpm -ihv --nodeps dcpj982npdrv-1.0.5-1.i386.rpm
# rpm -qa | grep -e dcp
dcpj982npdrv-1.0.5-1.i386
【スキャナ】
# dnf install sane-backends sane-backends-drivers-scanners sane-backends-daemon libnsl
# rpm -ivh --nodeps brscan4-0.4.11-2.x86_64.rpm
# firewall-cmd --add-port=54925/udp --permanent
# firewall-cmd --add-port=54921/tcp --permanent
# firewall-cmd --reload
# dnf install -y sane-backends-daemon
# systemctl daemon-reload
# systemctl enable --now saned.socket
# flatpak install flathub org.kde.skanlite
# brsaneconfig4 -a name=DCP-J982N model=DCP-J982N ip=192.168.1.200
# flatpak override org.kde.skanlite --env=SANE_NET_HOSTS=localhost
# scanimage -L
device `brother4:net1;dev0' is a Brother DCP-J982N DCP-J982N
【cursor】
ここからrpmをダウンロード
https://cursor.com/ja/download
# dnf install cursor-3.30.14.el8.x86_64.rpm
右上からIDE起動
拡張機能→Japanese Language Pack for Visial Studio Code
vim
cntl+shift+P → Configure Display Langage → 日本語
Vim emulation for Visual Studio Code
Color Theme → Monokai
AutoRenameTag
CSS Peak
Error Lens
ESLint
GItLens
Japanize Language Pack for Visual Studil Code
Prettier-Code formatter
Python
Phyton Debugger
Django
djLing
djLing
Database Client JDBC
SQLTools
1) Ctrp + Shift + P Preferences: Color Theme
2) Ctrl + Shift + J Agnets → Default Model→Last Used
3) Ctrl + Shift + P settings →Genaral→テキストエディタ→ FONT16→18
【マウスサイズ】
設定→アクセスビリティ→表示中→カーソルの大きさ(特大)
【ssh 公開鍵】
$ ssh-keygen -t ed25519 -C ホスト名
$ ssh-copy-id -i ~/.ssh/id_ed25519.pub ユーザー名@サーバーのIPアドレス
$ ssh -i ~/.ssh/id_ed25519 ユーザー名@サーバーのIPアドレス
$ mkdir ~/.ssh/config.d
$ vi ~/.ssh/config __EOF__
Include ~/.ssh/config.d/*.conf
__EOF__
$ vi ~/.ssh/config.d/home.conf <<__EOF__
Host rocky7950
HostName 192.168.1.198
User ユーザー名
IdentityFile ~/.ssh/rocky7950/id_ed25519
__EOF__
$ chmod go-rwx ~/.ssh/config ~/.ssh/config.d ~/.ssh/config.d/*
# vi /etc/ssh/sshd_config # サーバ側(リモート)
PasswordAuthentication no
【データコピー】
$ ssh rocky7950 "tar czf - -C ~ Make" | tar xzf -
$ ssh rocky7950 "tar czf - -C ~ ドキュメント" | tar xzf -
【VIM】
$ ssh rocky7950 "tar czf - -C ~ .vimrc" | tar xzf -
# ln -s /usr/bin/vim /usr/local/bin/vi
# hash -r
【nginx】
本家のnginxリポジトリからインストール# systemctl stop httpd
# systemctl disable httpd
# cat << 'EOF' > /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=https://nginx.org
gpgcheck=1
enabled=1
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=https://nginx.org
gpgcheck=1
enabled=0
module_hotfixes=true
EOF
# dnf install --nogpgcheck nginx
# systemctl start nginx
# systemctl enable nginx
# firewall-cmd --permanent --add-service=http
# firewall-cmd --permanent --add-service=https
# firewall-cmd --reload
# nginx -t
# systemctl restart nginx
# setsebool -P httpd_can_network_connect 1
※確認
$ curl -I https://office.dom.mydns.jp
HTTP/1.1 200 OK
Server: nginx/1.30.8
Date: Tue, 24 Nov 2026 04:43:02 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 9593
Connection: keep-alive
X-Frame-Options: DENY
Content-Security-Policy: default-src 'self'; base-uri 'self'; object-src 'none'; form-action 'self'; frame-ancestors 'none'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self' https://dom.mydns.jp https://office.dom.mydns.jp; img-src 'self' data: blob: https://dom.mydns.jp https://office.dom.mydns.jp; font-src 'self' data:
X-Content-Type-Options: nosniff
Vary: rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch, Accept-Encoding
x-nextjs-cache: HIT
x-nextjs-prerender: 1
x-nextjs-prerender: 1
link: </>; rel=preconnect; crossorigin=""
x-nextjs-stale-time: 300
Cache-Control: s-maxage=31536000
ETag: "d6dua02rsm7dh"
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
【PYTHON・Django開発環境】
※先にデータベースを構築
$ sudo dnf update -y
$ sudo dnf install -y python3.14 python3.14-pip
$ sudo dnf install -y python3.14-devel gcc libpq-devel
$ sudo ln -s /usr/pgsql-19/bin/pg_config /usr/local/bin/pg_config
$ cd DjangoNextAuth/backend
./clean all
./env create
■gunicorn 起動
※本番環境構築後に実施。
$ cd /home/takahab/Make/DjangoNextAuth/backend
$ . ./env$ pip install gunicorn
$ sudo vi /etc/systemd/system/gunicorn.service << __EOF__
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=nginx
Group=nginx
WorkingDirectory=/var/www/DjangoNextAuth/backend
Environment="PYTHONPATH=/var/www/DjangoNextAuth/.venv/lib/python3.14/site-packages"
ExecStart=/usr/bin/python3.14 /var/www/DjangoNextAuth/.venv/bin/gunicorn \
--workers 3 \
--bind 127.0.0.1:8000 \
Config.wsgi:application
[Install]
WantedBy=multi-user.target
__EOF__
# systemctl daemon-reload
# systemctl restart gunicorn
# systemctl status gunicorn
※アプリのデプロイ
# mkdir /share
# chown nginx:nginx /share
$ cd /home/takahab/Make/DjangoNextAuth
$ ./deploy
【NEXTJS環境】
# PM2をグローバルにインストール
# dnf install nodejs-npm
# npm install -g pm2
【サーバ証明書】Let'sEncryptのSSL証明書
# firewall-cmd --add-service=http --permanent
# firewall-cmd --add-service=https --permanent
firewall-cmd --reload
※firewall-cmd --remove-service=http --permanent
※firewall-cmd --reload
# vi /etc/nginx/conf.d/office.dom.mydns.jp.conf <<__EOF__
server {
listen 80;
server_name office.dom.mydns.jp;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
__EOF__
# nginx -t
# systemctl reload nginx
# dnf install -y epel-release
# dnf install -y certbot python3-certbot-nginx
# certbot --nginx -d office.dom.mydns.jp # conf.d/99_office.dom.mydns.jp.conf 自動追加
systemctl reload nginx
systemctl restart nginx
■サーバ証明書自動更新(90日)
# 自動更新タイマーの有効化と確認
sudo systemctl enable --now certbot-renew.timer
sudo systemctl status certbot-renew.timer
# 更新の予行演習(エラーが出なければOK)
sudo certbot renew --dry-run
【postgres】
# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# vi /etc/yum.repos.d/pgdg-redhat-all.repo # 該当バージョン意外をDISEBLE
# dnf install -y postgresql19-server postgresql19
# /usr/pgsql-19/bin/postgresql-19-setup initdb
# systemctl enable --now postgresql-19
# passwd postgres
# su - postgres
$ psql -V
psql (PostgreSQL) 19.0
$ psql
alter user postgres with password 'password';
exit
$ vi /var/lib/pgsql/19/data/pg_hba.conf
#local all all peer
host all all 127.0.0.1/32 scram-sha-256
host all all 192.168.1.0/24 scram-sha-256
$ vi /var/lib/pgsql/19/data/postgresql.conf
listen_addresses = '*'
port = 5432
max_connections = 100
log_timezone = 'Asia/Tokyo'
timezone = 'Asia/Tokyo'
lc_messages = 'ja_JP.utf8' # locale for system error message
lc_monetary = 'ja_JP.utf8' # locale for monetary formatting
lc_numeric = 'ja_JP.utf8' # locale for number formatting
lc_time = 'ja_JP.utf8'
# systemctl restart postgresql-19
# firewall-cmd --add-port=5432/tcp --zone=public --permanent
# firewall-cmd --reload
【データディレクトリの変更】
$ psql
show config_file ;
show data_directory;
# systemctl stop postgresql-19.service
# mkdir -p /pg_data/data
# chown postgres:postgres /pg_data
# chown postgres:postgres /pg_data/data
# chmod -R 700 /pg_data/data
# rsync -av /var/lib/pgsql/19/data/ /pg_data/data
# vi /var/lib/pgsql/19/data/postgresql.conf
data_directory = '/pg_data/data'
# vi /lib/systemd/system/postgresql-19.service
#Environment=PGDATA=/var/lib/pgsql/19/data/
Environment=PGDATA=/pg_data/data/
# systemctl daemon-reload
# systemctl start postgresql-19
■ Django データベース作成
$ cd ~/Make/DjangoNextAuth/backend
$ ./build initdatabase
【dbeaver】
URL: https://dbeaver.io/download/
# dnf install dbeaver-ce-26.2.5-linux-x86_64.rpm
# dnf install dbeaver-ce-26.2.5-linux-x86_64.rpm
# DjangoNextAuth/backend/Config/.env ID/PW
【zabbix】
https://www.zabbix.com/jp/download?zabbix=8.0&os_distribution=rocky_linux&os_version=10&components=server_frontend_agent_2&db=pgsql&ws=nginx
画面内の手順にしたがってインストール
※ZABBIX8.0は、まだPostgres19に対応していないため待機。
下記設定だけは先にしておく。
# vi /etc/zabbix/zabbix_server.conf
AllowUnsupportedDBVersions=1
【KVM】
dnf install qemu-kvm libvirt virt-install
dnf install virt-manager
./virctl spool create
./verctl vlan create
./verctl host define
./verctl host start
【保存版】Rocky Linux 10 リモートデスクトップ(システムモード)設定手順
すべてサーバー側の
root ユーザー(または各コマンドの頭に sudo を付与)で実行します。1. システム用の証明書配置ディレクトリを作成する
bash
mkdir -p /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop
コードは注意してご使用ください。
2. 絶対パスに配置する自己署名証明書(10年有効)を生成する
bash
openssl req -new -x509 -days 3650 -nodes -newkey rsa:2048 \
-keyout /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.key \
-out /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crt \
-subj "/CN=Rocky10-System-RDP"
コードは注意してご使用ください。
3. 生成したファイルの所有権を専用ユーザーに変更する
bash
chown -R gnome-remote-desktop:gnome-remote-desktop /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop
コードは注意してご使用ください。
4. 生成した正しい「絶対パス」をシステム(--system)に登録する
bash
grdctl --system rdp set-tls-cert /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.crt
grdctl --system rdp set-tls-key /var/lib/gnome-remote-desktop/.local/share/gnome-remote-desktop/tls.key
コードは注意してご使用ください。
5. RDP接続用のユーザー名とパスワードを登録する
- ※
takahab-rdpや password は任意の設定値に置き換え可能です。
bash
grdctl --system rdp set-credentials 'takahab-rdp' 'password'
コードは注意してご使用ください。
6. 閲覧のみモードを解除し、システムモードのRDPを有効化する
bash
grdctl --system rdp disable-view-only
grdctl --system rdp enable
コードは注意してご使用ください。
7. ファイアウォールを開放する
bash
firewall-cmd --permanent --add-service=rdp
firewall-cmd --reload
コードは注意してご使用ください。
8. サービスを有効化(常駐)&起動する
bash
systemctl enable gnome-remote-desktop
systemctl restart gnome-remote-desktop
コードは注意してご使用ください。
クライアント(接続元)からの接続コマンド
bash
xfreerdp /v:[サーバーのIP] /u:takahab-rdp /size:3200x1800 /dynamic-resolution /cert:ignore
コードは注意してご使用ください。
- 1段階目のパスワード: xxxxxx(上記手順5で決めたもの)
- 2段階目の画面操作: Linux標準のログイン画面が表示されるので、実在するユーザー(
takahabなど)を選択して、Linux本体のパスワードを入力。
こちらのまとめ手順で、頭の中やメモはすっきりと整理できましたでしょうか?
もし今回の設定に関して、「PCが再起動したときにも自動で起動するかテストしたい」や「画面の解像度や挙動をさらに微調整したい」などがあれば、いつでもお声がけください!
もし今回の設定に関して、「PCが再起動したときにも自動で起動するかテストしたい」や「画面の解像度や挙動をさらに微調整したい」などがあれば、いつでもお声がけください!

0 件のコメント:
コメントを投稿