Quick start with WordPress on Alibaba Cloud. We use the WordPress image on Alibaba Cloud Marketplace.
We will reply on the Terraform to provision the cloud resources in this tutorial. If you are the 1st time to use Terraform, please refer to terraform templates to learn how to install and use the Terraform on different operating systems.
https://github.com/alibabacloud-howto/solution-marketplace-wordpress
More tutorial around Alibaba Cloud Database, please refer to this link.
Run the terraform script to initialize the resources. Within the terraform script, please use the right Image ID
of WordPress image on the corresponding region.
After the Terraform script execution, open the following URL in a Web browser to initialize WordPress:
http://<ECS_EIP>
Note: Replace the <ECS_EIP>
placeholder with the Elastic IP address of the ECS instance.
Run the terraform script to initialize the resources. Within the terraform script, please use the right Image ID
of WordPress image on the corresponding region.
ssh root@<EIP_ECS>
Edit the WordPress configuration file to set the RDS MySQL URL, database and account information.
vim /data/wwwroot/wordpress/wp-config.php
Open the following URL in a Web browser to initialize WordPress:
http://<ECS_EIP>
Note: Replace the <ECS_EIP>
placeholder with the Elastic IP address of the ECS instance that you obtained previously.
Run the terraform script to initialize the resources. Within the terraform script, please use the right Image ID
of WordPress image on the corresponding region.
ssh root@<EIP_ECS>
Edit the WordPress configuration file to set the PolarDB MySQL URL, database and account information.
vim /data/wwwroot/wordpress/wp-config.php
Open the following URL in a Web browser to initialize WordPress:
http://<ECS_EIP>
Note: Replace the <ECS_EIP>
placeholder with the Elastic IP address of the ECS instance that you obtained previously.
Auto-scaling configuration
After you have successfully configured and installed WordPress, you can follow the step 4 of following guide for auto-scaling configurations:
https://www.alibabacloud.com/blog/cloud-native-wordpress-on-alibaba-cloud_598043
Run the terraform script to initialize the resources. Within the terraform script, please use the right Image ID
of WordPress image on the corresponding region.
After the Terraform script execution, logon to ECS via SSH, use the account root/N1cetest, the password has been predefined in Terraform script for this tutorial. If you changed the password, please use the correct password accordingly.
ssh root@<EIP_ECS>
Edit the WordPress configuration file to set the RDS MySQL URL, database and account information.
vim /data/wwwroot/wordpress/wp-config.php
Open the following URL in a Web browser to initialize WordPress:
http://<ECS_EIP>
Note: Replace the <ECS_EIP>
placeholder with the Elastic IP address of the ECS instance that you obtained previously.
Configure Redis caching
Run the following commands in sequence to download the Redis object cache plugin and unzip the plugin package:
wget https://downloads.wordpress.org/plugin/redis-cache.2.0.18.zip
unzip redis-cache.2.0.18.zip
Run the following commands in sequence to copy the redis-cache folder to the /data/wwwroot/wordpress/wp-content/plugins/
path and configure WordPress to access ApsaraDB for Redis:
cp -rf redis-cache /data/wwwroot/wordpress/wp-content/plugins/
vim /data/wwwroot/wordpress/wp-config.php
Complete the settings as follows:
// Redis settings
define( 'WP_REDIS_HOST', '<Redis URL>' );
define( 'WP_REDIS_CLIENT', 'predis' );
define( 'WP_REDIS_PORT', '6379' );
define( 'WP_REDIS_DATABASE', '0');
define( 'WP_REDIS_PASSWORD', 'wordpress:N1cetest' );
Please MAKE SURE this Redis setting block is set at the first settings block of the wp-config.php file as shown in the image above.
Run the following command to copy the object-cache configuration file to the /data/wwwroot/wordpress/wp-content/
path:
cp /data/wwwroot/wordpress/wp-content/plugins/redis-cache/includes/object-cache.php /data/wwwroot/wordpress/wp-content/
Log on to WordPress to enable Redis object cache.
In the left-side navigation pane, click Plugins. Find the Redis Object Cache plugin and click Activate.
After the plugin is activated, click Settings.
Verify that the plugin status is Connected. Click Flush Cache to synchronize cache data to the ApsaraDB for Redis instance.
Now, your cloud native Wordpress has been setup successfully. You can visit it via SLB EIP:
http://<SLB_EIP>/
Auto-scaling configuration
After you have successfully configured and installed WordPress, you can follow the Step 4 of the following guide for auto-scaling configurations:
https://www.alibabacloud.com/blog/cloud-native-wordpress-on-alibaba-cloud_598043
Run the terraform script to initialize the resources. Within the terraform script, please use the right Image ID
of WordPress image on the corresponding region.
ssh root@<EIP_ECS>
Edit the WordPress configuration file to set the PolarDB MySQL URL, database and account information.
vim /data/wwwroot/wordpress/wp-config.php
Open the following URL in a Web browser to initialize WordPress:
http://<ECS_EIP>
Note: Replace the placeholder with the Elastic IP address of the ECS instance that you obtained previously.
Auto-scaling configuration
After you have successfully configured and installed WordPress, you can follow the following guide for auto-scaling configurations:
https://www.alibabacloud.com/blog/cloud-native-wordpress-on-alibaba-cloud_598043
Quick Path to Create RDS SQL Server Enterprise Edition Primary Instance and Read-Only Instance
Setup RDS for PostgreSQL LDAP Authentication with Active Directory Deployed on ECS
Marketplace - November 23, 2018
Alibaba Cloud Community - March 25, 2022
Alibaba Clouder - February 25, 2020
Alibaba Clouder - April 12, 2019
Alibaba Clouder - February 21, 2020
Alibaba Cloud Serverless - August 21, 2019
A financial-grade distributed relational database that features high stability, high scalability, and high performance.
Learn MoreA database engine fully compatible with Apache Cassandra with enterprise-level SLA assurance.
Learn MoreApsaraDB for HBase is a NoSQL database engine that is highly optimized and 100% compatible with the community edition of HBase.
Learn MoreMarketplace is an online market for users to search and quickly use the software as image for Alibaba Cloud products.
Learn MoreMore Posts by ApsaraDB