Once you have logged in to the virtual machine, you can perform initialization.
For initialization we will use specialized “KUSANAGI commands”.
“KUSANAGI commands”are designed for KUSANAGI only and can be used for web server switching, cache control and other features after initialization.
The following steps explain the procedures of getting KUSANAGI ready for WordPress.
1. Start initialization
First, use yum to update your CentOS and KUSANAGI system before initializing.
Enter the following command to begin the update.
# yum --enablerepo=remi,remi-php56 update -y
Once the update is completed, continue the steps to initialization.
Use the following command to reboot the server.If you are using Microsoft Azure, restart the virtual machine using Microsoft Azure portal.
You will be logged out so please log in again and switch to the root user.
Next, we will set or change the user passwords of Linux and databases in the virtual machine.
Enter the following command to start.
# kusanagi init [options]
2.The creation of the TLS host key file
Create the TLS session key file and parameter files to use DH(Diffie-Hellman) key exchange.
The file will be created under /etc/kusanagi.d/ssl ,it will not be recreated if the file is already there.
please be aware of that it will takes several minutes to create the file according to the performance of the machine.
3. Set server timezone
Configure the server’s timezone.
Using the option --tz timezone can configure the timezone that you had specified.
# kusanagi init --tz tokyo
At this time,there is no distinction between the uppercase or lowercase of the string that you had specified.and though you just type part of the word such as “Toky”,you can also set the right timezone and do the configuration.
there will be an error if the string you specified matched several timezones.
If you do not specify the option --tz,you can choose the timezone interactively.
Search or select timezone: Africa/Abidjan Africa/Accra . . .
Choose your timezone.
* You can refine as you type.
When the timezone is selected the following will display.
Applying Location: Asia/Tokyo.
(Example of selecting Asia/Tokyo)
4. Configuration of Locale
Select the language that you use.
Specify the option --lang en then you will get the English locale(en_US.UTF-8),if you specify the option --lang ja you configure the Japanese locale(ja_JP.UTF-8).
# kusanagi init --lang ja
If you did not specify the option --lang ,you can choose the locale interactively.
Select your using language. 1 : English 2 : 日本語 q : quit Which are you using?:
If you choose 1,the configuration of English locale will be done(en_US.UTF-8).
If you choose 2,the configuration of Japanese locale will be done(ja_JP.UTF-8).
If you choose q,the processing will stop here.
5. Configuration of keyboard type
Configure the keyboard type.
Specify the option --keyboard en you will get the English keyboard (US layout),if you specify the option --lang ja you will get the Japanese keyboard (jp106 layout)
# kusanagi init --keyboard ja
If you do not specify the option --keyboard,you can choose the keyboard interactively.
Select your keyboard layout. 1 : English 2 : Japanese q : quit Which are you using?:
If you choose 1,the configuration of English keyboard (US layout) will be done
If you choose 2,the configuration of Japanese keyboard (jp106 layout) will be done.
If you choose q,the processing will stop here.
When the keyboard is selected the following will display.
You choose: Japanese
6. Configuration of user password
Configure the password for the user kusanagi.
Specify the option --passwd password ,the password configuration for user kusanagi is done.
# kusanagi init --passwd Passw0rd
if you do not specify the option --passwd,you can configure the password interactively.
Changing password for user kusanagi. New password:
* Though the screen shows “Changing password”, it is actually a new password..
Type the password that you want.
Retype the password.
Retype new password:
If the password configuration is done,the message will be as following:
passwd: all authentication tokens updated successfully.
7. Configuration of key authentication
The configuration of the SSH user key for user kusanagi.
If you specify the option --phrase ,the configuration of the passphrase of the SSH user key will be done as the phrase you specified,the string of the passphrase should be over 5 characters.
If you specify the option --nophrase,the passphrase of SSH user key will be empty string.
# kusanagi init --nophrase
If you do not configure the option of --phrase or --nophrase,you can configure the passphrase interactively.
Generating public/private rsa key pair. Enter passphrase (empty for no passphrase):
Set the passphrase for key authentication.
Enter a passphrase of your choice and hit the Enter key.
(You can leave it blank, but a passphrase is highly recommended.)
The following message will display. Please re-enter the passphrase to confirm and hit the Enter key.
Enter same passphrase again:
The following message will display.
* The public key required for key authentication has been generated as kusanagi.pem in the root directory (/root). You can download it after initialization.
Your identification has been saved in /root/kusanagi.pem. Your public key has been saved in /root/kusanagi.pem.pub.
Set the passphrase with a dialogue,the following message will display.
The key fingerprint is: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@ The key's randomart image is: +--[ RSA 2048]----+ | | | | | | | | | | | | | | | | | | +-----------------+
8. Set password for MySQL root
Next we will set a password for MySQL root.
Specify the option --dbrootpass password,the root password of MySQL will be configured,this password should use lowercase or uppercase of alphabet,number,and marks as following 「.!#%+_-」
and also the password should be over 8 characters.
# kusanagi init --dbrootpass Password
If you do not specify the option --dbrootpass,you can choose type in the password interactively.
Enter MySQL root password. Use [a-zA-Z0-9.!#%+_-] 8 characters minimum.
Re-enter the same password for confirmation.
Re-type MySQL root password.
9. Choose your web server
You can choose NGINX or httpd(Apache2) as your web server.
Specify the option --nginx will start the NGINX,and using the option --httpd will start httpd(Apache2)
While if you specified both --nginx and --httpd,the first one you specified will be effective.
# kusanagi init --nginx
If you do not specify option --nginx or --httpd,you can choose the web server interactively.
KUSANAGI can choose middlewares. Please tell me your web server option. 1) NGINX(Default) 2) Apache Which you using?(1):
Type in １ or 2 to select the web server.If you just press the enter key, NGINX will be selected as default.
10. Choose your application server
You can choose your application server from HHVM,PHP7,PHP-FPM(PHP5).
If you choose the option --hhvm,your application server will be hhvm,and if you use --php7,your application server will be php7,If you choose the option --php5,PHP-FPM(PHP5)will be started.
If several options was specified,the first one will be effective.
# kusanagi init --hhvm
If you do not choose any of --hhvm,--php7,--php5,you can choose the application server interactively.
Then, Please tell me your application server option.") 1) HHVM(Default) 2) PHP7 3) PHP5 Which you using?(1):
Your application server will be chosen if you type 1,2 or 3.If you just enter the enter key,the default server hhvm will be chosen.
11. Complete initialization
If the following message appears, then initialization is complete.
innodb_buffer_pool_size = 768M query_cache_size = 192M Initialization of KUSANAGI has been completed
* Numbers shown above may vary, depending on the memory size of the virtual machine.
Initialization is completed.
You can now proceed to WordPress provisioning.