Alibaba Cloud Simple Application Server provides Windows Server OS images and mainstream Linux OS images. You can use these images to create a clean, 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.

Background information

For more information about how to deploy development environments and build websites, see Overview of best practices.

Step 1: Create a simple application server

  1. Log on to the Simple Application Server console.
  2. In the left-side navigation pane, click Servers.
  3. In the upper-right corner of the Servers page, click Create Server.
  4. On the Simple Application Server page, configure parameters to create a simple application server.
    The following table describes the parameters.
    Parameter Example value 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 deployed in regions outside mainland China such as the China (Hong Kong) and Singapore regions use international bandwidths. High network latency may occur when you access these servers from within mainland China. We recommend that you select a region that is closest to the geographical location of your intended users for higher access speeds. For more information, see Regions and network connectivity.
    Image
    • Type: OS Image
    • OS: CentOS
    • Version: 7.6
    Select a tab and then select an image.
    • 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 OS. You can install applications on the OS based on your business requirements.
    • Custom Images: shows custom images. Custom images are created from snapshots of simple application servers. You can use a custom image to create simple application servers that have the same configurations. For more information, see Overview of custom images.
    Instance Plan $3.5/mo Select a plan based on your business requirements. You are charged additional fees for outbound data transfer to the Internet beyond the plan. For more information about billing, see Billable items and Quota and billing of data transfers.
    Data Disk 0 GB Optional. To have more storage space on the simple application server, you can 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 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.
  5. Click Buy Now.
  6. On the Confirm Order page, verify the order information.
  7. 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.
  8. Click Pay and follow the on-screen instructions to make a payment.
    After the payment is made, go back to the Simple Application Server console. On the Servers page, find the server that you created. After the state 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, see Connect to a Linux server.

In this topic, the Linux server is connected to by using the Simple Application Server console. After the server is connected to, run the following command to switch the current user to the root user. This helps you configure applications in subsequent operations.
sudo su root

Step 3: Configure Apache

  1. Run the following command to install Apache:
    yum install -y httpd
  2. Run the following commands in sequence to start Apache and make Apache start at boot time.

    Start Apache:

    systemctl start httpd

    Make Apache to start at boot time:

    systemctl enable httpd
  3. Run the following command to check the status of Apache:
    systemctl status httpd
    If a command output similar to the following one is returned, Apache is running normally. apache active
  4. On your computer, access <The public IP address of the simple application server> by using a browser to check whether you can go to the Apache HTTP server test page.
    To obtain the public IP address of the simple application server, perform the following operations:
    1. Go back to the Simple Application Server console.
    2. On the Servers page, click the server to go to the Overview page.
    3. In the Server Information section, view the public IP address. 1223
    The following figure shows the Apache HTTP server test page. 12335

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 the domain name:

  1. 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.

    Domain name example: example.com.

  2. If the website to which the domain name points is hosted on a server within a Chinese mainland region, you must apply for an ICP filing for the domain name.
  3. Optional: Resolve the domain name and make it point 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.
  4. Go back to the details page of the WordPress server. In the left-side navigation pane, choose Website > Domains.
  5. Click Add Domain Name.
  6. 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 have the domain name resolved based on the on-screen instructions in the Simple Application Server console.