Home > Java > javaTutorial > body text

Example steps for building an open source java blog

零下一度
Release: 2017-06-29 11:56:40
Original
1809 people have browsed it

This blog system is open sourced by Wang Jue on GitHub and can be successfully deployed in a few simple steps.
After completing the blog installation, if you want to make it cooler to access, you can purchase a domain name on Tencent Cloud and then resolve the domain name to the public IP address of the server. The default port of tale is 9000. Every time you access it, you must add ":9000" after the IP address. Isn't this very troublesome? And accessing through domain names also requires adding a port number, which is not very cool. Well, the solution is as follows:
1. Download an nginx on the server:

sudo apt-get install nginx

2. Modify the default settings of nginx:

sudo vim /etc/nginx/sites-available/default

Comment out some of the lines and add a line in "location /". The example is as follows:

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
#root /usr/share/nginx/html;
#index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
proxy_pass http://0.0.0.0:9000;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}

In "proxy_pass http://0.0.0.0:9000;" added here The IP address and port number can be queried through this command:

netstat -ntlp | grep LISTEN

3. Save and exit, and then restart nginx:

sudo service nginx restart

The above is the detailed content of Example steps for building an open source java blog. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template