git remote add origin https://アカウント名@gitlab.com/アカウント名/プロジェクト名.git
git remote rm origin // 関連性を削除
1)base認証用password fileを作成
mkdir /etc/htpasswd (必要に応じて)
htpasswd -c /etc/htpasswd/.htpasswd username(コマンドを実行すると、PW入力を要求される)
2)/var/www/html/site/public/.htaccess を変更
一番上に、以下を追加
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/htpasswd/.htpasswd"
Require valid-user
1)certbotインストール
yum install certbot python2-certbot-apache
2)apache confファイルの最後に下記VirtualHost追加
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin root@xxx.com
DocumentRoot /var/www/html/site/public
ServerName xxx.com
3)certbotコマンドを実行して証明書をインストール
certbot --apache -d xxx.com
※実施中、httpをhttpsへredirectするか聞いてくる際、redirectするようにします。
初期ドメイン→独自ドメイン リダイレクト
以下の内容をapache confファイルに追加
<VirtualHost *:80>
ServerAdmin root@xxx.com
DocumentRoot /var/www/html/site/public
ServerName os1-234-56789.vs.sakura.ne.jp
RewriteEngine on
RewriteCond %{SERVER_NAME} =os1-234-56789.vs.sakura.ne.jp
RewriteRule ^ https://xxx.com%{REQUEST_URI} [END,NE,R=permanent]
4)証明書を更新
certbot renew