V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zhangchioulin
V2EX  ›  问与答

又来麻烦大家,这次是关于 gogs 服务搭建的问题,想请问下大家,请用过的朋友看下

  •  
  •   zhangchioulin · 2015-07-08 17:50:45 +08:00 · 3879 次点击
    这是一个创建于 3277 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我在部署Gogs服务器的时候有几个问题一直搞不定。请大家帮我看下

    我是用二进制源码安装的。

    官网的文档"配置与运行"中"运行 Gogs 服务"写到:

    • 开发者模式
    • 部署模式

    那么问题来了:这两个文件有什么区别?

    部署模式中有两种启动方法:

    • 普通:./gogs web
    • Supervisor:启动... 停止... 重启...

    这两种中:第一种关闭终端后就不能访问本地服务器了,那相反的 Supervisor 就能保证终端关闭后还能运行吗?


    我尝试使用Supervisor部署服务器,但是弹出了如下的错误。一个下午一直解决不了。希望大家能知道。

    我已经用 sudo pip install Supervisor 安装好了Supervisor。
    不知道为什么我现在输入这个指令会出现如下错误:(难道是说我已经安装了?)

    The directory '/Users/lifeng720/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    The directory '/Users/lifeng720/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    Requirement already satisfied (use --upgrade to upgrade): Supervisor in /Library/Python/2.7/site-packages
    Requirement already satisfied (use --upgrade to upgrade): meld3>=0.6.5 in /Library/Python/2.7/site-packages (from Supervisor)
    

    我是第2次输入sudo pip install Supervisor才弹出上面的错误,所以我感觉应该是安装上去了。于是我继续:
    1 我先cd 到了gogs的源代码目录。用官网的./scripts/gogs_supervisord.sh start指令准备开启服务的,但是弹出了下面的错误

    ln: /usr/bin/gogs_start: File exists
    starting
    Traceback (most recent call last):
    File "/usr/local/bin/supervisord", line 5, in <module>
    from pkg_resources import load_entry_point
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req) # XXX put more info here
    pkg_resources.DistributionNotFound: meld3>=0.6.5
    started

    虽然最后提示开启,但是我用:localhost:3000,还是不能访问(直接写IP也不行)

    这个错误我百度了下:
    好像是因为丢失了,start.h
    但是我翻了上一个版本,也没有这个文件

    该怎么办?

    顺便问下有没有跨平台支持的版本控制系统(累死gogs)?

    另外问下,公司的项目一般托管在网上的私人托管服务中还是本地的托管

    8 条回复    2015-07-09 08:32:44 +08:00
    66450146
        1
    66450146  
       2015-07-08 17:59:48 +08:00   ❤️ 1
    https://registry.hub.docker.com/u/codeskyblue/docker-gogs/
    用法:
    sudo mkdir /var/gogs
    sudo docker run -d -p 22:22 -p 3000:3000 -v /var/gogs:/data codeskyblue/docker-gogs
    zhangchioulin
        2
    zhangchioulin  
    OP
       2015-07-08 18:45:23 +08:00
    @66450146 感谢,这段话好高深!
    oott123
        3
    oott123  
       2015-07-08 22:26:31 +08:00   ❤️ 1
    前两天才踩了这个坑
    这个 supervisor 并不是 python 那个 supervisord
    https://github.com/gogits/gogs/issues/1134 请参考这个部署 superviord
    zhangchioulin
        4
    zhangchioulin  
    OP
       2015-07-08 22:31:58 +08:00
    @oott123 哈?!这样啊!我去....明天我试试!!!!
    zhangchioulin
        5
    zhangchioulin  
    OP
       2015-07-08 22:48:03 +08:00
    @oott123 好像这个supervisord就是py下的supervisord...我是用pip命令安装的
    zhangchioulin
        6
    zhangchioulin  
    OP
       2015-07-08 23:17:24 +08:00
    @oott123 话说我是Mac
    oott123
        7
    oott123  
       2015-07-09 00:19:59 +08:00 via Android   ❤️ 1
    @zhangchioulin 我是说 gogs 带的那个不是
    你按我给的那个链接配置就行了
    zhangchioulin
        8
    zhangchioulin  
    OP
       2015-07-09 08:32:44 +08:00
    @oott123 感谢!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2576 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 00:30 · PVG 08:30 · LAX 17:30 · JFK 20:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.