The article directories

  • 1. The Docker deployment
  • 2. Log configuration
  • 3. Nginx reverse proxy

Solo is a small and beautiful open source blogging system designed for programmers. Solo has a very active community. Articles can be pushed to the community as posts, and replies from the community will be linked as blog comments

Overall, the blog framework is good and the community is improving. Most importantly, it was written in Java. Popular blogging frameworks such as Hexo and Hugo are static blogs with no background, and most of their posts are published in Markdown HTML format. Solo, however, is managed behind the scenes, similar to Jpress.

  • Official website: b3log.org/solo, generally install a set of…
  • Run locally mainly for trial or static site generation

1. The Docker deployment

  • Docker mode deployment is the use of dynamic blog, mainly used to deploy dynamic blog on the server.
  • How to learn Docker: blog.csdn.net/qq_41684621…
  • Obtaining the latest image
docker pull b3log/solo
Copy the code
  • Start the container
  • Note: For the following command, if you are not sure how to use \ to do a line break, do not break the line, write the entire command in one line.
  • Using MySQL
  • Create library solo, character set utF8MB4, collation utF8MB4_general_CI
create database solo default character set utf8mb4 collate utf8mb4_general_ci;
create user 'root'@'127.0.0.1' identified by '123456';
grant all privileges on *.* to 'root'@'127.0.0.1';
flush privileges;
Copy the code
  • Open mysql on the server and execute it one by one
  • Note: the password above refers to mysqlrootThe user password
  • Start container:

docker run --detach --name solo --network=host \
    --env RUNTIME_DB="MYSQL" \
    --env JDBC_USERNAME="root" \
    --env JDBC_PASSWORD="123456" \
    --env JDBC_DRIVER="com.mysql.cj.jdbc.Driver" \
    --env JDBC_URL="JDBC: mysql: / / 127.0.0.1:3306 / solo? useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true" \
    b3log/solo --listen_port=6000 --server_scheme=http --server_host=localhost --server_port=
Copy the code
  • The startup parameters are described as follows: – Listen_port: specifies the process listening port, which can be customized. – server_scheme: specifies the final access protocol. If HTTPS is enabled for the reverse generation service, change this parameter to HTTPS. – server_port: specifies the final access port. Use the default value 80 or 443, and leave the value blank. For details about the parameters, run the -h command.
  • Note:JDBC_PASSWORDIt also refers to mysql on the cloud serverrootThe user password
  • Pay attention to--listen_port, I set the listening port number is6000The official answer is8080Port, because it’s on my server8080The port has been occupied by Tomcat, so the port is allowed6000Port firewall, you can also customize other port numbers (in the case of no conflict, that is, no other process is in use). Run the following command to enable the firewall port number:
firewall-cmd --zone=public --add-port=6000/tcp --permanent

firewall-cmd --reload

firewall-cmd --zone=public --list-ports
Copy the code
  • Also pass on security groups on the server6000port
  • After starting the container, you can run the following command to view the changes of the container processes
docker ps -a 
Copy the code
  • You can also print the log of SOLO to observe the successful installation
docker logs solo
Copy the code
  • When you see this log, solo is creating tables and initializing

2. Log configuration

  • The default bylog4j2To print logs to the standard output stream, you can passdocker logs soloTake a look. If you need to overridelog4jConfiguration, which can be achieved by mounting files:
--volume ~/log4j2.xml:/opt/solo/log4j2.xml
Copy the code
  • Mount third-party skins

    If you need to use third-party skins, you can mount directoriesskins, please refer to the original directory structureskins:
--volume ~/skins/:/opt/solo/skins/
Copy the code

3. Nginx reverse proxy

  • In the nginx installation directory conf foldernginx.confAdd the following file:
upstream backend {
    server localhost:6000; # Solo Listen port} server {listen80; server_name solo.xdr630.com; Access_log off; location / { proxy_pass http://backend$request_uri;proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; client_max_body_size 10m; }}Copy the code
  • On this side6000The port number is the one required by the solo process above
  • Reload the configuration to take effect after the addition is complete
nginx -s reload
Copy the code