SST Lab Dokuwiki Header header picture

ユーザ用ツール

サイト用ツール


linux:webserver

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
linux:webserver [2021/02/24 10:51] – [蓋をしてもスリープしない] kimilinux:webserver [2022/08/23 13:34] (現在) – 外部編集 127.0.0.1
行 1: 行 1:
-====== Linux環境構築(サーバ編) ====== +====== Linux環境構築(Webサーバ編) ======
-===== Ubuntuによるデスクトップ環境構築 ===== +
-  - [[linux:Ubuntu日本語RMIXのインストール]] +
- +
- +
- +
-===== Ubuntu Serverをインストール ===== +
- +
-===== Ubuntuのアップデート/アップグレード ===== +
- +
-===== Ubuntu ServerによるWeb Serverの構築 ===== +
-  - 適当な機器に[[linux:server_install|Ubuntu Serverをインストール]]してLAMPサーバとしてセットアップしておく +
-  - [[linux:dokuwiki_install|Dokuwikiのインストール]] +
-  - [[linux:mathtex_install|MathTeXのインストール]] +
-  - [[linux:wordpress_install|WordPressのインストール]] +
- +
-===== Ubuntu ServerによるMail Serverの構築 ===== +
- +
-  - 適当な機器に[[linux:server_install|Ubuntu Serverをインストール]]してLAMPサーバとしてセットアップしておく +
-  - [[linux:Spam_Assassin|Spam Assassinのインストール]] +
- +
- +
-===== 最新のノートPCをUPS付きサーバに ===== +
-  * BIOS Boot USB Hard Disk +
- +
-===== 蓋をしてもスリープしない ===== +
- +
- +
-<code sh> $ sudo vi /etc/systemd/logind.conf </code> +
- +
-<file txt> +
-#HandleLidSwitch= suspend +
-#HandleLidSwitchExternalPower= suspend +
-#HandleLidSwitchDocked= suspend +
-</file> +
-を +
-<file txt> +
-HandleLidSwitch=ignore +
-HandleLidSwitchExternalPower=ignore +
-HandleLidSwitchDocked=ignore +
-</file> +
-に変更。 +
- +
- +
-sshで +
-  WARNING: POSSIBLE DNS SPOOFING DETECTED! +
-とか +
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! +
-とかいうときは +
- $HOME/.ssh/known_hosts +
-を編集するか +
-  ssh-keygen -R HOST名 +
-でエントリーを削除する。 +
- +
-===== 固定IPv4アドレスに ===== +
-サーバの運用は固定IPアドレスで行うのが普通。そこで固定IPアドレスを設定する。 +
-ubuntu-20.04.2の場合は +
-<code sh> +
-$ cat /etc/netplan/00-installer-config.yaml  +
-# This is the network config written by 'subiquity' +
-network: +
-  ethernets: +
-    enp3s0: +
-      addresses: +
-      - 192.168.10.4/24 +
-      gateway4: 192.168.10.254 +
-      nameservers: +
-        addresses: +
-        - 192.168.10.1 +
-        search: +
-        - ee.ous.ac.jp +
-  version: 2 +
-$  +
- +
-</code> +
-で確認できる。 +
- +
-===== Step 1: Check Virtualization Support in Ubuntu ===== +
- +
-<code sh> +
- +
-$ egrep -c '(vmx|svm)' /proc/cpuinfo +
-12 +
-$ sudo apt install cpu-checker +
-Reading package lists... Done +
-+
-+
-+
-Setting up cpu-checker (0.7-1.1) ... +
-Processing triggers for man-db (2.9.1-1) ... +
-$ sudo kvm-ok +
-INFO: /dev/kvm exists +
-KVM acceleration can be used +
-$  +
-</code> +
- +
-===== Step 2: Install KVM on Ubuntu 20.04 LTS ===== +
- +
- +
-<code sh> +
-$ sudo apt install libvirt-clients +
-$ virsh +
-Welcome to virsh, the virtualization interactive terminal. +
- +
-Type:  'help' for help with commands +
-       'quit' to quit +
- +
-virsh # quit +
-+
- +
-$ sudo apt install qemu-utils +
-$ qemu-img +
-qemu-img: Not enough arguments +
-Try 'qemu-img --help' for more information +
-+
- +
-$ sudo apt install qemu-kvm +
-$ kvm +
-Unable to init server: Could not connect: Connection refused +
-Could not access KVM kernel module: Permission denied +
-qemu-system-x86_64: failed to initialize KVM: Permission denied +
-+
- +
-$ sudo apt install virtinst +
- +
-$ sudo virsh list +
-error: failed to connect to the hypervisor +
-error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory +
- +
-$ sudo apt install libvirt-bin +
-$ sudo apt install qemu +
-$ sudo apt install qemu-kvm +
-$ sudo apt install libvirt-bin +
-$ sudo apt install virt-manager +
-$ sudo virsh list +
- Id   Name   State +
--------------------- +
- +
-$ sudo apt install bridge-utils +
-$  +
- +
- +
-</code> +
- +
-<code sh> +
-$ sudo systemctl status libvirtd +
-[sudo] password for kimi:  +
-● libvirtd.service - Virtualization daemon +
-     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor pres> +
-     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor pres> +
-● libvirtd.service - Virtualization daemon +
-     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor pres> +
-     Active: active (running) since Tue 2021-02-23 07:16:19 UTC; 2min 36s ago +
-TriggeredBy: ● libvirtd-ro.socket +
-             ● libvirtd-admin.socket +
-             ● libvirtd.socket +
-       Docs: man:libvirtd(8) +
-             https://libvirt.org +
-   Main PID: 982 (libvirtd) +
-      Tasks: 19 (limit: 32768) +
-     Memory: 41.8M +
-     CGroup: /system.slice/libvirtd.service +
-             ├─ 982 /usr/sbin/libvirtd +
-             ├─1099 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/defa> +
-             └─1100 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/defa> +
- +
-Feb 23 07:16:20 sstw dnsmasq[1099]: compile time options: IPv6 GNU-getopt DBus > +
-Feb 23 07:16:20 sstw dnsmasq-dhcp[1099]: DHCP, IP range 192.168.122.2 -- 192.16> +
-Feb 23 07:16:20 sstw dnsmasq-dhcp[1099]: DHCP, sockets bound exclusively to int> +
-Feb 23 07:16:20 sstw dnsmasq[1099]: reading /etc/resolv.conf +
-Feb 23 07:16:20 sstw dnsmasq[1099]: using nameserver 127.0.0.53#53 +
-Feb 23 07:16:20 sstw dnsmasq[1099]: read /etc/hosts - 7 addresses +
-Feb 23 07:16:20 sstw dnsmasq[1099]: read /var/lib/libvirt/dnsmasq/default.addnh> +
-Feb 23 07:16:20 sstw dnsmasq-dhcp[1099]: read /var/lib/libvirt/dnsmasq/default.> +
-Feb 23 07:16:20 sstw dnsmasq[1099]: reading /etc/resolv.conf +
-Feb 23 07:16:20 sstw dnsmasq[1099]: using nameserver 127.0.0.53#53 +
-$  +
-$ lsmod | grep -i kvm +
-kvm_intel             282624 +
-kvm                   663552  1 kvm_intel +
-$  +
-</code> +
- +
-===== Step 3: Creating a Virtual Machine in Ubuntu ===== +
- +
- +
-<code sh> +
-$ qemu-img create -f qcow2 ssp0.qcow2 150G +
-Formatting 'ssp0.qcow2', fmt=qcow2 size=161061273600 cluster_size=65536 lazy_refcounts=off refcount_bits=16 +
-+
-</code> +
- +
-<code sh> +
-~$ virt-install -n ssp0 -r 8192 --disk=ssp0.qcow2,bus=virtio --graphics vnc,password=vnc,listen=0.0.0.0,keymap=ja --noautoconsole -v --boot hd --cdrom ubuntu-20.04.2-live-server-amd64.iso  +
- +
-Starting install... +
-Domain installation still in progress. You can reconnect to  +
-the console to complete the installation process. +
-+
-</code> +
-  +
-  - Finderから「サーバへ接続」 +
-  - vnc:/ / <サーバのIPアドレス>/  +
  
linux/webserver.1614131496.txt.gz · 最終更新: 2022/08/23 13:34 (外部編集)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki