AnQiCMS is an efficient content management system developed based on the Go programming language, which usually runs on a specific port of the server, such as the default port 8001.To allow users to access the website through common domain names rather than adding a port number at the end of the address, we need to configure a reverse proxy.Apache is a widely used web server that can handle this task well, it acts like an intelligent gatekeeper, forwarding all requests through ports 80 or 443 (HTTP/HTTPS) to the AnQiCMS running internally, ensuring that the website content is displayed correctly.

Preparation

Before starting the configuration, make sure that your server is already installed with Apache HTTP Server and that AnQiCMS has been successfully run on the specified internal port (default is 8001). You can run it on the server bycurl http://127.0.0.1:8001To test whether AnQiCMS is responding normally. In addition, you should also have a domain name resolved to your server IP address.

Enable the necessary Apache modules

The reverse proxy feature of Apache depends on some core modules.On most Linux distributions, these modules are enabled by default, but just in case, it is recommended that you check and ensure that the following modules are enabled.You can use command-line tools such asa2enmodOn Debian/Ubuntu system, or edit directlyhttpd.confOn CentOS/RHEL system) to enable them:

sudo a2enmod proxy
sudo a2enmod proxy_http
# 如果需要使用负载均衡,可启用以下模块
# sudo a2enmod proxy_balancer
# sudo a2enmod lbmethod_byrequests
# 如果需要使用HTTPS,请启用SSL模块
sudo a2enmod ssl

Enable the module and restart the Apache service to make the changes take effect:

sudo systemctl restart apache2 # 或 sudo systemctl restart httpd

Configure Apache virtual host

Next, we need to create an Apache virtual host configuration file for your AnQiCMS website. Typically, these files are located/etc/apache2/sites-available/(Debian/Ubuntu) or/etc/httpd/conf.d/(CentOS/RHEL) directory. You can create a file namedyourdomain.com.confa new file (containingyourdomain.comReplace your actual domain), and edit its content, for example, for HTTP access:

`apacheconf