All Products
Search
Document Center

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

Last Updated:Sep 11, 2024

Alibaba Cloud Simple Application Server provides Windows Server OS images and mainstream Linux OS images. You can use the images to create secure and stable runtime environments that do not contain third-party applications. This topic describes how to deploy Apache based on a CentOS 7.6 OS 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

    China (Hong Kong)

    The region in which you want to create the simple application server. 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 in the Chinese mainland. We recommend that you select a region that is closest to the geographical location of your end users for faster 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: displays application images. Application images contain application environments and allow you to deploy development environments or build websites with ease.

    • OS Image: displays OS images. OS images contain only base OSs. You can install applications based on your business requirements.

    • Custom Images: displays 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 capacity. For more information about billing, see Billing overview.

    Data Disk

    0 GB

    This parameter is optional. To increase the storage space of 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 whether to enable Auto-renewal.

    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, check the order information.

  7. In the Terms of Service section, read and select I have read and agree to General Terms and End User License.

  8. Click Pay and follow the on-screen instructions to complete the payment.

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

  9. (Conditionally required) If you attach a data disk when you create the simple application server, you must create partitions and file systems on the disk before you can use the disk. For more information, see Partition and format the data disk.

Step 2: Deploy 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 on server startup.

    Run the following command to start Apache:

    systemctl start httpd

    Run the following command to enable Apache to run on server 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 output 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 the 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.

    Sample domain name: example.com.

  2. If the website to which the domain name points is hosted on a simple application server inside the Chinese mainland, you must apply for an Internet Content Provider (ICP) filing for the domain name.

  3. 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, see Manage domain names.

    • 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 server, and then bind the domain name.

References

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