Deploy Tale's personal blog on Linux system and publish it to the public network for access
Article directory
Preface
Today I bring you a lightweight blog open source project based on Java language - Tale. Tale is developed using the lightweight mvc framework Blage. It has the characteristics of small, beautiful, fast and stable. This project is completely open source and free, allowing you to quickly build a blog system including front and backend, greatly saving time on building a private blog.
Next, I will teach you how to deploy a Tale personal blog, penetrate the data tunnel through the intranet built by Cpolar, and publish your personal blog to the public Internet so that everyone can access it.
1. Tale website construction
The operating system version this time is CentOS7, and the java version is 1.8.0_381
1.1 Check the local environment
Check local operating system version
cat /etc/redhat-release
Check system kernel version
uname -r
Check the java version. You need to install the java environment before deploying the Tale application. The java environment has been installed in advance for this environment.
java -version
1.2 Deploy Tale personal blog system
Execute the following command to download the Tale source code
git clone https://github.com/otale/tale.git
View source directory
tree -L 3 ./tale/
View the installation script content
cat install.sh
Execute the installation script and execute the install.sh file
sh install.sh
1.3 Start the Tale service
Enter the Tale directory
cd tale/
Start the Tale service
./tool start
Check the Tale service status and check the tool command help information.
./tool --help
Check Tale service status
./tool status
Check the tale listening port. The normal listening port is 9000.
Turn on the firewall and open port 9000
firewall-cmd --add-port=9000/tcp --permanent
firewall-cmd --reload
1.4 Visit blog address
Access address: http://own IP:9000, fill in the website information and customize it.
After setting the website information, click "Next" and the initialization is completed successfully.
2. Linux installation Cpolar intranet penetration
After completing the construction of the Tale website, let's install the cpolar intranet penetration tool on Linux and forward the public network address of the local port mapping through cpolar. We can easily achieve remote access without having to register a domain name and purchase a cloud server. The following is to install cpolar step
cpolar official website address: https://www.cpolar.com
- Use one-click script installation command
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
- Add services to the system
sudo systemctl enable cpolar
- Start cpolar service
sudo systemctl start cpolar
After cpolar is successfully installed, access Linux port 9200 on an external browser: [http://LAN ip:9200]. Log in using your cpolar account. After logging in, you can see the cpolar web configuration interface, which is connected to the web management interface. Just configure
3. Create Tale blog public network address
After logging in to the cpolar web UI management interface, click Tunnel Management - Create Tunnel on the left dashboard:
- Tunnel name: It can be customized. Be careful not to duplicate the existing tunnel name.
- Protocol: http
- Local address: 192.168.50.188:9000 (own IP: 9000)
- Domain name type: Free random domain name
- Region: Select China Top
- Host header field: 192.168.50.188:9000 (own IP: 9000)
Click创建
After the tunnel is successfully created, click the status on the left - online tunnel list to view the generated public network access address. There are two access methods, one is http and https
4. Use the public address to access Tale
Use the above cpolar https public network address to access the browser of any device, you can successfully see the website interface initially created by Tale, and later design a beautiful website interface by yourself. In this way, a public network address that can be accessed remotely is created. There is no need to purchase a cloud server yourself, and it can be published to the public network for access.
Since the tunnel created using cpolar above uses a random public network address, it will change randomly within 24 hours, which is not conducive to long-term remote access. And the domain name of the website does not look beautiful. We can customize a fixed domain name, so we can configure a second-level subdomain name for it. The address is a fixed address and will not change randomly [ps: cpolar.cn has been filed]
Note that you need to upgrade the cpolar package to a basic package or above, and the bandwidth corresponding to each package is different. [cpolar.cn has been registered]
Log in to the cpolar official website, click Reserve on the left, select to reserve the second-level subdomain name, set a second-level subdomain name, click Reserve, and copy the reserved second-level subdomain name after the reservation is successful. Level subdomain name.
After the reservation is successful, copy the name of the second-level subdomain name that was successfully reserved.
Return to the cpolar web UI management interface, click Tunnel Management - Tunnel List on the left dashboard, find the tunnel you want to configure, and click Edit on the right
Modify the tunnel information and configure the successfully reserved second-level subdomain name into the tunnel.
- Domain name type: Select a second-level subdomain name
- Sub Domain: Fill in the successfully reserved second-level subdomain name
Click更新
(Note, click once to update, no need to submit again)
After the update is completed, open the online tunnel list. At this time, you can see that the public network address has changed and the address name has become a fixed second-level subdomain name.
Finally, we use a fixed public network address to access, and we can see that the access is successful. In this way, a fixed and permanent public network address is set.