As a senior CMS website operation personnel in an enterprise, I fully understand the importance of the content management system for enterprises and self-media.AnQiCMS with its high efficiency, flexibility, and security stands out among many CMS systems.For MacOS users, its simple deployment process makes local development and testing particularly convenient.Now, I will give you a detailed introduction on how to install and test AnQiCMS on MacOS.
AnQiCMS is an enterprise-level content management system developed based on the Go language, committed to providing a set of efficient, customizable, and easy-to-expand content management solutions.Its original design was to serve small and medium-sized enterprises, self-media operators, and users with multiple site management needs, effectively supporting diverse content display and management requirements.Whether it is to build a corporate website, a marketing website, a product display site, or a personal blog, AnQiCMS can provide strong and secure technical support.
Preparation of MacOS environment and download of AnQiCMS
Before installing and testing AnQiCMS on MacOS, we need to ensure that MySQL and Nginx are already installed in the local environment.These are the services required for AnQiCMS to run, and users need to install and configure them themselves.After completing the environment setup, you can visit the AnQiCMS official website to download the MacOS version of the package.Generally, this package will be a compressed file, please extract it to any directory where you wish to store the project after downloading.In the extracted folder, you will find the core executable file of AnQiCMS.
Start AnQiCMS and complete the initialization settings
After unzipping, you just need to double-click on the unzipped directory inanqicmsA executable file can start the AnQiCMS service. AnQiCMS defaults tohttp://127.0.0.1:8001This address listens for requests.When you first visit this address, the system will guide you to enter the initial installation interface.On this interface, you need to configure the database connection information, such as the MySQL address, username, password, and database name.At the same time, you also need to set the administrator account and password for AnQiCMS background.Ensure that the database information you provide is accurate and you have sufficient permissions. Moreover, the administrator password should be complex enough to ensure security.After completing these settings, click the install button, AnQiCMS will complete the initialization deployment.
Configuring Nginx reverse proxy and local domain resolution
To better simulate the production environment and access with a more friendly domain name, it is recommended to configure Nginx reverse proxy on MacOS and modify the local hosts file. First, you need to modify the Nginx configuration file and add a newserverSet up a reverse proxy for AnQiCMS. Below is an Nginx configuration example, which you can adjust according to your actual situation and place in the Nginx configuration file.httpWithin block:
server {
listen 80;
server_name yourdomain.com; # 替换为你想使用的本地域名
location @AnqiCMS {
proxy_pass http://127.0.0.1:8001; # AnQiCMS默认监听端口
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;
}
}
Please replaceyourdomain.comReplace it with the domain name you wish to test locally, for exampletest.anqicms.local. After saving the Nginx configuration, please restart the Nginx service to make the changes take effect.
Next, you need to modify the MacOS's/etc/hostsfile, and point the local domain configured in Nginx to127.0.0.1. Open the terminal, usesudo nano /etc/hostsCommand edit the file and add the following line at the end:
127.0.0.1 test.anqicms.local
Save and close the file. This way, when you visit the site in your browser,test.anqicms.localWhen, the request will be proxied to the locally running AnQiCMS service via Nginx.
Access and test AnQiCMS
After completing these steps, you can access your AnQiCMS site via the browser. Enter the locally configured domain name in the browser address bar (for examplehttp://test.anqicms.local),You will see the AnQiCMS front-end page. To access the admin interface, please add the domain name after/system/Path, for examplehttp://test.anqicms.local/system/. If you did not set the administrator account password during initialization, the default account isadmin, and the password is123456. It is strongly recommended that you change the default password immediately after your first login to the backend to enhance security.
In the background, you can start creating content, managing categories, configuring SEO options, and testing the various functions of AnQiCMS.By setting up and testing locally, you can fully familiarize yourself with the system's operational procedures and content publishing mechanism, preparing for future online deployment.The AnQiCMS multi-site management feature can also be tested in the MacOS environment.You just need to repeat the steps of Nginx reverse proxy and hosts file configuration, set up an independent domain name for each new site, and add a new site to the multi-site management interface in the AnQiCMS background.
By following these detailed steps, MacOS users can easily install and test AnQiCMS locally, fully utilizing its enterprise-level content management capabilities to provide a solid foundation for website operations.
Frequently Asked Questions (FAQ)
1. How to handle the prompt 'Port is already in use' when running AnQiCMS on MacOS?
AnQiCMS default usage8001Port. If you encounter an issue with the port being occupied at startup, you can first use the terminal commandlsof -i:8001Find out which process is using the port. After finding the corresponding process ID (PID), you can usekill -9 [PID]Command to terminate the process. If you need to avoid this problem long-term, you can consider modifying the configuration file under the AnQiCMS installation directory, which willportChange the parameter to another unoccupied port number, such as8002Then restart the AnQiCMS service.
2. How to properly stop or close AnQiCMS after starting it on MacOS?
Due to AnQiCMS being directly executed as an executable file on MacOS, it usually displays the running log in the terminal window.To stop AnQiCMS, you can close the terminal window it is running in.nohupcommand), or if you cannot find the corresponding terminal window, you can use it in the terminal.ps -ef | grep anqicmsCommand to find the process ID (PID) of AnQiCMS. Once you find the PID, you can usekill -9 [PID]Order to forcibly terminate the process, thereby closing the AnQiCMS service.
3. After configuring Nginx reverse proxy and hosts file, why can't I access AnQiCMS via domain name? Why?
There are several common reasons that can cause this problem. First, make sure that the Nginx service has been successfully started or restarted. You can usenginx -tCheck the syntax of the Nginx configuration file and then usesudo nginx -s reloadRestart Nginx. Next, please check the Nginx configuration file carefully.server_nameandproxy_passIs the setting completely matched with your actual domain and AnQiCMS listening port (default is 8001). Finally, confirm your/etc/hostsThe file has correctly pointed to the domain127.0.0.1And the browser cache may need to be cleared, or try accessing in a different browser or incognito mode.