ãã®è³æã¯, panakumaãšTomoyuki KOYAMAã«ãã£ãŠäœæãããŠããŸãã
è¯ããšæã£ããã¹ã¿ãŒãã€ããŠãã ãã!!
ãã®è¬åº§ã§ã¯, VirtualMachineã䜿ã£ãŠæŒç¿ãè¡ããŸããå¿ ãVMWareç°å¢ãçšæããŠãã ãããææ¥ãšã¯å¥ã«VMãçšæããŠããããšããªã¹ã¹ã¡ããŸãã
Linuxãšã¯åœæã倧åŠçã§ãã£ãLinus TorvaldsãéçºããOS(ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã )ã§ããUNIXäºæã®OSãšããŠéçºãããŸãããLinuxã®ããã°ã©ã ã®ç¹åŸŽãšããŠã©ã€ã»ã³ã¹åœ¢æ
ãæããããŸããLinuxã®ããã°ã©ã ã«ã¯GPL(GNU General Public License)
ãšããã©ã€ã»ã³ã¹åœ¢åŒãä»äžãããŠããŸããããã«ã¯ä»¥äžã®å
容ãå«ãŸããŠããŸãã
- ããã°ã©ã ãå®è¡ããèªç±
- ãœãŒã¹ã®æ¹å€ã®èªç±
- å©çšã»åé åžã®èªç±
- æ¹è¯ããããã°ã©ã ããªãªãŒã¹ããæš©å©
(Linuxæšæºæç§æžããåŒçš)
ããããèªç±ãªåœ¢æ
ãæ¡çšããçºãéãããçµç¹ãå人ã«ãã£ãŠç¬å ãããããšãªãåºãæ®åãçºå±ããŸããã詳ããããšã¯æžç±:Unixèå€åŠ
ãªã©ã«æžãããŠããŸãã
ãµãŒããšã¯äžç¹å®å€æ°ã«ããã¢ã¯ã»ã¹ãå¯èœãªã³ã³ãã¥ãŒã¿ã
- VMware Workstation Player 12.7
- Ubuntu 17.10 x86_64
VMware Playerãèµ·åããŠVMãç«ã¡äžããŸãã
VMãèµ·åããŠãã°ã€ã³ããŸãã
å·Šäžã®ãã¿ã³ïŒã©ã³ãã£ïŒããTerminal
ãèµ·åããŸã
èµ·åãããšä»¥äžã®ç»é¢ã衚瀺ãããŸã
ãã®ãŸãŸã§ã¯ãæ¥æ¬èªã®å¯Ÿå¿ãäžå®å®ã§ãããaptã³ãã³ãã®åç §ãããµãŒããŒãã¢ã¡ãªã«ã§ããããšãããããã±ãŒãžãã€ã³ã¹ããŒã«ããæã«è¥å¹²æéãããããŸãã ãã®ãããæ¥æ¬ã§äœ¿ãã®ã«é©ããèšå®ã«å€æŽããŸãã
ãªãããããã®åŠçã¯ã¹ã¯ãªãããäœæããŠãããŸããã¿ãŒããã«ã«ä»¥äžã®ã³ãã³ããå ¥åããŠå®è¡ããŠãã ããã
wget -q -O - https://raw.githubusercontent.com/tomoyk/ServerHandson/master/setup.bash | bash
(åè) ã¹ã¯ãªããå éšã§å®è¡ããŠããåŠçã¯ä»¥äžã§ãã
echo "export LANG=ja_JP.UTF-8" >> $HOME/.bashrc
wget -q https://www.ubuntulinux.jp/ubuntu-ja-archive-keyring.gpg -O- | sudo apt-key add -
wget -q https://www.ubuntulinux.jp/ubuntu-jp-ppa-keyring.gpg -O- | sudo apt-key add -
sudo wget https://www.ubuntulinux.jp/sources.list.d/artful.list -O /etc/apt/sources.list.d/ubuntu-ja.list
sudo apt update -y
sudo apt dist-upgrade -y
sudo apt install -y ubuntu-defaults-ja
sudo systemctl reboot -i
IPã¢ãã¬ã¹ã確èªããŸããã¿ãŒããã«ã«ip a
ãå
¥åããŸãã
ebi@ubuntu:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:90:d5:eb brd ff:ff:ff:ff:ff:ff
inet 192.168.223.159/24 brd 192.168.223.255 scope global dynamic ens33
valid_lft 1152sec preferred_lft 1152sec
inet6 fe80::a8dc:fd46:8a0b:d3e9/64 scope link
valid_lft forever preferred_lft forever
ããã§192.168.x.x
ãšããæååãèŠã€ãããŸãããããããŒã«ã«ãããã¯ãŒã¯ã«ãããIPã¢ãã¬ã¹ã§ãã
ããŒã«ã«ãããã¯ãŒã¯ã®IPã¢ãã¬ã¹ã¯åœéæšæºèŠæ ŒRFC1918
ã«ãã£ãŠäžèšã®ç¯å²ã§å®ããããŠããŸãã
ã¯ã©ã¹ | IPã¢ãã¬ã¹ç¯å² |
---|---|
A | 10.0.0.0 - 10.255.255.255 (10/8 prefix) |
B | 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) |
C | 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) |
åè: ãã©ã€ããŒã網ã®ã¢ãã¬ã¹å²åœ(RFC 1918) - JPNIC
ä»å䜿ã£ãNATèšå®ã¯ãä»®æ³ãã·ã³(Virtual Machine)ããã®ãã±ãããå®æ©(Windows)ã§ã¢ãã¬ã¹ãããŒãå€æããŠå€éšãšéä¿¡ããŸãã
次ã«pingã³ãã³ã
ãå©çšããŠãããã¯ãŒã¯éä¿¡ãè¡ããã確èªããŸããã¿ãŒããã«ã«ping 8.8.8.8
ãšå
¥åããŠEnterãæŒäžããŸããçµäºããã«ã¯Ctrl + C
ãæŒããŸãã
ebi@ubuntu:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=4.43 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=4.78 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=3.98 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=128 time=4.30 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=128 time=5.06 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4010ms
rtt min/avg/max/mdev = 3.987/4.515/5.061/0.376 ms
ebi@ubuntu:~$ ping 8.8.8.7
PING 8.8.8.7 (8.8.8.7) 56(84) bytes of data.
^C
--- 8.8.8.7 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6128ms
ãµãŒãããã®å¿çãããã°å€éšãšã®éä¿¡ãåºæ¥ãŠãããšå€æã§ããŸãã
ãœãããŠã§ã¢ãã€ã³ã¹ããŒã«ããŸããWindowsã§ãœãããŠã§ã¢ãã€ã³ã¹ããŒã«ããã«ã¯ãã€ã³ã¹ããŒã©ãããŠã³ããŒãããŠå®è¡ããå¿ èŠããããŸãã
Linuxã«ã¯ãœãããŠã§ã¢ãäžå 管çããŠããããã±ãŒãžãããŒãžã£ãšãã䟿å©ãªä»çµã¿ããããŸãããã®ä»çµã¿ã«ãã£ãŠãœãããŠã§ã¢ãããã±ãŒãžãšããåäœã§ã³ãã³ãã䜿ã£ãŠç®¡çã§ããããã«ãªããŸãã
ã³ãã³ãsudo apt install [ããã±ãŒãžå]
ãå
¥åããããšã§ããã±ãŒãžãã€ã³ã¹ããŒã«ãããŸãã
次ã«ApacheãšããWebãµãŒããœãããŠã§ã¢ãããã±ãŒãžãããŒãžã£ãšå©çšããŠã€ã³ã¹ããŒã«ããŸããã¿ãŒããã«ã«ä»¥äžã®ã³ãã³ããæã¡èŸŒã¿ãŸãã
sudo apt install apache2
ebi@ubuntu:~$ sudo apt install apache2
[sudo] ebi ã®ãã¹ã¯ãŒã:
ããã±ãŒãžãªã¹ããèªã¿èŸŒãã§ããŸã... å®äº
äŸåé¢ä¿ããªãŒãäœæããŠããŸã
ç¶æ
æ
å ±ãèªã¿åã£ãŠããŸã... å®äº
以äžã®è¿œå ããã±ãŒãžãã€ã³ã¹ããŒã«ãããŸã:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap
ææ¡ããã±ãŒãž:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom
以äžã®ããã±ãŒãžãæ°ãã«ã€ã³ã¹ããŒã«ãããŸã:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap
ã¢ããã°ã¬ãŒã: 0 åãæ°èŠã€ã³ã¹ããŒã«: 8 åãåé€: 0 åãä¿ç: 0 åã
1,502 kB ã®ã¢ãŒã«ã€ããååŸããå¿
èŠããããŸãã
ãã®æäœåŸã«è¿œå 㧠6,175 kB ã®ãã£ã¹ã¯å®¹éãæ¶è²»ãããŸãã
ç¶è¡ããŸãã? [Y/n] y
確èªãåºãã®ã§y
ãå
¥åããŠEnter
ãæŒããŸã.
ååŸ:1 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libapr1 amd64 1.6.2-1 [90.9 kB]
ååŸ:2 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libaprutil1 amd64 1.6.0-2 [84.2 kB]
ååŸ:3 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libaprutil1-dbd-sqlite3 amd64 1.6.0-2 [10.5 kB]
ååŸ:4 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libaprutil1-ldap amd64 1.6.0-2 [8,660 B]
ååŸ:5 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 apache2-bin amd64 2.4.27-2ubuntu3 [968 kB]
ååŸ:6 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 apache2-utils amd64 2.4.27-2ubuntu3 [82.5 kB]
ååŸ:7 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 apache2-data all 2.4.27-2ubuntu3 [161 kB]
ååŸ:8 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 apache2 amd64 2.4.27-2ubuntu3 [95.8 kB]
1,502 kB ã 0ç§ ã§ååŸããŸãã (5,591 kB/s)
以åã«æªéžæã®ããã±ãŒãž libapr1:amd64 ãéžæããŠããŸãã
(ããŒã¿ããŒã¹ãèªã¿èŸŒãã§ããŸã ... çŸåš 113374 åã®ãã¡ã€ã«ãšãã£ã¬ã¯ããªãã€ã³ã¹ããŒã«ãããŠããŸãã)
.../0-libapr1_1.6.2-1_amd64.deb ãå±éããæºåãããŠããŸã ...
libapr1:amd64 (1.6.2-1) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž libaprutil1:amd64 ãéžæããŠããŸãã
.../1-libaprutil1_1.6.0-2_amd64.deb ãå±éããæºåãããŠããŸã ...
libaprutil1:amd64 (1.6.0-2) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž libaprutil1-dbd-sqlite3:amd64 ãéžæããŠããŸãã
.../2-libaprutil1-dbd-sqlite3_1.6.0-2_amd64.deb ãå±éããæºåãããŠããŸã ...
libaprutil1-dbd-sqlite3:amd64 (1.6.0-2) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž libaprutil1-ldap:amd64 ãéžæããŠããŸãã
.../3-libaprutil1-ldap_1.6.0-2_amd64.deb ãå±éããæºåãããŠããŸã ...
libaprutil1-ldap:amd64 (1.6.0-2) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž apache2-bin ãéžæããŠããŸãã
.../4-apache2-bin_2.4.27-2ubuntu3_amd64.deb ãå±éããæºåãããŠããŸã ...
apache2-bin (2.4.27-2ubuntu3) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž apache2-utils ãéžæããŠããŸãã
.../5-apache2-utils_2.4.27-2ubuntu3_amd64.deb ãå±éããæºåãããŠããŸã ...
apache2-utils (2.4.27-2ubuntu3) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž apache2-data ãéžæããŠããŸãã
.../6-apache2-data_2.4.27-2ubuntu3_all.deb ãå±éããæºåãããŠããŸã ...
apache2-data (2.4.27-2ubuntu3) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž apache2 ãéžæããŠããŸãã
.../7-apache2_2.4.27-2ubuntu3_amd64.deb ãå±éããæºåãããŠããŸã ...
apache2 (2.4.27-2ubuntu3) ãå±éããŠããŸã...
libapr1:amd64 (1.6.2-1) ãèšå®ããŠããŸã ...
ufw (0.35-5) ã®ããªã¬ãåŠçããŠããŸã ...
ureadahead (0.100.0-20) ã®ããªã¬ãåŠçããŠããŸã ...
apache2-data (2.4.27-2ubuntu3) ãèšå®ããŠããŸã ...
libc-bin (2.26-0ubuntu2) ã®ããªã¬ãåŠçããŠããŸã ...
libaprutil1:amd64 (1.6.0-2) ãèšå®ããŠããŸã ...
systemd (234-2ubuntu12) ã®ããªã¬ãåŠçããŠããŸã ...
man-db (2.7.6.1-2) ã®ããªã¬ãåŠçããŠããŸã ...
libaprutil1-ldap:amd64 (1.6.0-2) ãèšå®ããŠããŸã ...
libaprutil1-dbd-sqlite3:amd64 (1.6.0-2) ãèšå®ããŠããŸã ...
apache2-utils (2.4.27-2ubuntu3) ãèšå®ããŠããŸã ...
apache2-bin (2.4.27-2ubuntu3) ãèšå®ããŠããŸã ...
apache2 (2.4.27-2ubuntu3) ãèšå®ããŠããŸã ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service â /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service â /lib/systemd/system/apache-htcacheclean.service.
libc-bin (2.26-0ubuntu2) ã®ããªã¬ãåŠçããŠããŸã ...
ureadahead (0.100.0-20) ã®ããªã¬ãåŠçããŠããŸã ...
systemd (234-2ubuntu12) ã®ããªã¬ãåŠçããŠããŸã ...
ufw (0.35-5) ã®ããªã¬ãåŠçããŠããŸã ...
Apacheã®ã€ã³ã¹ããŒã«ãå®äºããŸããã
Linuxã§ã¯ã¢ããªã±ãŒã·ã§ã³1ã€ã²ãšã€ã«ããã»ã¹IDãšããIDãä»äžãããŸããããã«ãã£ãŠããã»ã¹ãåºå¥ããŠããŸããWindowsã®ã¿ã¹ã¯ãããŒãžã£ã§ããã»ã¹ãèµ·åããŠããæ§åãã€ã¡ãŒãžãããšåãããããã§ãã
Apacheã®ã€ã³ã¹ããŒã«ãçµãããšApacheã¯èªåã§èµ·åããŸãããŸããApacheã®ããã»ã¹ãååšãããpsã³ãã³ã
ã§ç¢ºèªããŸãã
ps aux | grep apache
ebi@ubuntu:~$ sudo ps -aux | grep apache
root 2590 0.0 0.4 73856 4588 ? Ss 11:49 0:00 /usr/sbin/apache2 -k start
www-data 2592 0.0 0.4 821768 4428 ? Sl 11:49 0:00 /usr/sbin/apache2 -k start
www-data 2593 0.0 0.4 821768 4428 ? Sl 11:49 0:00 /usr/sbin/apache2 -k start
ebi 2853 0.0 0.1 15380 1052 pts/0 S+ 11:57 0:00 grep --color=auto apache
衚瀺ãããçµæã®1çªå·Šãããã»ã¹ãå®è¡ããããŠãŒã¶
ãå·Šãã2çªç®ãããã»ã¹ID
ãäžçªå³ãããã»ã¹ã®å®è¡å
容(ã³ãã³ã)
ãããããè¡šããŠããŸããããã§Apacheã®ããã»ã¹ãèµ·åããŠããããšã確èªã§ããŸãã
ããŒãéæŸç¶æ³ã¯ss
ã䜿ã£ãŠç¢ºèªããŸãã| grep -i xxx
ã®éšåã§å€§æåå°æåã®åºå¥ãªãxxx
ãšããæååãæ€çŽ¢ããŸãã
ebi@ubuntu:~$ ss -ant | grep -i listen
LISTEN 0 128 *:22 *:*
LISTEN 0 5 127.0.0.1:631 *:*
LISTEN 0 128 *:5355 *:*
LISTEN 0 128 :::22 :::*
LISTEN 0 5 ::1:631 :::*
LISTEN 0 128 :::5355 :::*
LISTEN 0 128 :::80 :::*
以äžã®è¡ãèŠãããšã§TCP 80çªããŒã
ãéæŸãããŠãããšåãããŸãã
ebi@ubuntu:~$ ss -ant | grep -i listen
(ç¥)
LISTEN 0 128 :::80 :::*
以äžã«äž»èŠãªããŒãã®äžèŠ§ããããŸãã
ããŒãçªå· | ãããã³ã« | ãµãŒãã¹å |
---|---|---|
80 | TCP | HTTP |
53 | UDP | DNS |
22 | TCP | SSH |
443 | TCP | HTTPS |
ããã°ã©ãã³ã°èšèªPHPã®å®è¡ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
sudo apt install libapache2-mod-php libapache2-mod-php7.1 php-common php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-readline php7.1-gd php7.1-xmlrpc php7.1-dev php7.1-mbstring php7.1-mysql
ebi@ubuntu:~$ sudo apt install libapache2-mod-php libapache2-mod-php7.1 php-common php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-readline php7.1-gd php7.1-xmlrpc php7.1-dev php7.1-mbstring php7.1-mysql
ããã±ãŒãžãªã¹ããèªã¿èŸŒãã§ããŸã... å®äº
äŸåé¢ä¿ããªãŒãäœæããŠããŸã
ç¶æ
æ
å ±ãèªã¿åã£ãŠããŸã... å®äº
以äžã®è¿œå ããã±ãŒãžãã€ã³ã¹ããŒã«ãããŸã:
autoconf automake autopoint autotools-dev binutils binutils-common binutils-x86-64-linux-gnu build-essential debhelper dh-autoreconf
dh-strip-nondeterminism dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gettext intltool-debian libalgorithm-diff-perl libalgorithm-diff-xs-perl
libalgorithm-merge-perl libarchive-cpio-perl libarchive-zip-perl libasan4 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0
libcilkrts5 libdpkg-perl libfakeroot libfile-fcntllock-perl libfile-stripnondeterminism-perl libgcc-7-dev libitm1 liblsan0 libltdl-dev
libmail-sendmail-perl libmpx2 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libsigsegv2 libssl-dev libssl-doc libstdc++-7-dev
libsys-hostname-long-perl libtool libtsan0 libubsan0 libxmlrpc-epi0 linux-libc-dev m4 make manpages-dev php-pear php-xml php7.1-xml
pkg-php-tools po-debconf shtool zlib1g-dev
ææ¡ããã±ãŒãž:
autoconf-archive gnu-standards autoconf-doc binutils-doc dh-make debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg
gcc-multilib flex bison gdb gcc-doc gcc-7-multilib gcc-7-locales libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg
liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg gettext-doc libasprintf-dev libgettextpo-dev
glibc-doc libtool-doc libstdc++-7-doc gfortran | fortran95-compiler gcj-jdk m4-doc make-doc dh-php libmail-box-perl
以äžã®ããã±ãŒãžãæ°ãã«ã€ã³ã¹ããŒã«ãããŸã:
autoconf automake autopoint autotools-dev binutils binutils-common binutils-x86-64-linux-gnu build-essential debhelper dh-autoreconf
dh-strip-nondeterminism dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gettext intltool-debian libalgorithm-diff-perl libalgorithm-diff-xs-perl
libalgorithm-merge-perl libapache2-mod-php libapache2-mod-php7.1 libarchive-cpio-perl libarchive-zip-perl libasan4 libatomic1
libbinutils libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libdpkg-perl libfakeroot libfile-fcntllock-perl libfile-stripnondeterminism-perl
libgcc-7-dev libitm1 liblsan0 libltdl-dev libmail-sendmail-perl libmpx2 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libsigsegv2
libssl-dev libssl-doc libstdc++-7-dev libsys-hostname-long-perl libtool libtsan0 libubsan0 libxmlrpc-epi0 linux-libc-dev m4 make
manpages-dev php-common php-pear php-xml php7.1-cli php7.1-common php7.1-dev php7.1-gd php7.1-json php7.1-mbstring php7.1-mysql
php7.1-opcache php7.1-readline php7.1-xml php7.1-xmlrpc pkg-php-tools po-debconf shtool zlib1g-dev
ã¢ããã°ã¬ãŒã: 0 åãæ°èŠã€ã³ã¹ããŒã«: 78 åãåé€: 0 åãä¿ç: 0 åã
42.3 MB ã®ã¢ãŒã«ã€ããååŸããå¿
èŠããããŸãã
ãã®æäœåŸã«è¿œå 㧠185 MB ã®ãã£ã¹ã¯å®¹éãæ¶è²»ãããŸãã
ç¶è¡ããŸãã? [Y/n] y
ããŒy
ãæŒããŠEnter
ã§ç¶è¡ããŸãã
ååŸ:1 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libsigsegv2 amd64 2.11-1 [13.2 kB]
ååŸ:2 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 m4 amd64 1.4.18-1 [197 kB]
ååŸ:3 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 autoconf all 2.69-11 [322 kB]
ååŸ:4 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 autotools-dev all 20161112.1 [39.5 kB]
ååŸ:5 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 automake all 1:1.15-6ubuntu1 [509 kB]
ååŸ:6 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 autopoint all 0.19.8.1-4ubuntu1 [412 kB]
ååŸ:7 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 binutils-common amd64 2.29.1-4ubuntu1 [190 kB]
ååŸ:8 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libbinutils amd64 2.29.1-4ubuntu1 [502 kB]
ååŸ:9 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 binutils-x86-64-linux-gnu amd64 2.29.1-4ubuntu1 [1,824 kB]
ååŸ:10 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 binutils amd64 2.29.1-4ubuntu1 [3,342 B]
ååŸ:11 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libc-dev-bin amd64 2.26-0ubuntu2 [69.6 kB]
ååŸ:12 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 linux-libc-dev amd64 4.13.0-16.19 [954 kB]
ååŸ:13 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libc6-dev amd64 2.26-0ubuntu2 [2,524 kB]
ååŸ:14 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libcc1-0 amd64 7.2.0-8ubuntu3 [38.6 kB]
ååŸ:15 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libitm1 amd64 7.2.0-8ubuntu3 [27.6 kB]
ååŸ:16 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libatomic1 amd64 7.2.0-8ubuntu3 [8,954 B]
ååŸ:17 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libasan4 amd64 7.2.0-8ubuntu3 [360 kB]
ååŸ:18 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 liblsan0 amd64 7.2.0-8ubuntu3 [133 kB]
ååŸ:19 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libtsan0 amd64 7.2.0-8ubuntu3 [282 kB]
ååŸ:20 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libubsan0 amd64 7.2.0-8ubuntu3 [126 kB]
ååŸ:21 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libcilkrts5 amd64 7.2.0-8ubuntu3 [42.5 kB]
ååŸ:22 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libmpx2 amd64 7.2.0-8ubuntu3 [11.7 kB]
ååŸ:23 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libgcc-7-dev amd64 7.2.0-8ubuntu3 [2,378 kB]
ååŸ:24 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 gcc-7 amd64 7.2.0-8ubuntu3 [7,411 kB]
ååŸ:25 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 gcc amd64 4:7.2.0-1ubuntu1 [5,124 B]
ååŸ:26 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libstdc++-7-dev amd64 7.2.0-8ubuntu3 [1,456 kB]
ååŸ:27 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 g++-7 amd64 7.2.0-8ubuntu3 [7,551 kB]
ååŸ:28 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 g++ amd64 4:7.2.0-1ubuntu1 [1,482 B]
ååŸ:29 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 make amd64 4.1-9.1 [154 kB]
ååŸ:30 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libdpkg-perl all 1.18.24ubuntu1 [209 kB]
ååŸ:31 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 dpkg-dev all 1.18.24ubuntu1 [608 kB]
ååŸ:32 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 build-essential amd64 12.4ubuntu1 [4,758 B]
ååŸ:33 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libtool all 2.4.6-2 [194 kB]
ååŸ:34 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 dh-autoreconf all 14 [15.5 kB]
ååŸ:35 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libarchive-zip-perl all 1.59-1 [84.0 kB]
ååŸ:36 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libfile-stripnondeterminism-perl all 0.038-1 [13.3 kB]
ååŸ:37 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 dh-strip-nondeterminism all 0.038-1 [5,026 B]
ååŸ:38 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 gettext amd64 0.19.8.1-4ubuntu1 [1,093 kB]
ååŸ:39 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 intltool-debian all 0.35.0+20060710.4 [24.9 kB]
ååŸ:40 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 po-debconf all 1.0.20 [232 kB]
ååŸ:41 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 debhelper all 10.7.2ubuntu2 [877 kB]
ååŸ:42 http://jp.archive.ubuntu.com/ubuntu artful/main amd64 libfakeroot amd64 1.21-1ubuntu2 [25.9 kB]
php7.1-opcache (7.1.8-1ubuntu1) ãèšå®ããŠããŸã ...
Creating config file /etc/php/7.1/mods-available/opcache.ini with new version
binutils-x86-64-linux-gnu (2.29.1-4ubuntu1) ãèšå®ããŠããŸã ...
php-xml (1:7.1+54ubuntu1) ãèšå®ããŠããŸã ...
php7.1-cli (7.1.8-1ubuntu1) ãèšå®ããŠããŸã ...
update-alternatives: /usr/bin/php (php) ãæäŸããããã«èªåã¢ãŒã㧠/usr/bin/php7.1 ã䜿ããŸã
update-alternatives: /usr/bin/phar (phar) ãæäŸããããã«èªåã¢ãŒã㧠/usr/bin/phar7.1 ã䜿ããŸã
update-alternatives: /usr/bin/phar.phar (phar.phar) ãæäŸããããã«èªåã¢ãŒã㧠/usr/bin/phar.phar7.1 ã䜿ããŸã
Creating config file /etc/php/7.1/cli/php.ini with new version
php-pear (1:1.10.5+submodules+notgz-1) ãèšå®ããŠããŸã ...
binutils (2.29.1-4ubuntu1) ãèšå®ããŠããŸã ...
libapache2-mod-php7.1 (7.1.8-1ubuntu1) ãèšå®ããŠããŸã ...
Creating config file /etc/php/7.1/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.1
libapache2-mod-php (1:7.1+54ubuntu1) ãèšå®ããŠããŸã ...
gcc-7 (7.2.0-8ubuntu3) ãèšå®ããŠããŸã ...
g++-7 (7.2.0-8ubuntu3) ãèšå®ããŠããŸã ...
gcc (4:7.2.0-1ubuntu1) ãèšå®ããŠããŸã ...
dpkg-dev (1.18.24ubuntu1) ãèšå®ããŠããŸã ...
g++ (4:7.2.0-1ubuntu1) ãèšå®ããŠããŸã ...
update-alternatives: /usr/bin/c++ (c++) ãæäŸããããã«èªåã¢ãŒã㧠/usr/bin/g++ ã䜿ããŸã
libtool (2.4.6-2) ãèšå®ããŠããŸã ...
build-essential (12.4ubuntu1) ãèšå®ããŠããŸã ...
php7.1-dev (7.1.8-1ubuntu1) ãèšå®ããŠããŸã ...
update-alternatives: /usr/bin/php-config (php-config) ãæäŸããããã«èªåã¢ãŒã㧠/usr/bin/php-config7.1 ã䜿ããŸã
update-alternatives: /usr/bin/phpize (phpize) ãæäŸããããã«èªåã¢ãŒã㧠/usr/bin/phpize7.1 ã䜿ããŸã
dh-autoreconf (14) ãèšå®ããŠããŸã ...
dh-strip-nondeterminism (0.038-1) ãèšå®ããŠããŸã ...
debhelper (10.7.2ubuntu2) ãèšå®ããŠããŸã ...
pkg-php-tools (1.35) ãèšå®ããŠããŸã ...
libc-bin (2.26-0ubuntu2) ã®ããªã¬ãåŠçããŠããŸã ...
Apacheã§PHPã䜿ãããã®ããã±ãŒãž
- libapache2-mod-php
- libapache2-mod-php7.1
WordPressã§å¿ èŠãšãªãPHPã®ããã±ãŒãž
- php-common
- php7.1-cli
- php7.1-common
- php7.1-json
- php7.1-opcache
- php7.1-readline
- php7.1-gd
- php7.1-xmlrpc
- php7.1-dev
- php7.1-mbstring
- php7.1-mysql
MySQLããŒã¿ããŒã¹ãã€ã³ã¹ããŒã«ããŸãã
sudo apt install mysql-common mysql-server mysql-client
ebi@ubuntu:~$ sudo apt install mysql-common mysql-server mysql-client
[sudo] ebi ã®ãã¹ã¯ãŒã:
ããã±ãŒãžãªã¹ããèªã¿èŸŒãã§ããŸã... å®äº
äŸåé¢ä¿ããªãŒãäœæããŠããŸã
ç¶æ
æ
å ±ãèªã¿åã£ãŠããŸã... å®äº
mysql-common ã¯ãã§ã«ææ°ããŒãžã§ã³ (5.8+1.0.2ubuntu1) ã§ãã
mysql-common ã¯æåã§ã€ã³ã¹ããŒã«ãããšèšå®ãããŸããã
以äžã®è¿œå ããã±ãŒãžãã€ã³ã¹ããŒã«ãããŸã:
libaio1 libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-6 libfcgi-perl libhtml-mplate-perl mysql-client-5.7 mysql-client-core-5.7
mysql-server-5.7 mysql-server-core-5.7
ææ¡ããã±ãŒãž:
libipc-sharedcache-perl mailx tinyca
以äžã®ããã±ãŒãžãæ°ãã«ã€ã³ã¹ããŒã«ãããŸã:
libaio1 libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-6 libfcgi-perl libhtml-mplate-perl mysql-client mysql-client-5.7
mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7
ã¢ããã°ã¬ãŒã: 0 åãæ°èŠã€ã³ã¹ããŒã«: 12 åãåé€: 0 åãä¿ç: 5 åã
20.6 MB ã®ã¢ãŒã«ã€ããååŸããå¿
èŠããããŸãã
ãã®æäœåŸã«è¿œå 㧠161 MB ã®ãã£ã¹ã¯å®¹éãæ¶è²»ãããŸãã
ç¶è¡ããŸãã? [Y/n] y
確èªãåºãã®ã§y
ãå
¥åããŠEnter
ãæŒããŸã.
ãã¹ã¯ãŒãå
¥åãæ±ããããã®ã§ä»»æã®ãã¹ã¯ãŒããèšå®ããŸããããã§ã¯k@pp@ebi1000
ãšèšå®ããŸããã
(ç¥)
以åã«æªéžæã®ããã±ãŒãž libfcgi-perl ãéžæããŠããŸãã
.../07-libfcgi-perl_0.78-2build1_amd64.deb ãå±éããæºåãããŠããŸã ...
libfcgi-perl (0.78-2build1) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž libcgi-fast-perl ãéžæããŠããŸãã
.../08-libcgi-fast-perl_1%3a2.12-1_all.deb ãå±éããæºåãããŠããŸã ...
libcgi-fast-perl (1:2.12-1) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž libhtml-template-perl ãéžæããŠããŸãã
.../09-libhtml-template-perl_2.95-2_all.deb ãå±éããæºåãããŠããŸã ...
libhtml-template-perl (2.95-2) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž mysql-client ãéžæããŠããŸãã
.../10-mysql-client_5.7.20-0ubuntu0.17.10.1_all.deb ãå±éããæºåãããŠããŸã ...
mysql-client (5.7.20-0ubuntu0.17.10.1) ãå±éããŠããŸã...
以åã«æªéžæã®ããã±ãŒãž mysql-server ãéžæããŠããŸãã
.../11-mysql-server_5.7.20-0ubuntu0.17.10.1_all.deb ãå±éããæºåãããŠããŸã ...
mysql-server (5.7.20-0ubuntu0.17.10.1) ãå±éããŠããŸã...
libevent-core-2.1-6:amd64 (2.1.8-stable-4) ãèšå®ããŠããŸã ...
ureadahead (0.100.0-20) ã®ããªã¬ãåŠçããŠããŸã ...
libc-bin (2.26-0ubuntu2) ã®ããªã¬ãåŠçããŠããŸã ...
libaio1:amd64 (0.3.110-4) ãèšå®ããŠããŸã ...
systemd (234-2ubuntu12) ã®ããªã¬ãåŠçããŠããŸã ...
libcgi-pm-perl (4.36-1) ãèšå®ããŠããŸã ...
man-db (2.7.6.1-2) ã®ããªã¬ãåŠçããŠããŸã ...
mysql-client-core-5.7 (5.7.20-0ubuntu0.17.10.1) ãèšå®ããŠããŸã ...
libfcgi-perl (0.78-2build1) ãèšå®ããŠããŸã ...
libhtml-template-perl (2.95-2) ãèšå®ããŠããŸã ...
mysql-server-core-5.7 (5.7.20-0ubuntu0.17.10.1) ãèšå®ããŠããŸã ...
libcgi-fast-perl (1:2.12-1) ãèšå®ããŠããŸã ...
mysql-client-5.7 (5.7.20-0ubuntu0.17.10.1) ãèšå®ããŠããŸã ...
mysql-client (5.7.20-0ubuntu0.17.10.1) ãèšå®ããŠããŸã ...
mysql-server-5.7 (5.7.20-0ubuntu0.17.10.1) ãèšå®ããŠããŸã ...
update-alternatives: /etc/mysql/my.cnf (my.cnf) ãæäŸããããã«èªåã¢ãŒã㧠/etc/mysql/mysql.cnf ã䜿ããŸã
Renaming removed key_buffer and myisam-recover options (if present)
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service â /lib/systemd/stem/mysql.service.
mysql-server (5.7.20-0ubuntu0.17.10.1) ãèšå®ããŠããŸã ...
libc-bin (2.26-0ubuntu2) ã®ããªã¬ãåŠçããŠããŸã ...
ureadahead (0.100.0-20) ã®ããªã¬ãåŠçããŠããŸã ...
systemd (234-2ubuntu12) ã®ããªã¬ãåŠçããŠããŸã ...
ã€ã³ã¹ããŒã«ãå®äºããããããŒã¿ããŒã¹ãµãŒãã«æ¥ç¶ããŸãã
ããŒã¿ããŒã¹ã»ãµãŒããèµ·åããŠãããããŒãç¶æ³ã確èªããŸãã
ããŒã¿ããŒã¹ã»ãµãŒãã¯TCP 3306çªã§èµ·åããŸãããµãŒããèµ·åããŠããã確èªããŠã¿ããã
ãã³ã: ssã³ãã³ã
MySQLãµãŒããèµ·åããŠããã確èªããŠã¿ãŸããããã»ã¹äžèŠ§ã«ã¯mysql
ãšããæååãå«ãŸããŠããŸãã
ãã³ã: psã³ãã³ã
MySQLãµãŒããžãã°ã€ã³ããŸãã
sudo mysql -uroot -pk@pp@ebi1000
ebi@ubuntu:~$ mysql -uroot -pk@pp@ebi1000
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.20-0ubuntu0.17.10.1 (Ubuntu)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
ååšããŠããããŒã¿ããŒã¹ãã³ãã³ãshow databases;
ã§è¡šç€ºããŸãã
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)
mysql>
WordPressã§äœ¿çšããããŒã¿ããŒã¹ãäœæããŸããwordpress
ãšããååã®ããŒã¿ããŒã¹ãäœæããŸãã
mysql> create database wordpress;
mysql>
wordpress
ãšããããŒã¿ããŒã¹ãäœæãããŠããã確èªããŠã¿ãŸãããã
ãã³ã: show ???
ãšããã³ãã³ã䜿ãã
mysql> show ???;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+
5 rows in set (0.02 sec)
MySQLã®ãŠãŒã¶wp-user
ãè¿œå ããŸããroot
ã䜿çšããããšãåºæ¥ãŸãããã¢ã«ãŠã³ããæªçšãããæã®åœ±é¿ç¯å²ãå°ããããããã«æ°ããªãŠãŒã¶ãè¿œå ããŠããŸãã
- ãŠãŒã¶å:
wp-user
- ãã¹ã¯ãŒã:
kabayaki3taro
以äžã®ã³ãã³ãã§ã¢ã«ãŠã³ããè¿œå ããŸãã
mysql> create user 'wp-user'@'localhost' identified by 'kabayaki3taro';
Query OK, 0 rows affected (0.00 sec)
ãŠãŒã¶wp-user
ã«ããŒã¿ããŒã¹wordpress
ãžã®ãã«ã¢ã¯ã»ã¹æš©ãä»äžããŸãã
mysql> grant all privileges on wordpress.* to 'wp-user'@'localhost';
Query OK, 0 rows affected (0.00 sec)
ãŠãŒã¶ãŒã®è¿œå ãšæš©éã®ä»äžã¯äžã€ã®ã³ãã³ãã§è¿œå ããããšãå¯èœã§ãã
grant all on wordpress.* to wp-user@localhost identified by 'kabayaki3taro';
ããŒã¿ããŒã¹wordpress
ã®äžèº«ã§ããããŒãã«ã確èªããŠã¿ãŸãã
ãŸããããŒã¿ããŒã¹wordpress
ãéžæããŸãã
mysql> use wordpress;
Database changed
mysql>
次ã«ãããŒãã«ã®äžèŠ§ã衚瀺ããŸãã
mysql> show tables;
Empty set (0.03 sec)
mysql>
å®è¡çµæããããŸã äœãããŒãã«ãäœæãããŠããªãããšã確èªã§ããŸãã
äžåºŠãMySQLããæããŸãã
mysql> quit
Bye
WordPressã¯ãªãŒãã³ãœãŒã¹(ãœãŒã¹ã³ãŒããå ¬éãããŠãã)ã®ããã°ã·ã¹ãã ã§ããã«ã¹ã¿ãã€ãºããããšã§Webãµã€ããšããŠäœ¿çšããããšãåºæ¥ãŸãã
å®åéŠçžã®Webãµã€ããåŠå ãµã€ããç·æ¥é£çµ¡ãµã€ããªã©èº«è¿ãªWebãµã€ãã§ã䜿çšãããŠããŸãã
WordPressã®å ¬åŒãµã€ããžã¢ã¯ã»ã¹ããWordPressãããŠã³ããŒãããŸãã次ã®ãªã³ã¯ããã©ãŠã¶ã§éããŸãã
ãµã€ãã®ãWordPress 4.8.2 ãããŠã³ããŒããã«ã«ãŒãœã«ããããå³ã¯ãªã㯠-> ãªã³ã¯ã®ã¢ãã¬ã¹ãã³ããŒ
ãéžæããŸãã
é©åœãªãã£ã¬ã¯ããªã«ç§»åããVirtual Machineã®ã¿ãŒããã«ã§wget
ãšå
¥åããå³ã¯ãªã㯠-> ããŒã¹ã
ããã³ããŒããURLã貌ãä»ããŸãã
wget https://ja.wordpress.org/wordpress-4.8.2-ja.zip
å®è¡ããã³ãã³ãã¯äžèšã§ããwget
ã³ãã³ãã¯æå®ããURLã®ãã¡ã€ã«ãããŠã³ããŒãããã³ãã³ãã§ããã€ãŸããWordPressã®ããã°ã©ã ãWebããããŠã³ããŒãããŸããã
ããŠã³ããŒããããã¡ã€ã«wordpress-4.8.2-ja.zip
ãunzip
ã³ãã³ãã§è§£åããŸãã
ebi@ubuntu:~$ unzip wordpress-4.8.2-ja.zip
Archive: wordpress-4.8.2-ja.zip
creating: wordpress/
inflating: wordpress/wp-trackback.php
creating: wordpress/wp-admin/
inflating: wordpress/wp-admin/media-upload.php
inflating: wordpress/wp-admin/install-helper.php
inflating: wordpress/wp-admin/ms-users.php
inflating: wordpress/wp-admin/menu-header.php
inflating: wordpress/wp-admin/update.php
inflating: wordpress/wp-admin/plugin-install.php
inflating: wordpress/wp-admin/theme-editor.php
creating: wordpress/wp-admin/images/
(ç¥)
inflating: wordpress/wp-settings.php
inflating: wordpress/wp-cron.php
inflating: wordpress/wp-login.php
inflating: wordpress/wp-activate.php
inflating: wordpress/license.txt
inflating: wordpress/wp-signup.php
inflating: wordpress/index.php
inflating: wordpress/wp-mail.php
inflating: wordpress/wp-config-sample.php
inflating: wordpress/wp-comments-post.php
å±éãããšwordpress
ãšãããã£ã¬ã¯ããªãååšããŸãããã®ãã£ã¬ã¯ããªã/var/www/
ãžç§»åããŸãã
sudo mv wordpress/ /var/www/html/
ç¶ããŠ/var/www/html/
ãžç§»åããŸãã
cd /var/www/html
ãã¡ã€ã«ã®ããŒããã·ã§ã³ã確èªããŸãã
ã³ãã³ãã䜿ã£ãŠãã¡ã€ã«ã®ããŒããã·ã§ã³ããã§ãã¯ããŠã¿ãŸãããããŸããindex.html
ã®ææè
ã確èªããŠã¿ãŸãããã
ãã³ã: ls
ã³ãã³ã
ãã£ã¬ã¯ããªwordpress
ã®ææè
ãebi
ããwww-data
ãžå€æŽããŸãã-R
ã§ãã£ã¬ã¯ããªå
ã«ãããã¡ã€ã«ããã£ã¬ã¯ããªãååž°çã«å€æŽããŸãã
sudo chown -R www-data: wordpress/
VMã®IPã¢ãã¬ã¹ã確èªããŸãããã¹ã(Windows)ã§Webãã©ãŠã¶(Google ChromeãFirefox)ãèµ·åããŸãã
ãã©ãŠã¶ã®ã¢ãã¬ã¹æ¬ãž http://IPã¢ãã¬ã¹/wordpresss/
ããå
¥åããŠã¢ã¯ã»ã¹ããŸãã
ããŒãžã«è¡šç€ºãããããããå§ããŸãããããã¯ãªãã¯ããŸãã
ãã©ãŒã ã«äžèšå 容ãå ¥åããŸãã
ãã€ã³ã¹ããŒã«å®è¡ããã¯ãªãã¯ããŸãã
ãµã€ãæ å ±ã奜ããªããã«èšå®ããŸãããŠãŒã¶åãšãã¹ã¯ãŒãã¯å¥éãã¡ã¢ããŠãã ãããã¡ãŒã«ã¢ãã¬ã¹ã¯é©åœãªã¢ãã¬ã¹ã§è¯ãã§ããå ¥ååŸããWordPressãã€ã³ã¹ããŒã«ããã¯ãªãã¯ããŸãã
- ãµã€ãå: ããªã£ãã
- ãŠãŒã¶å: kabukiage
- ãã¹ã¯ãŒã: 4KM7a*xQNF2IBJctAG
- ã¡ãŒã«ã¢ãã¬ã¹: a@b.com
ã€ã³ã¹ããŒã«ã«æåãããšäžèšç»é¢ã衚瀺ãããŸããããã°ã€ã³ããã¯ãªãã¯ãããšãã°ã€ã³ç»é¢ã«ç§»åããŸãã
ããã»ã©èšå®ãããã¹ã¯ãŒããšãŠãŒã¶åãå ¥åãããã°ã€ã³ããã¯ãªãã¯ããŸãããã°ã€ã³ãããšç®¡çç»é¢ã衚瀺ãããŸããå·Šäžã«ãããµã€ã衚瀺ããæ§ç¯ãããµã€ããèŠãããšãã§ããŸãã
管çç»é¢ã§ãããŒãããã€ã³ã¹ããŒã«ããŠé©çšãããŠãªãªãžãã«ãµã€ããã€ãã£ãŠã¿ãŠãã ããã
WordPressã«ãã£ãŠã空ã ã£ãããŒã¿ããŒã¹wordpress
ã®ããŒãã«ãã©ãå€åããŠããã確èªããŸãã
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+
5 rows in set (0.02 sec)
mysql> use wordpress;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-----------------------+
| Tables_in_wordpress |
+-----------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_termmeta |
| wp_terms |
| wp_usermeta |
| wp_users |
+-----------------------+
12 rows in set (0.00 sec)
ããŒã¿ããŒã¹wordpress
ã®ããŒãã«wp_users
ã®äžèº«ã¯ä»¥äžã®ã³ãã³ã確èªã§ããŸãã
mysql> select * from wp_users;
+----+------------+------------------------------------+---------------+------------+----------+---------------------+---------------------+-------------+--------------+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+----+------------+------------------------------------+---------------+------------+----------+---------------------+---------------------+-------------+--------------+
| 1 | kabukiage | $P$BHrhfHenRfBgNwayaCck.GKddKzwK11 | kabukiage | a@b.com | | 2017-10-31 13:06:13 | | 0 | kabukiage |
+----+------------+------------------------------------+---------------+------------+----------+---------------------+---------------------+-------------+--------------+
1 row in set (0.00 sec)
ãµãŒãã®æ§ç¯ãéããŠãããµãŒãããããããã¯ãŒã¯ãã®ä»çµã¿ãã©ãå€åããŠãããã«ã€ããŠç解ãæ·±ãŸãã°å¹žãã§ãã倧åãªèŠç¹ã¯ãåãµãŒãããäœã®ãããã«ãäœãããŠããããç解ããããšã倧åã§ãã
ãããApacheãããªããŠNginx(ãšã³ãžã³ãšãã¯ã¹)ã®ã»ããããããšãã話ãèãããŸããã¯ãããŠãæ¬åœã«ãããªã®ã§ããããïŒ
çŸç¶ãWebãµãŒããœãããŠã§ã¢ã®ã·ã§ã¢ã§ããããªã®ã¯Apacheã§ããããããNginxã®ã·ã§ã¢ãæ¥éã«äžæããŠããããšãããããŸãã
ããã§ã以äžã§ã¯NginxãšApacheã®éããç°¡åã«èª¬æããŠãããããšæããŸãã
Apacheã¯HTTPã«ç¹åãããµãŒããŒã§ãwebãµãŒããŒãšããŠã®æ©èœãè±å¯ã«çšæããŠãããŸãããŸãã¢ãžã¥ãŒã«ãã€ã³ã¹ããŒã«ããããšã§æ©èœãç°¡åã«è¿œå ããããšãã§ããŸããä»åãPHPã䜿ãããã«libapache2-mod-php
ãã€ã³ã¹ããŒã«ããŸããã
Apacheã¯ããã»ã¹é§ååã§äžã€ãªã¯ãšã¹ãã«å¯Ÿãäžã€ã®ããã»ã¹ãå²ãåœãŠãŠåŠçãè¡ããŸãããã®ãã倧éã®ã¢ã¯ã»ã¹ãåæã«æ¥ãå Žåãããã»ã¹ã倧éã«èµ·åããããšã«ãªããææªC10K1ãšåŒã°ããããã»ã¹çªå·ã足ããªããªãçŸè±¡ãçºçããŸã(UNIXç³»OSã ãšæ倧32767)ããŸãPHPãªã©ã®åŠçãApacheã®ããã»ã¹ã§å®è¡ããããããåçãµã€ãã®åäœãéããªãåŸåããããŸãã
Nginxã¯Apacheã§è¿°ã¹ãåé¡ã解決ããããšãç®æšã«äœããããã®ã§ãWebãµãŒããŒãšããŠã®æ©èœã ãã§ãªãããªããŒã¹ãããã·ãšããŠåäœããããªã©æ§ã ãªæ©èœããããŸãããæ©èœè¿œå ããããšãã«ã¯ãœãŒã¹ããã³ã³ãã€ã«ããªãããªããã°ãªããŸãã(HTTP/2ãTLSv1.3ã«å¯Ÿå¿ããããªã©...)
Nginxã§ã¯ããã»ã¹æ°ã¯CPUã®ã³ã¢æ°ãšåçã§ãããããã®ããã»ã¹ã®äžã§ã«ãŒãåŠçããŸããããã¥ãŒã«æºãŸã£ãã€ãã³ããããŠããæ¹åŒ(ã€ãã³ãã«ãŒã)ã§ãã
ãŸãPHPãªã©ã®åŠçãå€éšã«æããããšã«ãããåŠçã®é«éåãšNginxããã»ã¹ã®è¥å€§åãæå¶ããŠããŸãã
=> 䜿çšçšéã«ãã
å®éã®å€§èŠæš¡ãªã¢ããªã±ãŒã·ã§ã³ã§ã¯ãããŒããã©ã³ãµã«ããè² è·åæ£ããã£ãã·ã¥ã®å©çšãªã©ãããè€éãªæ§é ã«ãªããŸãããã®ãããäžæŠã«äžæ¹ãè¯ããšã¯èšãåããŸããã以äžã¯äžè¬çãªäœ¿ãåãã®äŸãšããŠãããŠããŸãã
- éçãªãµã€ãã§ã¢ã¯ã»ã¹å€æ° -> Apache
- åçãªãµã€ãã§ã¢ã¯ã»ã¹å€æ° -> Nginx
- ã¢ã¯ã»ã¹å°æ° -> ã©ã£ã¡ã§ãå€ãããªã
æåã®ãã¡ã¯ãããŸããã¡ãããšåããããšããç¹ã«æ³šåããã°ãããšæããŸãããã®äžã§ãã¬ã¹ãã³ã¹åäžãhttps察å¿ãªã©æ§ã ãªããšãžææŠããéã«ãœãããŠã§ã¢ã®æ¯èŒãæ€èšãããã°è¯ããšæããŸãã
Footnotes
-
ã¯ã©ã€ã¢ã³ãæ°ãïŒäžãè¶ ãããšå€§äœçºçãããã Client 10k â©