跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. Ubuntu 14.04安装EtherPad并以服务启动

Ubuntu 14.04安装EtherPad并以服务启动

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
5 帖子 3 发布者 3.6k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • F 离线
    F 离线
    firerain
    写于 最后由 编辑
    #1

    前前后后看了数篇文章,最后好歹终于是成功把EtherPad-lite搭起来了。先说明对Linux并不非常熟,教程有点儿大杂烩的意思,各位将就着看,反正最后肯定能跑起来。稍微整理了一下,过程供各位参考。
    1. 添加一个用来跑EtherPad-lite的用户:

    sudo adduser --system --home=/opt/etherpad --group etherpad
    


    2. 接下来需要安装Node.js,先把下边儿这堆东西装了

    sudo apt-get install g++ curl libssl-dev apache2-utils 
    


    3. 然后安装git-core

    sudo apt-get install git-core 
    


    4. 切到刚才新建立的etherpad用户

    sudo su - etherpad -s /bin/bash 
    


    5. 从源码安装node.js

    git clone git://github.com/joyent/node.git 
    

    ``` cd node ```
    目前node.js的最新版是v0.12.7,checkout这个版本
    ``` git checkout v0.12.7 ```
    ``` mkdir ~/local ```
    ``` ./configure –-prefix=$HOME/local/node ```
    复制上边儿那行时,请务必注意prefix前边儿是不是两个横线全部复制了
    ``` make ```
    如果提示没有make,就用apt-get安装一下make。这步时间巨长,在我的VPS上跑了大概15分钟。
    ``` make install ```
    添加环境变量
    ``` echo ‘export PATH=$HOME/local/node/bin:$PATH’ >> ~/.profile ```
    ``` echo ‘export NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules’ >> ~/.profile ```
    安装nmp
    ``` curl -L http://npmjs.org/install.sh | sh ```
    6. 终于可以正式开始安装etherPad了,有点小激动
    ``` cd ~ ```
    ``` git clone git://github.com/ether/etherpad-lite.git ```
    ``` cd etherpad-lite ```
    ``` bin/run.sh ```
    如果没问题,那么这时候你的9001端口已经可以访问了。这个实例是使用dirtyDB,然后没有配置管理员用户名密码的。
    接下来,配置etherPad自动运行
    Ctrl+C,把刚才的程序结束掉
    7. 图省事,切回root
    ``` su root ```
    打开 /etc/profile文件,最后添加下边儿两行
    ``` export PATH="$HOME/local/node/bin:$PATH" ```
    ``` export NODE_PATH="$HOME/local/node:$HOME/local/node/lib/node_modules" ```
    8. 建日志相关的目录
    ``` mkdir /var/log/etherpad-lite ```
    ``` chown etherpad /var/log/etherpad-lite ```
    ``` chown -R etherpad /var/log/etherpad-lite ```
    9. 建服务,这步非常非常的奇怪,文件必须以.conf结尾,否则就跑不起来
    ``` sudo vi /etc/init.d/etherpad-lite.conf ```
    把下边儿的内容粘进去,调试这个文件调试得满眼都是眼泪,不细说了……
    ```
    #!/bin/sh

    ### BEGIN INIT INFO
    # Provides:          etherpad-lite
    # Required-Start:    $local_fs $remote_fs $network $syslog
    # Required-Stop:    $local_fs $remote_fs $network $syslog
    # Default-Start:    2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: starts etherpad lite
    # Description:      starts etherpad lite using start-stop-daemon
    ### END INIT INFO
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/etherpad/local/node/bin
    LOGFILE=/var/log/etherpad-lite/etherpad-lite.log
    EPLITE_DIR=/opt/etherpad/etherpad-lite
    EPLITE_BIN=bin/safeRun.sh
    USER=etherpad
    GROUP=etherpad
    DESC=EtherpadLite
    NAME=etherpad-lite

    set -e

    . /lib/lsb/init-functions

    start() {
      echo "Starting $DESC... "

        start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true
      echo "done"
    }
    #We need this function to ensure the whole process tree will be killed
    killtree() {
        local _pid=$1
        local _sig=${2-TERM}
        for _child in $(ps -o pid --no-headers --ppid ${_pid}); do
            killtree ${_child} ${_sig}
        done
        kill -${_sig} ${_pid}
    }
    _stop() {
      echo "Stopping $DESC... "
      if test -f /var/run/$NAME.pid; then
        while test -d /proc/$(cat /var/run/$NAME.pid); do
          killtree $(cat /var/run/$NAME.pid) 15
          sleep 0.5
        done
        rm /var/run/$NAME.pid
      fi
      echo "done"
    }
    status() {
      status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $?
    }
    case "$1" in
      start)
          start
          ;;
      stop)
        _stop
          ;;
      restart)
          _stop
          start
          ;;
      status)
          status
          ;;
      *)
          echo "Usage: $NAME {start|stop|restart|status}" >&2
          exit 1
          ;;
    esac

    exit 0
    ```
    保存退出
    10. 设定文件可执行权限
    ``` chmod +x /etc/init.d/etherpad-lite.conf ```
    11. 试一下
    ``` service etherpad-lite.conf start ```

    如果没问题,那么打开/etc/rc.local文件,在exit 0 前面加上
    ``` service etherpad-lite.conf start ```

    重启看看吧。
    1 条回复 最后回复
    0
    • mrshellyM 离线
      mrshellyM 离线
      mrshelly
      写于 最后由 编辑
      #2

      分享的. 即是最棒的........

      感谢分享...

      1 条回复 最后回复
      0
      • F 离线
        F 离线
        firerain
        写于 最后由 编辑
        #3

        忘记说了,在odoo里边儿配置时需要的api-key,etherpad-lite安装路径下有一个APIKEY.txt,打开就是了。

        1 条回复 最后回复
        0
        • wjfonhandW 离线
          wjfonhandW 离线
          wjfonhand
          写于 最后由 编辑
          #4

          很棒的分享

          GoodERP -- Odoo China fork

          1 条回复 最后回复
          0

          • 登录

          • 没有帐号? 注册

          • 登录或注册以进行搜索。
          • 第一个帖子
            最后一个帖子
          0
          • 版块
          • 标签
          • 热门
          • 用户
          • 群组