Last active
August 11, 2018 05:43
-
-
Save yasuken1990/9d5aeb10cb954370bfa7f3f6662148ef to your computer and use it in GitHub Desktop.
Ubuntu 18.04 LTS LAMP + Let's Encrypt 環境構築 ref: https://qiita.com/yasuken/items/145a67e21ef5c4bdf30b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Apache2.4 | |
# apt install apache2 | |
// PHP7.2 | |
# apt install php7.2-cli | |
// mod_php | |
$ apt install libapache2-mod-php | |
// php mysql | |
# apt install php7.2-mysql | |
// Mysql5.7 | |
# apt install mysql-server | |
// Mysql Secure Install | |
# mysql_secure_installation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# systemctl start apache2 | |
# systemctl restart mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ログイン | |
# mysql -u root -p | |
CREATE USER '[UserName]'@'localhost' IDENTIFIED BY '[Password]'; | |
GRANT ALL ON [DbName].* TO '[UserName]'@'localhost'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 有効化 | |
# ufw enable | |
// ufw確認 | |
# ufw status | |
// HTTP | |
# ufw allow 80 | |
// HTTPS | |
# ufw allow 443 | |
// ufw再起動 | |
# ufw reload | |
// ufw確認 Port開放できているか確認 | |
# ufw status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 有効・無効確認 | |
# systemctl list-unit-files --type=service | grep "mysql\|apache2\|ufw" | |
// 有効にする | |
# systemctl enable apache2 mysql ufw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 該当ファイルをよしなに変更する | |
# vim /etc/apache2/ | |
// Let's Encrypt インストール、実行 | |
# wget https://dl.eff.org/certbot-auto | |
# chmod a+x certbot-auto | |
# ./certbot-auto | |
// 後は公式ドキュメント、表示されるメッセージ通りに |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
default-character-set= utf8mb4 | |
[mysqld] | |
character-set-server = utf8mb4 | |
collation_server= utf8mb4_unicode_ci | |
default_password_lifetime = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment