{"id":1353,"date":"2019-01-16T11:47:08","date_gmt":"2019-01-16T02:47:08","guid":{"rendered":"http:\/\/boomboom-mix.com\/modules\/xpress\/?p=1353"},"modified":"2021-04-09T13:47:56","modified_gmt":"2021-04-09T04:47:56","slug":"amazon-lightsail%e3%81%abubuntu16-04","status":"publish","type":"post","link":"http:\/\/boomboom-mix.net\/?p=1353","title":{"rendered":"Amazon Lightsail\u306bubuntu16.04"},"content":{"rendered":"<p>Amazon\u306eLightsail\u3067ubuntu\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u5f8c\u306b\u3084\u3063\u305f\u3053\u3068\u3092\u30e1\u30e2\u3057\u3066\u307f\u308b\uff08\u8ab0\u304b\u306e\u5f79\u306b\u7acb\u3066\u3070\u5e78\u3044\u7684\u306a\uff09<\/p>\n<p><strong>\u2606\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u8cdb\u5426\u4e21\u8ad6\u3060\u304croot\u30d1\u30b9\u8a2d\u5b9a<\/strong><br \/>\n\u3053\u308c\u306fSCP\u304b\u3089\u306e\u63a5\u7d9a\u3067root\u6240\u6709\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u89e6\u308b\u5834\u5408\u3068\u304b\u3092\u60f3\u5b9a\u3057\u3066\u3067\u3059\u3002<br \/>\n<span style=\"color: #ff0000;\"><code>sudo su -<\/code><\/span><br \/>\n\u3067root\u306b\u306a\u308b\u3002<br \/>\n<span style=\"color: #ff0000;\"><code>passwd<\/code><\/span><br \/>\n\u3067\u30eb\u30fc\u30c8\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u306a\u304a\u3059\u3002<\/p>\n<p><strong>\u2606SSH\u8a2d\u5b9a<\/strong><br \/>\nvi \u3067 \/etc\/ssh\/sshd_config \u3092\u958b\u304d\u3001\u4e00\u6642\u7684\u306b\uff08\u9375\u8a2d\u5b9a\u3059\u308b\u307e\u3067\u306e\u9593\uff09\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u306eroot\u30ed\u30b0\u30a4\u30f3\u3092\u53ef\u80fd\u306b\u3059\u308b\u3002<br \/>\n<span style=\"color: #ff0000;\"><code>vi \/etc\/ssh\/sshd_config<\/code><\/span><br \/>\ni\u30ad\u30fc\u3092\u62bc\u3057\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3002<br \/>\n<span style=\"color: #0000ff;\">PermitRootLogin yes<\/span><br \/>\n<span style=\"color: #0000ff;\">PasswordAuthentication yes<\/span><br \/>\nESC\u30ad\u30fc\u3092\u62bc\u3057\u305f\u3042\u3068\u306b <span style=\"color: #ff0000;\"><code>:wq<\/code><\/span> \u3067\u4fdd\u5b58\u7d42\u4e86\u3002<br \/>\n<span style=\"color: #ff0000;\"><code>service sshd restart<\/code><\/span><br \/>\n\u4ee5\u5f8c\u306fPutty\u304b\u3089root\u3067\u306e\u4f5c\u696d\u3068\u3059\u308b\u3002<br \/>\n<span style=\"color: #ff0000;\"><code>ssh-keygen -t rsa<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>cd \/<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>mkdir .ssh<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>cat \/root\/.ssh\/id_rsa.pub &gt;&gt; .ssh\/authorized_keys<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>chmod 600 \/.ssh\/authorized_keys<\/code><\/span><br \/>\n\u518d\u5ea6 \/etc\/ssh\/sshd_config \u3092\u958b\u304d\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u5f8c\u4fdd\u5b58\u3059\u308b\u3002<br \/>\n<span style=\"color: #0000ff;\">#AuthorizedKeysFile %h\/.ssh\/authorized_keys<\/span><br \/>\n<span style=\"color: #0000ff;\">AuthorizedKeysFile \/.ssh\/authorized_keys<\/span><br \/>\n<span style=\"color: #ff0000;\"><code>service sshd restart<\/code><\/span><br \/>\n\/root\/.ssh \u306e\u4e2d\u306e id_rsa \u304b\u3089\u30af\u30e9\u30a4\u30a2\u30f3\u30c8PC\u5074\u3067 puttygen \u3092\u4f7f\u3044 .ppk\u30d5\u30a1\u30a4\u30eb \u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\n\u7121\u4e8broot\u304b\u3089\u306e\u79d8\u5bc6\u9375\u3067\u306eputty\u306e\u30ed\u30b0\u30a4\u30f3\u304c\u6210\u529f\u3057\u305f\u3089\u30d1\u30b9\u30ef\u30fc\u30c9\u30ed\u30b0\u30a4\u30f3\u62d2\u5426\u306b\u623b\u3059\u305f\u3081\u3001<br \/>\n\/etc\/ssh\/sshd_config \u3092\u958b\u304d\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3059\u308b\u3002<br \/>\n<span style=\"color: #0000ff;\">PermitRootLogin prohibit-password<\/span><br \/>\n\u307e\u305f\u306f<br \/>\n<span style=\"color: #0000ff;\">PermitRootLogin without-password<\/span><br \/>\n<span style=\"color: #0000ff;\">PermitEmptyPasswords no<\/span><br \/>\n<span style=\"color: #0000ff;\">PasswordAuthentication no<\/span><br \/>\n\u4fdd\u5b58\u3057\u305f\u3089sshd\u3092\u518d\u8d77\u52d5\u3059\u308b\u3002<br \/>\n<span style=\"color: #ff0000;\"><code>service sshd restart<\/code><\/span><\/p>\n<p><strong>\u2606Japanese\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u8ffd\u52a0<\/strong><br \/>\n<code>wget -q https:\/\/www.ubuntulinux.jp\/ubuntu-ja-archive-keyring.gpg -O- | sudo apt-key add -<br \/>\nwget -q https:\/\/www.ubuntulinux.jp\/ubuntu-jp-ppa-keyring.gpg -O- | sudo apt-key add -<br \/>\nwget https:\/\/www.ubuntulinux.jp\/sources.list.d\/xenial.list -O \/etc\/apt\/sources.list.d\/ubuntu-ja.list<br \/>\n<\/code><br \/>\n<span style=\"color: #ff0000;\"><code>apt-get update<\/code><\/span><\/p>\n<p><strong>\u2606\u6642\u523b\u30b5\u30fc\u30d0\u30fc\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/strong><br \/>\n<span style=\"color: #ff0000;\"><code>apt-get install ntp<\/code><\/span><br \/>\n\/etc\/ntp.conf \u3092\u958b\u304d\u4ee5\u4e0b\u306e\u90e8\u5206\u3092#\u3092\u4ed8\u3051\u3066\u30b3\u30e1\u30f3\u30c8\u306b\u3057\u305f\u5f8c\u3001\u305d\u306e\u4e0b\u3082\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u306b\u8ffd\u52a0<br \/>\n<span style=\"color: #0000ff;\">#pool 0.ubuntu.pool.ntp.org iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> #pool 1.ubuntu.pool.ntp.org iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> #pool 2.ubuntu.pool.ntp.org iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> #pool 3.ubuntu.pool.ntp.org iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> #pool ntp.ubuntu.com<\/span><br \/>\n<span style=\"color: #0000ff;\"> server ntp.nict.jp iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> server ntp1.jst.mfeed.ad.jp iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> server ntp2.jst.mfeed.ad.jp iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> server ntp3.jst.mfeed.ad.jp iburst<\/span><br \/>\n<span style=\"color: #0000ff;\"> restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap<\/span><br \/>\nUDP123\u756a\u30dd\u30fc\u30c8\u3092\u958b\u3051\u3066\u304b\u3089\u6642\u523b\u30b5\u30fc\u30d0\u30fc\u306e\u518d\u8d77\u52d5\u3002<br \/>\n<span style=\"color: #ff0000;\"><code>service ntp restart<\/code><\/span><\/p>\n<p><strong>\u260632bit\u30d7\u30ed\u30b0\u30e9\u30e0\u7528\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n<span style=\"color: #ff0000;\"><code>dpkg --add-architecture i386<br \/>\napt-get update<br \/>\napt-get install libc6:i386 libncurses5:i386 libstdc++6:i386<\/code><\/span><\/p>\n<p>\u30ed\u30fc\u30ab\u30eb\u306e\u5225PC\u304b\u3089\u8996\u899a\u7684\u306b\u8a2d\u5b9a\u306a\u3093\u3084\u3089\u898b\u305f\u3044\uff08\u307e\u305f\u306fSS\u306b\u64ae\u308a\u305f\u3044\uff09\u6642\u306e\u305f\u3081\u306b<br \/>\n<strong>\u2606Webmin\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n<span style=\"color: #ff0000;\"><code>apt-get install python apt-show-versions libapt-pkg-perl libauthen-pam-perl libio-pty-perl libnet-ssleay-perl unzip<br \/>\ncurl -L -O http:\/\/www.webmin.com\/download\/deb\/webmin-current.deb<br \/>\ndpkg -i webmin-current.deb<br \/>\nsystemctl restart webmin<\/code><\/span><\/p>\n<p><strong>\u2606MySQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n<span style=\"color: #ff0000;\"><code>apt-get install mysql-server<\/code><\/span><br \/>\nmysql\u306eroot\u30d1\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u5165\u529b\u753b\u9762\u304c2\u56de\u51fa\u308b\u306e\u3067\u5165\u529b\u3059\u308b<\/p>\n<p><strong>\u2606MySQL\u306e\u8a2d\u5b9a\u5909\u66f4<\/strong><br \/>\n\/etc\/mysql\/mysql.conf.d\/mysqld.cnf\u3092\u958b\u304d<br \/>\n[mysqld]\u306e\u3068\u3053\u308d\u3067<br \/>\n<span style=\"color: #0000ff;\">character-set-server = utf8<br \/>\nskip-character-set-client-handshake<\/span><br \/>\n\u4e00\u756a\u4e0b\u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3059\u308b\u3002<br \/>\n<span style=\"color: #0000ff;\">[mysqldump]<br \/>\ndefault-character-set=utf8<br \/>\n[mysql]<br \/>\ndefault-character-set=utf8<\/span><\/p>\n<p><strong>\u2606Web\u74b0\u5883\u3084MC\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n<span style=\"color: #ff0000;\"><code>apt-get install apache2<\/code><\/span><br \/>\n\/etc\/apache2\/sites-available \u306e\u4e2d\u306e000-default.conf\u3092\u958b\u304d\u3001\u516c\u958b\u3057\u305f\u3044\u8a2d\u5b9a\u3078\u5909\u66f4\u3059\u308b<br \/>\n<span style=\"color: #ff0000;\"><code>a2dissite 000-default.conf<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>a2ensite 000-default.conf<\/code><\/span><br \/>\n\u7b49\u306e\u30b3\u30de\u30f3\u30c9\u3067\u5909\u3048\u305f\u8a2d\u5b9a\u3092\u53cd\u6620\u3055\u305b\u308b<br \/>\n<span style=\"color: #ff0000;\"><code>add-apt-repository ppa:ondrej\/php<br \/>\napt update<br \/>\napt install php5.6 php5.6-gd php5.6-mbstring php5.6-cgi php5.6-imap php-pear php5.6-xmlrpc php5.6-xsl<br \/>\napt install php5.6-curl php5.6-mcrypt libapache2-mod-php5.6 php5.6-mcrypt php5.6-mysql<br \/>\napt-get install mc imagemagick<\/code><\/span><\/p>\n<p><strong>\u2606Web\u74b0\u5883\u306e\u8a2d\u5b9a<\/strong><br \/>\n\/etc\/php\/php5\/apache2\/php.ini \u3092\u958b\u304d\u4ee5\u4e0b\u306e\u7b87\u6240\u3092\u5909\u66f4\u3059\u308b<br \/>\n<span style=\"color: #0000ff;\">expose_php = Off<\/span><br \/>\n<span style=\"color: #0000ff;\">date.timezone = Asia\/Tokyo<\/span><\/p>\n<p><strong>\u2606PhpMyAdmin\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n<span style=\"color: #ff0000;\"><code>apt-get install phpmyadmin<\/code><\/span><br \/>\nm\uff59phpadmin\u3092\u8868\u793a\u3059\u308bWeb\u30b5\u30fc\u30d0\u30fc\u306e\u9078\u629e\u304c\u51fa\u308b\u306e\u3067apache2\u3092\u6307\u5b9a\u3059\u308b<br \/>\n\u305d\u306e\u6b21\u306e\u8cea\u554f\u306fYes\u3092\u62bc\u3059<br \/>\nMysql\u306eroot\u30d1\u30b9\u30922\u56de\u805e\u304b\u308c\u308b\u306e\u3067\u5165\u529b\u3059\u308b<br \/>\n<span style=\"color: #ff0000;\"><code>ln -s \/etc\/phpmyadmin\/apache.conf \/etc\/apache2\/conf-available\/phpmyadmin.conf<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>a2enconf phpmyadmin<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>php5enmod mcrypt<\/code><\/span><br \/>\n<span style=\"color: #ff0000;\"><code>service apache2 reload<\/code><\/span><\/p>\n<p><strong>\u2606\u305d\u306e\u4ed6\u30a2\u30d7\u30ea\u3092\u5c0e\u5165\u3057\u305f\u5834\u5408\u306b<\/strong><br \/>\n\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u7121\u3051\u308c\u3070 \/etc\/init.d \u306b\u4f5c\u308b<br \/>\n\u4f5c\u3063\u305f \/etc\/init.d \u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u767b\u9332\u3059\u308b<br \/>\n<span style=\"color: #ff0000;\">insserv -d \u4f5c\u3063\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u540d<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Amazon\u306eLightsail\u3067ubuntu\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u5f8c\u306b\u3084\u3063\u305f\u3053\u3068\u3092\u30e1\u30e2\u3057\u3066\u307f\u308b\uff08\u8ab0\u304b\u306e\u5f79\u306b\u7acb\u3066\u3070\u5e78\u3044\u7684\u306a\uff09 \u2606\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u8cdb\u5426\u4e21\u8ad6\u3060\u304croot\u30d1\u30b9\u8a2d\u5b9a \u3053\u308c\u306fSCP\u304b\u3089\u306e\u63a5\u7d9a\u3067root\u6240\u6709\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u89e6\u308b\u5834 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1353","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts\/1353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1353"}],"version-history":[{"count":2,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts\/1353\/revisions"}],"predecessor-version":[{"id":1491,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=\/wp\/v2\/posts\/1353\/revisions\/1491"}],"wp:attachment":[{"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1353"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/boomboom-mix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}