Chen Jian's Java Blog 

Enable https for your nginx-hosted website with a CA-signed certificate

by Chen Jian


Posted on 2016-07-18 12:00 in Maintenance


1. Exchange a Certificate Signing Request for certificate files openssl req -new -newkey rsa:2048 -nodes -keyout private.key -out my.csr Then submit my.csr file to your CA. You will then get certificate files from it.   * The...


Enable https for your apache-httpd-hosted website with a self-signed certificate

by Chen Jian


Posted on 2015-11-03 12:00 in Maintenance


Generate a self-signed https certificate Java's KeyTool is kind of heavy due to its "keystore" concept. I prefer openssl: openssl req -x509 -nodes -newkey rsa:2048 -keyout cjx_private.key -out cjx_cert.pem -days 36500 #"-nodes"...


ec2中搭建服务后要编辑一下security group才能让外网访问

by Chen Jian


Posted on 2015-01-18 12:00 in Maintenance


在aws ec2中搭建apache httpd或tomcat后,发现使用ec2 instance的public ip在浏览器里访问相关服务时失败。 这是因为防火墙未设置。对ec2来说,security group就相当于防火墙。 设置办法: 进入instance列表,在security group列中找到对应的group, 点击它,然后Actions => Edit Inbound Rules, 加入http, 即可允许80端口访问。 如果要打开8080的http端口,新增一个c...


J2EE应用服务器版本选择

by Chen Jian


Posted on 2013-08-13 12:00 in Maintenance


是否支持servlet 3.0?  是否必须用jdk 7? jetty: http://www.eclipse.org/jetty/documentation/current/what-jetty-version.html tomcat: http://tomcat.apache.org/whichversion.html


apache配置多端口

by Chen Jian


Posted on 2013-08-02 12:00 in Maintenance


引用 NameVirtualHost *:80 Listen 80 Listen 81 引用 <VirtualHost *:80 *:81 > ......


.htaccess被忽略了?

by Chen Jian


Posted on 2013-06-26 12:00 in Maintenance


看看你的virtual host是不是有这个错误: 引用 <Directory "/home/page_url/www/">     AllowOverride None 你要去掉AllowOverride None. 如果 apache版本较低,还要加上AllowOverride All 引用 Syntax: AllowOverride...


apache httpd: A typical virtualhost

by Chen Jian


Posted on 2013-06-23 12:00 in Maintenance


引用 <VirtualHost myjoomla.kent.net:80>         ServerName myjoomla.kent.net         DocumentRoot /home/kent/dev/phpws/joomla25       &n...


eclipse + tomcat + maven 集成开发环境

by Chen Jian


Posted on 2013-06-08 12:00 in Maintenance


eclipse + tomcat + maven 集成开发环境,满足:    1.对jsp的修改直接生效    2.改好代码后只需要点击启动tomcat,不需要执行mvn package等命令    网上搜了半天,完整的解决方案是:    0. eclipse要用jee版,并装好m2eclipse插件    1. 按 这个 配置dynamic web module,将web...


apache httpd禁止直接用IP访问

by Chen Jian


Posted on 2013-06-02 12:00 in Maintenance


搜了半天,最后按下面这种方法搞定的: (不用xml做配置文件的系统都是耍流氓,像httpd.conf这种东西的层次感太不明确了) 引用 NameVirtualHost *:80 <VirtualHost *:80>         ServerName 111.111.111.111        ...


访问centos+apache所服务的页面时出现403错误

by Chen Jian


Posted on 2013-06-01 12:00 in Maintenance


这一般是因为运行httpd的进程没有权限访问你的应用所在的目录; 你这个目录的所有者是不是root? 搞了半天,最佳方案是: 1. 新建一个linux账号和组,比如myblog/myblog 2. 用这个账号登录,然后在它的个人目录下建立你的应用目录 3. 修改httpd.conf,找到User和Group两项,改成myblog, myblog


apache mod_rewrite: 把首页URL重写为另一个URL

by Chen Jian


Posted on 2013-05-26 12:00 in Maintenance


试了半天,发现要这样写才行 引用         RewriteEngine on         RewriteRule ^/$ /homepage/index.htm  [PT] 1. 首页"/"前后要用^和$包裹起来,表示只重写首页 2....


apache httpd各种文件的路径

by Chen Jian


Posted on 2013-05-26 12:00 in Maintenance


ubuntu用apt安装的apache2    主配置文件:/etc/apache2/apache2.conf,  httpd.conf已经废弃不用了。    端口配置:  /etc/apache2/ports.conf    VirtualHost配置: 每个host都定义在/etc/apache2/sites-available文件夹里作为独立文件,然后在/etc/apache2/sites-enabled以连接...


qmail相关资料

by Chen Jian


Posted on 2013-05-22 12:00 in Maintenance


查看状态: http://support.godaddy.com/help/article/1582/how-do-i-view-messages-in-the-qmail-queue 引用 #/var/qmail/bin/qmail-qstat #/var/qmail/bin/qmail-qread 查看日志: 引用 # cat /usr/local/psa/var/log/maillog ...


手动删除qmail的maillog后,就再也看不到有内容的maillog了,怎么办?

by Chen Jian


Posted on 2013-05-22 12:00 in Maintenance


如果你手动删除了qmail的maillog, qmail就再也不会自动生成maillog, 你后续的smtp行为都不会再有记录。 即使你手动touch maillog文件,后续的smtp行为也不会在你新建的maillog文件中产生记录。 我今天就是这样手删了一下,结果搞了很久很久都没搞定,直到我开始想: “maillog怎么产生的? 是由splogger写给syslog的;按照‘重启万能论’,是不是重启一下相关服务即可?” 重启 qmail(内置splogger)不起作...


nginx 后接jett/tomcat

by Chen Jian


Posted on 2012-12-28 12:00 in Maintenance


不需要改jetty/tomcat的配置,只需要修改nginx.conf 引用 http{                server{                 listen...