Contents
- WordPress installation(Apache2.4、Mysql、PHP7)
- Creating a directory for the subdomain public web (blog1.example.com)
- Creating a database for a subdomain public web (blog1.example.com)
- Editing the Apache configuration file (httpd.conf)
- Restarting Apache
- Download and install WordPress
- Editing the WordPress configuration file
- Change owner
- Initialization of WordPress
WordPress installation(Apache2.4、Mysql、PHP7)
█ Installation Requirements
Install as a virtual host in an Apache 2.4, Mysql, PHP7 environment
█ Installation Order
- Creating a directory for the subdomain public web (blog1.example.com)
- Create a database (blog1_database) for the subdomain web (blog1.example.com)
- Edit the Apache configuration file (httpd.conf)
- Install WordPress
Creating a directory for the subdomain public web (blog1.example.com)
# mkdir -p /var/www/html/blog1.example.com # chmod 705 /var/www/html/blog1.example.com # systemctl restart httpd.service |
Creating a database for a subdomain public web (blog1.example.com)
Create a database for wordpress publishing in Mysql. go to the Mysql installation directory.
# mysql -u root -p Enter password: ← Root password for Mysql # systemctl restart httpd.service ・ ・ > create database blog1_database; > GRANT ALL PRIVILEGES ON blog1_database.* TO ‘User Name‘@’localhost’ IDENTIFIED BY ‘<password>‘; > exit |
Editing the Apache configuration file (httpd.conf)
Move to the directory where you installed Apache 2.4 (different if you installed it with yum or compiled it from source)
# vi /etc/httpd/conf/httpd.conf( or vi /usr/local/apache2/conf/httpd.conf) <VirtualHost *:80> <Directory “/var/www/html/ blog1.example.com“> |
Restarting Apache
# systemctl restart httpd |
Download and install WordPress
# wget https://ja.wordpress.org/wordpress-5.3-ja.tar.gz ← Download # tar zxvf wordpress-5.3-ja.tar.gz ← extracting After unzipping, a directory called “wordpress” will be created. Copy its contents to the document root (blog1.example.com). # cp -fr /wordpress/* /var/www/html/blog1.example.com/ |
Editing the WordPress configuration file
Move to the wordpress public directory (blog1.example.com)
# vi wp-config.php define(‘DB_NAME’, ‘database_name_here’); ↓ define(‘DB_NAME’, ‘blog1_database‘);define(‘DB_USER’, ‘username_here’); ↓ define(‘DB_USER’, ‘User Name’);define(‘DB_PASSWORD’, ‘password_here’); ↓ define(‘DB_PASSWORD’, ‘<password>‘); |
Change owner
# chown -R daemon:daemon /var/www/html/blog1.example.com |
Initialization of WordPress
When you open http://blog1.example.com/ with a web browser, the WordPress initialization screen will be displayed.
Fill in each field and click “Install WordPress”. (It is best to avoid using a user name that is easy to guess, such as “admin” or “root.)
This completes the installation of Word Press.