2017年10月

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

在 Linux系统里安装 SourceGuardian loader

环境:Debian 8 64位,nginx 1.6, MariaDB 10.0, php 5.6

SourceGuardian 提供php源码文件的加密,而SourceGuardian loader是提供运行这些加密php文件的php扩展。

过程:

  1. 在浏览器里访问:https://www.sourceguardian.com/loaders/download.php ,输入需要安装SourceGuardian loader服务器上的phpinfo函数的php文件网址,如:http://swas.anqun.org/aqinfo.php
  2. 在线的检测脚本会根据phpinfo里的信息,提取到php的版本信息和扩展路径,并会提示如下载什么文件(本例,ixed.5.6.lin),上传到服务器的哪个位置(本例,/usr/lib/php5/20131226),修改php.ini(本例,/etc/php5/fpm/php.ini)的内容(本例,extension=ixed.5.6.lin)
  3. 依提示操作后,重启php进程
  4. 再次在 https://www.sourceguardian.com/loaders/download.php 里提交服务器的 phpinfo 的网址,如果有效,会提示已经安装好 SourceGuardian loader 的扩展,且在phpinfo页里可以看到相应的版本信息

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