Deploying multiple websites on the same server while ensuring that they run and display independently is a common need for many content operators.For AnQiCMS users, this is not only feasible but also very efficient.The Anqi CMS, with its powerful multi-site management features, allows you to easily manage multiple brand sites, sub-sites, or content branches with just one core program.
Next, we will discuss in detail how to cleverly deploy and manage multiple secure CMS sites on the same server, so that they operate independently and do not interfere with each other.
Core Concept: A single program, multiple sites
The strength of AnQi CMS lies in its ability to manage multiple independent websites through a set of core programs.This means you do not need to copy the complete code of AnQi CMS for each new site, but instead use the multi-site management feature provided by the main site to create and maintain them.All sites will be served by the same AnQi CMS application instance, but each site has its own independent backend management, database table structure (data isolation), templates, and content.This design greatly simplifies maintenance work and effectively saves server resources.
Preparation
Before starting the deployment, you need to make some preparations:
- A server that is installed and running the AnQi CMS:Ensure that the first Aiqi CMS site has been successfully installed on your server and is accessible.This site will serve as the "main site", used to add and manage other child sites.
- Multiple independent domain names:Prepare a separate domain for each new site you want to deploy (for example
site1.com,site2.com), and point them to your server IP address. - Server management tools:If you use Baota panel (or 1Panel, aaPanel, etc.), the operation will be relatively simple.If you are manually configuring Nginx or Apache, you also need to ensure you are familiar with these web server configurations.
Deployment steps in detail
The entire process is divided into two main parts: adding a new site in the Anq CMS backend and configuring the server's reverse proxy.
Step 1: Add a new site in the main Anq CMS backend.
First, you need to log in to the management backend of your first, that is, the main security CMS site.
- Enter multi-site management:In the left navigation bar, find and click the "Multi-site Management" feature. Here, the list of all added sites will be displayed.
- Add a new site:Click the 'Add new site' button, a configuration interface will pop up, where you need to fill in the details for the new site.
- Site Name:Choose a name for the new site that is easy to recognize and convenient for you to manage in the background.
- Site root directory:This is a very critical setting, which defines the path where the independent data of the new site is stored. You need to specify a new site for this.Brand new, not duplicated with other sitesThe directory. For example, if your security CMS main program is deployed in
/www/wwwroot/anqicms.com, you can create a new subdirectory under this directory, such as/www/wwwroot/anqicms.com/newsite_data. If you are deploying through Docker, the directory is usually named/app/for example/app/dev_anqicms_com. Ensure that this directory exists in the file system and that the CMS has write permissions. - Website address:Enter the complete domain name you have prepared for your new site, for example
http://site2.comorhttps://www.site2.comMake sure to check it correctly, this will be the actual address for users to access your new site. - Administrator account and password:Set a new site independent account and password. This account will be used to log in to the new site's backend.
- Database name:Specify one for the new siteBrand new, not duplicated with any other site's databaseFor example
anqicms_site2. Anqi CMS will create an independent table in this database for the new site to store data, ensuring data isolation. - Database information reuse: It is strongly recommended to check the option to reuse the default database account information.Since all sites are served by the same Anqi CMS program, they use the same database connection credentials to access their independent databases.
- Select the template to use:Select an appropriate template for the new site.
- Confirm creation:After filling in, click the "OK" button. Anqi CMS will automatically initialize the site data in the new database and complete the background configuration.
At this point, the data structure and backend management of the new site are ready.But users cannot access it through the domain name because the external domain request has not yet been associated with the running Anqi CMS program.
Step 2: Configure server reverse proxy
This is a critical step to point your new domain to the AnQi CMS program. Whether using Baota panel or manually configuring Nginx/Apache, the core idea is to set up a 'reverse proxy' to forward the access requests from the external domain to the internal port that your AnQi CMS program is listening on (usually8001)
If you use Baota panel or 1Panel:
- Create a new website:In the panel, create a new domain (such as
site2.comCreate a website. When choosing a website type, you can select 'static' or 'reverse proxy'. - Set the running directory:Enter the settings page of the newly created website, in the "Website Directory" option, set the "Running Directory" to the directory under your main AnQing CMS program directory.
publicFolder. For example, if the main security CMS program is in/www/wwwroot/anqicms.com, then the running directory should be set to/www/wwwroot/anqicms.com/public. - Configure reverse proxy:Find the 'Reverse Proxy' feature in the website settings.
- Proxy name:You can fill it in arbitrarily, convenient for identification.
- Target URL:Enter the address and port of your main AnQi CMS program. It is usually `http://127.0.0.1:800