How to deploy multiple independent AnQiCMS sites on the same physical server?
In the rapidly changing digital age, businesses and content operators often face the challenge of managing multiple websites.AnQiCMS (AnQiCMS) is an efficient content management system developed based on the Go language, and its multi-site management function is exactly designed to solve this pain point.As an experienced website operator proficient in AnQi CMS, I know that readers are eager for efficient and convenient solutions.Today, I will elaborate on how to deploy multiple independent security CMS sites on the same physical server, helping you optimize resources and simplify management.
Embark on the journey of multiple sites: The core advantages of AnQiCMS
The Anqi CMS project is clearly positioned to become the preferred content management tool for small and medium-sized enterprises and content operation teams.One of its core highlights is the powerful "multi-site management" capability.This means you do not need to deploy a separate security CMS code for each site, but through a master instance, you can uniformly create, manage and maintain multiple independent content sites.This greatly reduces the repetitive workload, facilitates cross-site data sharing and resource integration, and can effectively utilize server resources to reduce O&M costs.Whether it is to have multiple brand sub-sites or to manage a media matrix with different content branches, Anqi CMS's multi-site function can provide a simple and efficient solution.
Comprehensive preparation before deployment
Before deploying multiple secure CMS sites, some basic preparations are essential.Firstly, you need a stable server. It is recommended to choose the Linux operating system, as it is more closely integrated with the Go language backend of Anqicms, providing better performance and security.In addition, MySQL database and Nginx or Apache and other reverse proxy server software need to be installed on the server.
Domain configuration is a key link in multi-site deployment. You need to prepare a separate domain for each independent Safe CMS site (for examplesite1.com,site2.com), and make sure that these domains have been correctly resolved to your server IP address. The correct DNS configuration is the prerequisite for users to access your various websites.
Deploy multiple AnQi CMS sites on the same server
The multi-site deployment strategy of AnQi CMS is based on a core concept: one AnQi CMS main program manages multiple front-end sites.This means you only need to run a safe CMS binary file or a Docker container, then use its backend features and reverse proxy configuration to differentiate and manage different websites.
Deploy the main AnQi CMS instance
Firstly, we need to deploy a main security CMS instance on the server. This can be achieved in two main ways:
Method one: Using the convenient deployment of Baota panel or 1Panel
If you use Baota panel (or its international version aaPanel) or 1Panel and other visual panels, the deployment process will be simplified:
You can search and install the Docker version of AnQiCMS in the panel app store, or directly deploy the AnQiCMS binary file through the "Go project" feature.
If you choose Docker deployment, please specify an internal port when creating a container (such as8001)and the corresponding server exposed port. If you plan to run multiple independent Aanqi CMS instances in Docker later (although Aanqi CMS's "multi-site management" feature allows a single instance to manage multiple sites, but in some specific scenarios, you may want to run multiple isolated Docker containers), you need to allocate a different server exposed port for each container.
After completing the installation of a Docker or Go project, configure a reverse proxy for the main security CMS instance. Create a reverse proxy site in the panel's 'Website Management', and enter your main domain (for examplemain.com) Points to the internal address and port of the AnQiCMS instance (for example127.0.0.1:8001). This will ensure that your main site can be accessed normally.
Method two: manual deployment via command line
For those who prefer manual control or in environments without a visual panel, you can choose command line deployment:
Download the Linux installation package suitable for your server architecture from the AnQi CMS official website and unzip it into the specified directory, for example/www/wwwroot/anqicms-main.
Enter the directory after unzipping and executestart.shScript to start the Anqi CMS main program. It is recommended to add a scheduled task to check and start the program every minute to ensure that it runs automatically after the server restarts.crontab -eAdd a scheduled task to set up a check and start every minute.start.sh.
Next, you need to configure Nginx or Apache reverse proxy. For your main domain (for examplemain.com), create a new virtual host configuration. TorootThe directory points to the main program directory of AnQiCMSpublicfolder (for example/www/wwwroot/anqicms-main/public),and configure reverse proxy rules to forward all requests to the listening port of the AnQiCMS instance (such ashttps://en.anqicms.comAfter the configuration is completed, restart the Nginx/Apache service to make the changes take effect.
Add and manage multiple independent sites through the Anqi CMS backend.
After the main security CMS instance is deployed and running normally, it is the key step to add other independent sites using its powerful multi-site management function.
Log in to the backend management interface of your main AnQi CMS instance.In the left menu, you will find the "Multi-site Management" feature.Click the 'Add new site' button to start configuring your new website.
Here, you need to fill in a series of key information for the new site:
- Site name: Used for background identification and management, please fill in according to the actual situation.
- Site root directoryThis is a directory used to store independent data such as new site cache, uploaded files, etc. For Docker deployment, it is usually followed by
/app/for example/app/dev_anqicms.com; For manual deployment, it is a new directory on your server, for example/www/wwwroot/newsite.com. Make sure the root directory name of each site is unique to avoid data confusion. - website address: Enter the complete domain name of the new site, for example
http://dev.anqicms.comThis domain must have been resolved to your server IP. - Administrator account password: Set up independent backend administration account and password for new site.
- Database nameEach new site should have an independent database to ensure complete data isolation. Please fill in a unique database name, for example
dev_anqicms_comIf you are installed via Docker and have full management permissions for the database, you can choose to "reuse the default database account information", and Anqicms will automatically create and configure the database for you. - Select the template to useSelect a suitable template for the new site.
After filling in the information and clicking Confirm, Anqi CMS will create this new site instance for you in the background.
Configure the reverse proxy for the new site.
The final step is to configure reverse proxy for your new site. Add an independent virtual host or site configuration for each new domain in your Nginx or Apache configuration.Similarly, point the domain names of these new sites to the listening port of the security CMS main instance (for examplehttps://en.anqicms.com)
For example, the new site configuration for Nginx might look like this:
server
{
listen 80;
server_name dev.anqicms.com; # 新站点的域名
root /www/wwwroot/newsite.com/public; # 新站点的根目录(对应安企CMS后台设置的站点根目录,但此处指向其public子目录)
location @AnqiCMS {
proxy_pass https://en.anqicms.com; # 指向主安企CMS实例的端口
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 =200 @AnQiCMS;
location / {
try_files $uri $uri/index.html @AnQiCMS;
}
access_log /var/log/nginx/newsite.access.log; # 独立的访问日志
}
After configuration, make sure to restart your Nginx/Apache service so that the new reverse proxy rules take effect.Your new site is now accessible and can be used through its dedicated domain.You can click the 'Access Backend' button from the 'Multi-site Management' list in the main AnQi CMS backend to directly access the new website's backend