Installing Apache
Introduction
Apache HTTP Server (Apache for short) is a free open-source cross-platform web server software developed by the Apache Software Foundation. It can run in most operating systems and is widely used because of its high security. As one of the most popular web server software, Apache offers features such as support for FastCGI and SSL, and integration with Perl. This tutorial describes how you can deploy Apache in HCE 2.0.
Preparations
- Prepare an ECS and assign a public IP address or EIP to the ECS.
- Ensure that inbound security group rules allow traffic to flow to the ECS over port 80.
Procedure
- Install Apache.
- Run the following command to install Apache:
dnf install httpd httpd-devel
After the command is executed, the Apache configuration file is /etc/httpd/conf/httpd.conf.
- Run the following command to check the Apache version:
httpd -v
Information similar to the following is displayed:
[root@localhost system]# httpd -v Server version: Apache/2.4.51 (Unix) Server built: Feb 9 2022 09:00:41
- Run the following command to start Apache:
systemctl start httpd
If active (running) is displayed, Apache is started.
To set Apache to automatically enable upon system boot, run the following commands in sequence:
systemctl enable httpd systemctl daemon-reload
- Run the following command to install Apache:
- Verify Apache.
- Run the following command to create a test page:
echo test > /var/www/html/index.html
- Enter http://<Public IP address> in the address box of the browser. If the following figure is displayed, the deployment is successful.
- Run the following command to create a test page:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot