ユーザーを追加する

ユーザー名
パスワード
ドメイン名

ヒント
ユーザー名、パスワード、ドメイン名を入力して更新ボタンをクリックしてください。 VALUE-DOMAIN等で取得したドメインのDNS設定をしてください。
ユーザー追加
[root@centos ~]# useradd 
[root@centos ~]# passwd 
Changing password for user .
New password: ←ユーザーのパスワード入力
BAD PASSWORD: The password contains the user name in some form
Retype new password: ←パスワード再入力
passwd: all authentication tokens updated successfully.
[root@centos ~]# chmod 701 /home/
Apache設定
[root@centos ~]# vi /etc/httpd/conf.d/virtual.conf
↓下記を記入
<VirtualHost *:80>
    ServerName 
    DocumentRoot /home//public_html
    ErrorLog /var/log/httpd/-error_log
    CustomLog /var/log/httpd/-access_log combined env=!nolog
</VirtualHost>
[root@centos ~]# systemctl reload httpd
Let's Encrypt
[root@centos ~]# ./certbot-auto

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: 
2: example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1 ←追加するドメイン(この場合1)を選択
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for example.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/httpd/conf.d/virtual-le-ssl.conf
Deploying Certificate to VirtualHost /etc/httpd/conf.d/virtual-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP ac                                                                                                                                                             cess.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1 ←1を選択

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/example.com/privkey.pem
   Your cert will expire on 2019-04-07. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again with the "certonly" option. To non-interactively renew *all*
   of your certificates, run "certbot-auto renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
Apache(SSL)設定
[root@centos ~]# vi /etc/httpd/conf.d/virtual.conf
↓下記を記入
<VirtualHost *:443>
        ServerAdmin info@
        DocumentRoot /home//public_html
        ServerName 
        SSLEngine on
        SSLCertificateFile /etc/letsencrypt/live//cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live//privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateChainFile /etc/letsencrypt/live//chain.pem
</VirtualHost>
[root@centos ~]# systemctl reload httpd
MySQL設定
[root@centos ~]# mysql -u root -p
Enter password: ←パスワード入力
MariaDB [(none)]> CREATE DATABASE ; ←新規データベースを作成
Query OK, 1 row affected (0.01 sec)
MariaDB [(none)]> GRANT ALTER,CREATE,DELETE,DROP,INSERT,LOCK TABLES,SELECT,UPDATE ON .* TO @localhost IDENTIFIED BY ''; ←新規ユーザーを作成
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> EXIT;
Postfix設定(バーチャルドメイン追加)
[root@centos ~]# vi /etc/postfix/virtual
↓最終行に下記を記入
		anything
postmaster@	
[root@centos ~]# postmap /etc/postfix/virtual [root@centos ~]# systemctl reload postfix
メールアドレス追加 (専用ユーザーでSMTP認証する場合)
[root@centos ~]# saslpasswd2 -u server-manual.com -c postmaster@
Password:  ←パスワード入力
Again (for verification):  ←パスワード再入力
[root@centos ~]# sasldblistusers2 ←メールユーザー確認
postmaster@: userPassword
ヒント
-uオプションのドメインは/etc/postfix/main.cfの「mydomain」で設定したドメインと同じにしてください。 削除する場合は、saslpasswd2 -u realm(ドメイン名) -d ユーザー名
vsftpd設定
[root@centos ~]# echo  >> /etc/vsftpd/chroot_list
Home PageTop