All Products
Search
Document Center

Simple Application Server:Deploy Apache based on a CentOS system image

Last Updated:Jan 30, 2024

Alibaba Cloud Simple Application Server provides Windows Server OS images and mainstream Linux OS images. You can use these images to create pure, safe, and stable runtime environments. This topic describes how to configure Apache based on a CentOS 7.6 system image.

Background information

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

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-left corner of the page, click Create Server.

  4. On the Simple Application Server page, configure parameters based on your business requirements.

    The following table describes the parameters.

    Parameter

    Example

    Description

    Region and Zone

    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.

    Important

    Simple application servers in regions outside the Chinese mainland, such as China (Hong Kong) and Singapore, use international bandwidth. High network latency may occur when you access these servers from regions inside the Chinese mainland. We recommend that you select a region that is closest to the geographical location of your end users for higher access speeds of your users. For more information, see Regions and network connectivity.

    Image

    • Type: OS Image

    • OS: CentOS

    • Version: 7.6

    Select an image based on your business requirements.

    • 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 the base OS. You can install applications based on your business requirements.

    • Custom Images: shows custom images. Custom images are created based on 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 transfers over the Internet beyond the plan. For more information about billing, see Overview.

    Data Disk

    0 GB

    Optional. To have more storage space on the simple application server, you can create and attach a data disk of a specific size.

    Subscription Time

    1 Month

    Select a subscription duration for the simple application server. You can select Auto-renewal based on your business requirements.

    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 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 complete the payment.

    After you complete the payment, go back to the Simple Application Server console. On the Servers page, find the created server. After the state of the server changes from Initializing to Running, click the server card to view the details.

Step 2: Configure Apache

  1. Connect to the Linux server. For more information, see Connect to a Linux server.

  2. Switch the current user of the server to the root user for subsequent application configuration.

    sudo su root
  3. Run the following command to install Apache:

    yum install -y httpd
  4. Run the following commands in sequence to start Apache and enable Apache to run upon startup.

    Start Apache:

    systemctl start httpd

    Enable Apache to run upon startup:

    systemctl enable httpd
  5. 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 runs as expected. apache active

  6. On your computer, access <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.

    Note

    You can obtain the public IP address of the Linux server in the server card.

    The following figure shows the Apache HTTP server test page.12335

Step 3: (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 the 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:

  1. Register a domain name.

    For more information, see Register a domain name on Alibaba Cloud. If you have registered a domain name, skip this step.

    For example, the domain name that you registered is example.com.

  2. If the website to which the domain name points is hosted on a server deployed in the Chinese mainland, you must apply for an Internet Content Provider (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 to the server, the system automatically 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 in the Alibaba Cloud DNS console to resolve the domain name. For more information, see Manage domain names. You can also contact the service provider of the domain name, 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 Site Settings > Domain Name.

  5. Click Add Domain Name in the upper-right corner of the page.

  6. Enter the domain name of the WordPress blog site and click OK.

    After the domain name is bound to the server, 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 to the server. You can configure domain name resolution based on the on-screen instructions in the Simple Application Server console.

References

Simple Application Server provides multiple application images and OS images. You can use the images based on your business requirements. For more information, see Images.