Alibaba Cloud Simple Application Server provides Windows Server OS images and mainstream Linux OS images. You can use these images to create a simple, safe, and stable runtime environment. This topic describes how to configure Apache with ease. In this topic, a CentOS 7.6 OS image is used.
For more best practices for building websites or deploying development environments, see Overview.
Step 1: Create a simple application server
- Log on to the Simple Application Server console.
- In the left-side navigation pane, click Servers.
- In the upper-right corner of the Servers page, click Create Server.
- On the Simple Application Server page, configure parameters to create a simple application server.
The following table describes the parameters.
Parameter Example Description Region China (Hong Kong) Select a region based on the geographical location of your business. The region cannot be changed after the server is created. Proceed with caution.Note Simple application servers in regions outside mainland China such as the China (Hong Kong) and Singapore (Singapore) regions use international bandwidth. High network latency may occur when you access these servers from regions inside mainland China. We recommend that you select a region that is close to the geographical location of your intended users to speed up access. For more information, see Regions and network connectivity. Image
- Type: OS Image
- Operating system: CentOS
- Version: 7.6
Select an image based on your business needs.
- Apps Image: shows application images. Application images contain application environments and allow you to deploy development environments or build websites with ease.
- OS Image: shows OS images. OS images contain only clean operating systems. You can install applications based on your needs.
- Custom Images: shows custom images. Custom images are created from snapshots of simple application servers. You can use a created custom image to create simple application servers that have identical configurations. For more information, see Overview.
Instance Plan $3.5/mo Select a plan based on your business needs. You are charged additional fees for outbound data transfer to the Internet beyond the plan. For more information about billing, see Billable items and Billing of data transfers. Data Disk 0 GB Optional. To have more storage space on the simple application server, you can specify a non-zero value to create and attach a data disk of the specified size. Subscription Time 1 Month Select a subscription period for the simple application server. You can optionally select Auto-renewal to enable the auto-renewal feature. Quantity 1 Specify the number of simple application servers that you want to create. The default value is 1. You can create up to 20 simple application servers at a time.
- Click Buy Now.
- On the Confirm Order page, confirm the order.
- In the Terms of Service section, read the General Terms and End User License and select I have read and agree to General Terms, End User License.
- Click Pay and follow the instructions to make a payment.
After the payment is made, go back to the Simple Application Server console. On the Servers page, find the created server. After the status of the simple application server changes from Initializing to Running, click the server card to view the server details.
Step 2: Log on to the simple application server
Log on to the Linux server. For more information about how to log on to a Linux server, see Connect to a Linux server.
rootuser. This facilitates subsequent application configurations.
sudo su root
Step 3: Configure Apache
- Run the following command to install Apache:
yum install -y httpd
- Run the following commands in sequence to start Apache and enable it to run on startup.
systemctl start httpd
Enable Apache to run on startup:
systemctl enable httpd
- Run the following command to check the running state of Apache:
systemctl status httpdIf a command output similar to the following one is returned, Apache is running normally.
- On your computer, access
<Public IP address of the simple application server>by using a browser to test whether you can go to the Apache HTTP server test page.The following figure shows the Apache HTTP server test page.
Step 4: (Optional) Bind and resolve a domain name
The security of your server is compromised if you use the public IP address of the server to access websites. To ensure server security, we recommend that you access websites by using a domain name. If you have registered or want to register a domain name, perform the following operations to bind and resolve a domain name:
- Register a domain name.
For more information, see Register a generic domain nameHow to register an Alibaba Cloud domain name. If you have registered a domain name, skip this step.
- If the website to which the domain name points is hosted on a server within a mainland China region, you must apply for an ICP filing for the domain name.
- Optional:Resolve the domain name and point it to the public IP address of the server.
- If your domain name is registered with Alibaba Cloud, skip this step. After the domain name is bound, the system resolves the domain name.
- If your domain name is not registered with Alibaba Cloud or resolved by Alibaba Cloud DNS, you can add the domain name for Alibaba Cloud DNS to resolve it. For more information, see Domain Management. You can also contact the domain name service provider, create an A record for the domain name that points to the IP address of the WordPress server, and then bind the domain name.
- Go back to the details page of the WordPress server. In the left-side navigation pane, choose .
- Click Add Domain Name.
- Enter a domain name and click OK.
After the domain name is bound, the system checks whether the domain name is resolved.
- If the domain name is registered with Alibaba Cloud or resolved by Alibaba Cloud DNS, click OK. The domain name is bound.
- If the domain name is not registered with Alibaba Cloud or resolved by Alibaba Cloud DNS, the domain name remains in the Unresolved state after it is bound. You can configure the domain name to be resolved based on the on-screen tips in the Simple Application Server console.