×
Community Blog Build a WordPress Website on a Windows instance Manually

Build a WordPress Website on a Windows instance Manually

This article describes how to build a WordPress website on a Windows Elastic Compute Service (ECS) instance.

By Alibaba Cloud ECS Team

This article describes how to build a WordPress website on a Windows Elastic Compute Service (ECS) instance.

Prerequisites

1.  A Windows instance is created and deployed with the Web environment. The following software versions are used in this tutorial:

  • Operating system: Windows Server 2012 R2 64-bit
  • Internet Information Services (IIS): 8.5
  • PHP: 7.0.28
  • MySQL: 5.5
  • WordPress: 5.3.2

Note: If you use software versions different from the preceding versions, you may need to modify parameter settings.

2.  A security group rule is added to a security group of the Windows instance to open port 80 and port 3389. For more information, see Add a security group rule.

Build a WordPress Website

1.  Connect to the ECS instance that is deployed with the web environment and download the WordPress installation package.

a) Connect to the instance. For more information, see Connect to a Windows instance by using a password or key.

b) Download the WordPress installation package from the official WordPress website. WordPress 5.3.2 is used in this tutorial.

Note: If you download WordPress on an ECS instance that is located in a region inside the Chinese mainland and the 429 Too Many Requests error is reported, we recommend that you try multiple times or download the WordPress installation package from a third-party website.

c) Decompress the WordPress installation package. In this tutorial, the WordPress installation package is decompressed to C:\wordpress.

2.  Create a MySQL database for the WordPress website that you want to build.

a) Go to the bin folder in the MySQL installation directory, right-click a blank area when you press and hold the Shift key, and then select Open command window here.

b) Log on to MySQL.

mysql -u root -p

c) Create a database for the WordPress website. In this tutorial, a database named wordpress is created for the WordPress website.

create database wordpress;

3.  Configure the WordPress website.

a) In the C:\wordpress directory, find the wp-config-sample.php file, copy the file, and name the file copy wp-config.php.

b) Use the text editor to open the wp-config.php file and modify information related to the wordpress database.

The following figure provides an example.

1

c) Save the wp-config.php file.

4.  Add the WordPress website to Server Manager.

a) Find the Server Manager icon in the Windows taskbar and open Server Manager.

2

b) In the top menu bar of the Server Manager window, choose Tools > Internet Information Services (IIS) Manager.

c) In the Connections pane, choose <ECS instance name> > Sites.

d) Delete the website that is bound to port 80, or change the port number from 80 to an unused port number, such as 8080.

3

e) In the right-side Actions pane, click Add Website to add the WordPress website.

The following figure provides an example.

4

Take note of the following parameters:

  • Site name: Specify a name for the website. In this tutorial, enter wordpress.
  • Application pool: Select DefaultAppPool.
  • Physical path: Select the directory where the WordPress installation package is decompressed. In this tutorial, select C:\wordpress.
  • Port: Enter 80.

5.  Install WordPress and log on to the WordPress website.

a) Visit http://localhost/ from the ECS instance. The WordPress installation page is displayed.

b) Enter basic information of the website and click Run the installation.

Take note of the following parameters:

  • Site Title: the name of the WordPress website. Example: demowp.
  • Username: the username that you want to use to log on to WordPress. Make sure that your username is secure. Example: testwp.
  • Password: the password that you want to use to log on to WordPress. We recommend that you specify a strong password.
  • Your Email: the email address that you want to use to receive notifications. Example: example.com.

c) Click Install Wordpress.

d) Enter the username and password that are used to install WordPress and click LOGIN.

You are logged on to your WordPress website.

Resolve the Domain Name of the WordPress Website

If you allow users to access your WordPress website by using the public IP address of the ECS instance, the security of the ECS instance is compromised. If you have a domain name or need to register a domain name for your WordPress website, perform the following steps. In this example, the domain name www.example.com is registered.

1.  Register a domain name.

For more information, see How to register a domain name on Alibaba Cloud.

2.  Apply for an Internet Content Provider (ICP) filing for the domain name.

If the website of your domain name is hosted on an ECS instance that is located in a Chinese mainland region, apply for an ICP filing.

3.  Resolve the domain name to the public IP address of the ECS instance.

Domain name resolution is a prerequisite for using domain names to access your website. For more information, see Get started with Alibaba Cloud DNS.

4.  Return to the ECS instance on which the WordPress website is deployed. Go to the bin folder in the MySQL installation directory, right-click a blank area when you press and hold the Shift key, and then select Open command window here.

5.  Log on to MySQL.

mysql -u root -p

6.  Switch to the wordpress database.

use wordpress;

7.  Replace http://localhost/ with the new domain name.

update wp_options set option_value = replace(option_value, 'http://localhost', 'http://www.WordPress.EcsQuickStart.com') where option_name = 'home' OR option_name = 'siteurl';

The new domain name is configured for your WordPress website.

0 1 0
Share on

Alibaba Cloud Community

1,044 posts | 257 followers

You may also like

Comments

Alibaba Cloud Community

1,044 posts | 257 followers

Related Products