仕事でさくらのレンタルサーバーを採用してとても好印象。同じさくらのVPSに引っ越ししたので記録を残しておく。SSLもZeroSSLをやめてさくら経由で契約 Webサイト運用が安価ワンストップで可能と感じます。
サーバ環境
旧サーバ環境
コンテンツ一式(フォルダごと)tar.gzに固める
新サーバへコンテンツ一式SCPで転送
httpd.conf conf.d記述をローカルPCにコピー
新サーバ環境
ユーザパスワード設定
コンテンツ一式を対処ディレクトリに解凍
パーミッション整え
httpd mysql phpインストール
http.conf conf.dなどを整える
https環境整える(conf SSL証明書設定)
mysql環境整える(インストール ユーザ権限設定 dumpファイルからインポート)
OS種
1 2 |
cat /etc/redhat-release CentOS Stream release 8 |
インストールパッケージ(一部)
httpd Apache
1 2 3 4 5 6 |
# rpm -qa | grep httpd httpd-2.4.37-40.module_el8.5.0+852+0aafc63b.x86_64 httpd-filesystem-2.4.37-40.module_el8.5.0+852+0aafc63b.noarch httpd-devel-2.4.37-40.module_el8.5.0+852+0aafc63b.x86_64 centos-logos-httpd-85.8-1.el8.noarch httpd-tools-2.4.37-40.module_el8.5.0+852+0aafc63b.x86_64 |
php
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# rpm -qa | grep php php-mysqlnd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-json-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-gd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-pear-1.10.12-1.module_el8.3.0+396+9a0d79d6.noarch php-fpm-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-xml-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-common-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-mbstring-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-pdo-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-devel-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-cli-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 php-process-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 |
mysql
1 2 3 4 5 6 |
# rpm -qa | grep mysql php-mysqlnd-7.4.19-1.module_el8.5.0+815+1c4fd2e5.x86_64 mysql-common-8.0.21-1.module_el8.4.0+589+11e12751.x86_64 mysql-server-8.0.21-1.module_el8.4.0+589+11e12751.x86_64 mysql-8.0.21-1.module_el8.4.0+589+11e12751.x86_64 mysql-errmsg-8.0.21-1.module_el8.4.0+589+11e12751.x86_64 |
mysql_secure_installation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: y There are three levels of password validation policy: LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0 Please set the password for root here. New password: Re-enter new password: Estimated strength of the password: 50 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done! |
mysql DBユーザ・権限
1 2 3 4 5 6 7 8 |
mysql> create database hoge; Query OK, 1 row affected (0.01 sec) mysql> CREATE USER hoge@localhost IDENTIFIED BY 'hoge-password'; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on hoge.* to hoge@localhost; Query OK, 0 rows affected (0.00 sec) |
mysql dumpからの戻し(旧サーバでdumpデータ取得 scpで新サーバにコピー済み)
1 2 |
# mysql -u hoge -p hoge < hoge.sql Enter password: |
DNS設定
さくらの固定IPにDNSを向ける
引っ越しでよかった
コスパよし(石狩 50GB 2コア 1GB)=880円/月
スピード速い
わかりやすいコンパネ
チャットでの的確な対応
DTI比仮想環境の変な制限がない
(ドメインも時期が来たらさくらに引っ越ししたい)
はまったところ
Permission
.htaccess とくにphp_value
コメント