liujia 发布的文章

“吃鸡”游戏,双排第2名

游戏开始,伙伴挂机。自己看着地图跑白圈(安全区)。小圈时不知道被什么地方打,随意扔一个手雷,之后趴在草地里用绷带。剩2人时,不知道对方在哪,但他时不时扔手雷。最后呢,死在安全圈外了。

20171026122709_1.jpg

为 “护卫神 apache大师”站点添加ssl证书,实现https访问

环境:护卫神 apache大师 2.1.0,Windows 2012

过程:

  1. 安装好 “护卫神 apache大师” 软件,开设站点,如本例 mp.anqun.org
  2. 编辑 C:\HwsApacheMaster\Apache\conf\httpd.conf 文件,搜索 mod_ssl,移除注释符号#(本例第124行); 同理,让 httpd-ssl.conf 配置文件也生效
  3. 编辑 C:\HwsApacheMaster\Apache\conf\extra\httpd-ssl.conf 文件,修改 SSLSessionCache 文件的存储路径,使之有效;之后新建一个https的站点配置内容,如本例的 mp.anqun.org,证书文件保存在 C:\HwsApacheMaster\Apache\conf\ssl 目录内

    #   Inter-Process Session Cache:
    #   Configure the SSL Session Cache: First the mechanism 
    #   to use and second the expiring timeout (in seconds).
    #SSLSessionCache         "dbm:E:/Huweishen.com/HwsApacheMaster/Apache2.2/logs/ssl_scache"
    # SSLSessionCache        "shmcb:E:/Huweishen.com/HwsApacheMaster/Apache2.2/logs/ssl_scache(512000)"
    SSLSessionCache        "shmcb:logs/ssl_scache(512000)"
    SSLSessionCacheTimeout  300
    
    #   Semaphore:
    #   Configure the path to the mutual exclusion semaphore the
    #   SSL engine uses internally for inter-process synchronization. 
    SSLMutex default
    
    ##
    ## SSL Virtual Host Context
    ##
    <VirtualHost *:443>
         SSLEngine on
         SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
         SSLCertificateFile      "conf\ssl\1_mp.anqun.org_bundle.crt"
         SSLCertificateKeyFile   "conf\ssl\2_mp.anqun.org.key"
         ServerName      "mp.anqun.org"
         DocumentRoot    "C:\HwsApacheMaster\wwwroot\mp_f75yPU"
         
    <Directory "C:/HwsApacheMaster/wwwroot/mp_f75yPU">
         Options FollowSymLinks ExecCGI
     #AddHandler fcgid-script .php
     #FcgidWrapper "/php-cgi.exe" .php
         DirectoryIndex index.html index.htm index.php default.php index.jsp
         AllowOverride All
         Order Deny,Allow
         Allow from all
     </Directory>
    </VirtualHost>
  4. 重启apache,在浏览器里测试,https访问有效

参考:http://www.huweishen.com/?apachemaster

HeidiSQL 通过ssh隧道连接远程MariaDB数据库服务器

环境:Debian 8, MariaDB 10.0,HeidiSQL 9.4

过程:

  1. 在Debian 8 系统里安装好 MariaDB server
  2. 在 HeidiSQL 会话管理里新建会话,“设置”选项卡中,填写mysql的连接信息,如本例,网络类型为:MySQL (SSH tunnel),主机名为:127.0.0.1,用户名:root,密码是 MariaDB 的 root用户密码
  3. 在 “SSH隧道”里填写ssh的登录信息,如本例填写的SSH主机是:116.62.234.101,用户名和密码则是Debian 8系统的管理员用户root和密码
  4. 在弹出的putty或plink对话框中,会提示核对远程主机的指纹,确认后即可
  5. 连接成功后,就可以通过本地电脑的HeidiSQL管理远程的MariaDB数据库了

参考:https://www.heidisql.com/

在 ubuntu 16 系统里安装 fluxbox 简单的图形化桌面

环境:Ubtuntu 16.04

过程:

  1. apt-get update #登录到系统,更新
  2. apt-get install fluxbox xorg xdm dillo xfe tightvncserver #安装fluxbox及其它,其中dillo是浏览器,xfe是文件管理器,tightvncserver用于远程连接
  3. startx #在控制台里登录后,启动x
  4. vncserver #如果需要远程连接,还需要初始化和运行vncserver
  5. 使用vnc客户端连接,如5901端口,可以看到fluxbox
  6. apt-get install fonts-noto-cjk chromium-browser #如果需要安装中文字体和chromium浏览器,可安装

参考:

  1. https://help.ubuntu.com/community/Installation/LowMemorySystems
  2. https://xiangji.me/2016/04/29/jiejue-ubuntu-16.04-chrome-li-zhongwen-wenzi-faxu-wenti/

在 Debian 8 系统里安装 seafile 服务器(mysql数据库)

环境:Debian 8 64位,seafile-server_6.2.2_x86-64

目的:使用https://swas.anqun.org 访问到 Seahub 网站

过程:

  1. apt-get update #更新
  2. apt-get install mariadb-server #安装 mariadb-server
  3. apt-get install python2.7 libpython2.7 python-setuptools python-imaging python-ldap python-mysqldb python-memcache python-urllib3 #安装python及相应软件
  4. apt-get install nginx #安装nginx,用来反向代理后端的 seahub 网站
  5. vi /etc/nginx/sites-enabled/swas.conf #创建swas.anqun.org反向代理配置内容,详细如下:

    server {
     listen       80;
     server_name  swas.anqun.org;
     rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https
    
     # Enables or disables emitting nginx version on error pages and in the "Server" response header field.
     server_tokens off;
    }
    
    server {
     listen 443;
     ssl on;
     ssl_certificate /etc/ssl/214298380010268.pem;        # path to your cacert.pem
     ssl_certificate_key /etc/ssl/214298380010268.key;    # path to your privkey.pem
     server_name swas.anqun.org;
     server_tokens off;
    
     location / {
         proxy_pass         http://127.0.0.1:8000;
         proxy_set_header   Host $host;
         proxy_set_header   X-Real-IP $remote_addr;
         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header   X-Forwarded-Host $server_name;
         proxy_set_header   X-Forwarded-Proto https;
    
         access_log      /var/log/nginx/seahub.access.log;
         error_log       /var/log/nginx/seahub.error.log;
    
         proxy_read_timeout  1200s;
    
         client_max_body_size 0;
     }    
    }
  6. adduser liujia #创建一个普通用户,seafile相应文件放在 /home/liujia 路径里
  7. su liujia #切换到普通用户liujia
  8. wget http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_6.2.2_x86-64.tar.gz #下载当前版本的seafile安装文件
  9. tar xzvf seafile-server_6.2.2_x86-64.tar.gz #解压安装文件
  10. cd seafile-server-6.2.2 #切换到程序目录
  11. ./setup-seafile-mysql.sh #开始安装
  12. 按提示回答问题,如输入Mariadb的root密码,其它如端口和数据库名称,可保持默认的
  13. ./seafile.sh start # 启动 Seafile 服务
  14. ./seahub.sh start # 启动 Seahub 网站
  15. 在浏览器里访问,登录,正常

参考:http://manual-cn.seafile.com/deploy/using_mysql.html