Preparation and Core Service Deployment
First, please refer to the installation guide of AnQiCMS in the Baota panel Docker environment to successfully deploy the first AnQiCMS instance.During this process, you need to install Docker version of MySQL and note down its root password, because the subsequent new site's database configuration will reuse this information.After the AnQiCMS container starts and binds to the local port (usually 8001), point your main domain to the container service via Baota panel reverse proxy.After completing this step, your first AnQiCMS website will be accessible normally and will have an initial administrator account and password.
Add Reverse Proxy Site on Baota Panel
When your AnQiCMS core service is running in Docker and listening on an internal port (such as127.0.0.1:8001When, it is necessary to bind a domain name to the new site and point it to the AnQiCMS service, you need to use the reverse proxy feature of the Baota panel.
First, log in to your Baota panel.In the left navigation bar, select the "WebsiteClick the "Add Reverse Proxy" button to start configuring a domain for the new site.
In the "Domain" field, enter the domain name of your new site, for exampledev.anqicms.com. This domain must already be resolved to your server's IP address.
“Target URL” points to the internal address and port that your AnQiCMS Docker container is listening on. Normally, this should be filled in ashttp://127.0.0.1:8001If your AnQiCMS Docker container is listening on a different port, please adjust it according to the actual situation.
Confirm the configuration is correct and click the "Submit" button. Baota panel will automatically create and configure the reverse proxy rules for the domain name for you, allowing external requests to be forwarded to your AnQiCMS service through the domain name.
In the Anqi CMS backend, configure a new site
After the reverse proxy configuration is completed, you need to log in to the AnQiCMS admin panel to officially create and configure a new site.AnQiCMS has built-in comprehensive multi-site management functions, allowing you to manage all sites from a single backend.
Log in to the AnQiCMS backend of your main site and navigate to the 'Multi-site Management' area.Click the 'Add new site' button to start the configuration of a new site.
The "Site Name" can be named according to your actual needs, which helps you distinguish different sites in the backend.
“Site root directory” is a very critical setting, which is used to independently store new site cache, static files, and other data to ensure data isolation between different sites. Since AnQiCMS runs in a Docker container, its file system path is unified from/app/Start. Therefore, it is recommended that you name it according to/app/Replace the dots in the domain name with underscores for naming, for example, if the new site domain isdev.anqicms.com, then the root directory of the site can be set to/app/dev_anqicms_comPlease ensure that the root directory name of each site is unique.
“Website address”Enter the full URL of the new site, for examplehttp://dev.anqicms.com.
Set an independent “Administrator account password” for the new site, which will be your credential for logging into the site's backend in the future.
The database name also needs to specify a unique database for the new site. To maintain consistency and facilitate identification, you can continue to use the method of replacing the dots in the domain name with underscores, for exampledev_anqicms_com.
In the 'Database Information Reuse' option, since your AnQiCMS is deployed using Docker and usually only one MySQL instance serves all sites, selecting 'Reuse Default Database Account Information' will be the most convenient way.AnQiCMS will use the MySQL root account and password you configured during Docker installation to create a database for the new site.
Finally, select a suitable "template" for the new site, then click the "OK" button to complete the creation of the new site.AnQiCMS will automatically initialize all the necessary data tables and basic configurations required for a new site in a newly created database.
Access and verification of the new site
After completing the reverse proxy configuration of the Baota panel and the creation of the new site in the AnQiCMS backend, your new site has been successfully deployed.
You can enter the domain name of the new site in the browser, for examplehttp://dev.anqicms.com/Come to visit the front-end page of the new site and perform the initial installation (if AnQiCMS does not automatically jump to the installation interface).In most cases, AnQiCMS will recognize the new domain and guide you through the initial setup.
To access the backend management interface of the new site, just add it to the end of the new site domain name/system/Path, for examplehttp://dev.anqicms.com/system/Login with the administrator account and password you set when configuring your new site to start managing the content of the new site.
Through this method, you have successfully deployed and managed multiple independent sites in an AnQiCMS Docker container instance using reverse proxy and the built-in multi-site feature of AnQiCMS.This greatly simplifies operations and improves the efficiency of multi-site operations.
Common Questions and Answers (FAQ)
1. Why do I only need to deploy one AnQiCMS Docker container instance to achieve multi-site management instead of deploying a container for each site?
This is because AnQiCMS has considered the need for multi-site management from the very beginning.It includes a site management module that allows multiple logically independent sites to be created and managed within the same AnQiCMS application instance.Each site has its own database, file directory (used for caching, uploading, etc.), template, and configuration.Docker containers provide a unified runtime environment here, while the AnQiCMS application itself is responsible for internal multi-site routing and data isolation.This pattern has lower resource consumption and more centralized and efficient management.
2. In AnQiCMS background, what are the considerations when specifying 'Site Root Directory' and 'Database Name'?
The purpose of the "site root directory" is to provide an independent file storage space for each new site, used to store each site's cache, attachments, logs, and other files. In the Docker environment, this directory needs to start with a path that is accessible within the container, for example,/app/. To avoid file path conflicts between different sites, it is recommended to use domain names for naming (such asdev_anqicms_com).
“Database name” refers to creating an independent database instance for a new site, ensuring that the data of each site does not interfere with each other. Similarly, using the domain name as part of the database name (such asdev_anqicms_com)Helps to clearly identify and manage data for each site at the database level.Since the Docker installation of AnQiCMS usually shares a MySQL service, you can simply select 'Reuse default database account information' when creating a new site, and AnQiCMS will use the configured permissions to create a new database.
3. After deployment, how to troubleshoot if the new site shows a "502 Bad Gateway" or "404 Not Found" error?
If you encounter "502 Bad Gateway", it usually means that Baota's reverse proxy failed to successfully connect to the AnQiCMS Docker container service. You need to check:
- Is the AnQiCMS Docker container running normally? (Check in the Baota Docker management interface)
- Is the target URL of the Baota reverse proxy correctly pointing to the internal IP and port of the AnQiCMS container (for example
http://127.0.0.1:8001)? - Is the server firewall or security group blocking access to this internal port?
If the '404 Not Found' error occurs, it usually indicates that the reverse proxy has successfully forwarded the request, but the AnQiCMS application internally could not find the corresponding site or page. You need to check:
- Whether the site has been successfully added in the "Multi-Site Management" of AnQiCMS backend?
- Is the "Website Address" in the site configuration exactly the same as the domain name you are visiting (including
http/https)? - Does the new site need to be initially installed? Try to access it.
http://your-new-domain.com/system/Check if you can enter the background login or installation interface. - Is the pseudo-static rule correctly configured? Although most of the processing is handled by the reverse proxy, the URL rewriting within AnQiCMS also depends on its own pseudo-static configuration.