Linux上搭建jpress(java版wordpress)

安装tomcat 略
安装数据库 略
如果你想用域名打开你的网站,需要安装nginx 【Linux上搭建jpress(java版wordpress)】
重点来了(由于我不会打war包,咋们还是直接下载现成的吧) 下载源码包(里面就有tomcat需要的war文件)

wgethttps://github.com/JpressProjects/jpress/archive/0.4.0.tar.gz

解压
tar xf0.4.0.tar.gz

将解压后的站点目录搬家到tomcat 的webapps目录下面(我的是在/use/local/tomcat/webapps)
mvjpress-0.4.0/wars/jpress-web-newest.war/use/local/tomcat/webapps/

每次上线更新war包可能都需要重新启动tomcat 关闭
cd /usr/local/tomcat/bin ./shutdown.sh

开启
./startup.sh

检验端口是否正确打开(端口可在配置文件更改,我相信你们都会改,我的是8888)
netstat -lntup

网页端查看 地址栏 (ip+端口)
输入 ip+8888
一旦执行完上面这个操作,tomcat会自动把这个war包(jpress-web-newest.war)解压了 此时webapps目录下应该是这样
[root@pa1 webapps]#ll total 20304 drwxr-xr-x 14 root root4096 Nov 27 13:31 docs drwxr-xr-x6 root root4096 Nov 27 13:31 examples drwxr-xr-x5 root root4096 Nov 27 13:31 host-manager drwxr-x---8 root root4096 Jan 19 14:54 jpress-web-newest -rw-rw-r--1 root root 20764271 Sep 192016 jpress-web-newest.war drwxr-xr-x5 root root4096 Nov 27 13:31 manager drwxr-xr-x3 root root4096 Nov 27 13:31 ROOT

然后开始网页端初始化(注意我的端口是8888,看到这里请把下一步也看完) 地址栏输入 ip:8888/jpress-web-newest
如若上一步操作完了在网页端看到初始化界面,停下来,该操作mysql了,创建一个库,叫jpress,我知道你们都知道这是干嘛的
mysql -uroot -p create database jpress;

开始初始化配置了,没截图,看你们悟性了,如有问题,联系下方扣扣 jpress的后台地址是ip:8888/jpress-web-newest/admin/login 这里贴出我的nginx配置文件,以资后辈参考(各位注意排版哦)
#usernobody; worker_processes1; error_log/var/log/nginx/error.log; pid/usr/local/nginx/nginx.pid; events { worker_connections1024; } http { includemime.types; default_typeapplication/octet-stream; #log_formatmain'$remote_addr - $remote_user [$time_local] "$request" ' access_log/var/log/nginx/access.log; sendfileon; keepalive_timeout65; server { listen 80; server_name yimiyuntong.com; add_header X-Frame-Options SAMEORIGIN; location / { proxy_pass http://localhost:8888; proxy_redirectoff; proxy_set_headerX-Real-IP$remote_addr; proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_headerHost$host; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404; client_max_body_size1000m; client_body_buffer_size128k; proxy_connect_timeout18000; proxy_send_timeout18000; proxy_read_timeout18000; proxy_cache_valid 200 302 12h; proxy_cache_valid 301 1d; proxy_cache_valid any 1h; proxy_buffer_size4k; proxy_buffers4 32k; proxy_busy_buffers_size64k; proxy_temp_file_write_size 64k; } }}

End

    推荐阅读