I am glad to elaborate on this common but somewhat difficult problem in website operation.AnQi CMS is a modern content management system developed based on the Go language, and its deployment method is usually different from the traditional PHP environment.When you are facing a relatively low version of Baota panel and find that it does not directly provide deployment options for "Go projects", indeed some clever strategies are needed.Don't worry, this does not mean that you cannot enjoy the efficiency and convenience brought by AnQiCMS, we have a way to make it stable on your server.
Understanding Challenge: Why is the "Go project" option missing?
Firstly, we need to understand why some versions of Baota panel do not directly support "Go projects".This is usually because the execution mechanism of Go language applications is different from that of PHP and other scripting languages.The PHP application requires a PHP interpreter and a web server (such as Nginx, Apache) to work together, while Go language applications are usually compiled into standalone binary files that can start an HTTP service by themselves.The newer version of the Baota panel integrates the management of the Go language runtime environment, providing a one-click "Go project" deployment interface, simplifying process guardian and reverse proxy configuration.And the older versions require us to manually configure these settings, but that is exactly what we are good at as operations experts.
Deployment Strategy One: Skillfully using the "Other Projects" feature of the Baota panel
Even without a dedicated "Go project" entry, the "Other Projects" or "General Projects" feature of the Baota panel is still a powerful assistant for deploying AnQiCMS.This feature allows you to manage any executable program as a project and configure the necessary runtime parameters and domain binding.
1. File preparation and upload:First, you need to download the installation package suitable for the Linux environment from the official channel of AnQiCMS. Usually, this is a file with the extension.zipor.tar.gzThe compressed file at the end. Next, log in to your Baota panel, click the "Files" option in the left menu. Navigate to the file management interface, go to/www/wwwroot/Directory, create a dedicated folder for AnQiCMS, for exampleyourdomain.com. Upload the downloaded AnQiCMS installation package to this folder and unzip it. After unzipping, you will see a folder namedanqicms(or similar name) executable file, this is the core program of AnqiCMS.
2. Add "General Project": Now, go back to the left menu of the Baota panel, click on "Website", and then find the entry for "Other Items" or "General Items". Click the "Add General Item" button, and in the pop-up configuration interface, you need to fill in the following information carefully:
- Project executable file:Enter the full path of the executable file you just extracted from AnQiCMS, for example
/www/wwwroot/yourdomain.com/anqicms. - Project name:Give a recognizable name to your AnQiCMS site, for example
AnQiCMS-Main. - Project port:AnQiCMS listens to port 8001 by default. Enter here
8001If your server already has other programs using this port, you can find it in the AnQiCMS installation directory underconfig.jsonModify the listening port of AnQiCMS in the file and enter the modified port number here. - Execute the command:Also enter the full path of the AnQiCMS executable file, for example
/www/wwwroot/yourdomain.com/anqicmsThe binary files of Go language can usually be executed directly as commands. - Run user:Generally, it is chosen
wwwThe user can do it. - Boot up:Make sure to check this option, so that the AnQiCMS service can automatically recover after the server restarts.
- Bind domain:Enter the domain name you have resolved to this server, for example
www.yourdomain.com.
After completing the above configuration, click the "Submit" button. The Baota panel will start the AnQiCMS service and automatically set up process protection.
3. Configure reverse proxy:Although the General project started AnQiCMS, it listens by default to an internal port (such as 8001).In order for users to access your website through standard HTTP/HTTPS ports (80/443), we need to configure a reverse proxy.Find the domain you just bound in the "Website" list on the Baota panel, click the "Settings" button corresponding to it.After entering the settings page, select the "Reverse Proxy" tab, and click "Add Proxy".
- Proxy name:Fill in freely, for example
AnQiCMS-Proxy. - Target URL:Fill in
http://127.0.0.1:8001(If the AnQiCMS port is changed, please fill in the corresponding port). - Send domain:Select
$host. After saving the configuration, your Nginx or Apache server will forward all requests to the AnQiCMS service on port 8001 for your domain.
Strategy two: manual deployment via command line (more flexible solution)
If you find the functionality limitations of the Baota panel inconvenient or wish to have finer control, you can completely deploy AnQiCMS manually through the command line, and combine it with process guard tools and web server configuration.
1. File preparation and upload:Similar to deploying with Baota, download the AnQiCMS Linux installation package and upload it to the specified directory on the server using SSH tools (such as Xshell, PuTTY), for example/data/wwwroot/anqicms/.Extract the installation package.
2. Process guardian and self-starting:The AnQiCMS installation package usually includesstart.shandstop.shA script used to start and stop programs. To ensure that AnQiCMS continues to run and can automatically recover after server restarts, we can make use of Linux'scrontabSet a scheduled task to check and start every minute.
- Log in to the server via SSH and execute.
crontab -ecommand. - Add the following line in the open editing interface.
(Please move the*/1 * * * * /data/wwwroot/anqicms/start.sh/data/wwwroot/anqicms/Replace with your actual AnQiCMS installation path) - Save and exit (usually)
wq). Then manually execute the startup script:./start.sh. Even if the AnQiCMS program stops unexpectedly, crontab will automatically detect and restart it within a minute.
3. Configure Nginx/Apache Reverse Proxy:This is a critical step to expose the AnQiCMS service to external access. You need to edit your web server configuration file (Nginx or Apache).
- Nginx configuration example:Find the Nginx configuration file corresponding to your domain (usually in
/etc/nginx/conf.d/or/www/server/nginx/conf/vhost/below). InserverBlock adds or modifies the following content: nginx server { listen 80; server_name www.yourdomain.com;Replace with your domain # The root directory of AnQiCMS is usually public, but the Go application listens directly