Skip to content

Instantly share code, notes, and snippets.

@yasuken1990
Last active August 11, 2018 05:43
Show Gist options
  • Save yasuken1990/9d5aeb10cb954370bfa7f3f6662148ef to your computer and use it in GitHub Desktop.
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
// 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
# systemctl start apache2
# systemctl restart mysql
// ログイン
# mysql -u root -p
CREATE USER '[UserName]'@'localhost' IDENTIFIED BY '[Password]';
GRANT ALL ON [DbName].* TO '[UserName]'@'localhost';
// 有効化
# ufw enable
// ufw確認
# ufw status
// HTTP
# ufw allow 80
// HTTPS
# ufw allow 443
// ufw再起動
# ufw reload
// ufw確認 Port開放できているか確認
# ufw status
// 有効・無効確認
# systemctl list-unit-files --type=service | grep "mysql\|apache2\|ufw"
// 有効にする
# systemctl enable apache2 mysql ufw
// 該当ファイルをよしなに変更する
# vim /etc/apache2/
// Let's Encrypt インストール、実行
# wget https://dl.eff.org/certbot-auto
# chmod a+x certbot-auto
# ./certbot-auto
// 後は公式ドキュメント、表示されるメッセージ通りに
[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