跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 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. 如何配置openerp的访问域名?(已解决)

如何配置openerp的访问域名?(已解决)

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

    前面加一层反向代理 nginx

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

      非常感谢,我按照buke的帖子配置nginx,
      如果配置:server_name 0.0.0.0 可以用0.0.0.0访问
      但是使用:server_name oe.openerp.com, 域名却不可以访问
      请问如何才能使用域名访问?是不是还需要对这个域名做一些设置?我目前在本机做测试,请问应该如何设置?谢谢

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

        终于可以了,需要在etc/hosts 下增加一行 127.0.0.1 oe.openerp.com

        1 条回复 最后回复
        0
        • W 离线
          W 离线
          wangpc
          写于 最后由 编辑
          #5

          在etc/hosts 下增加一行 127.0.0.1 oe.openerp.com
          你这种方式和nginx 一点关系都没有
          你是试试127.0.0.1 www.baidu.com 然后发现访问www.baidu.com:8069 尽然是跳转到openerp
          你只是本地在解析oe.openerp.com 转成了127.0.0.1,你这问题归根揭底是你oe.openerp.com 没有做域名指向,也就是指向你空间的ip地址

          1 条回复 最后回复
          0
          • J 离线
            J 离线
            jerry79
            写于 最后由 编辑
            #6

            [quote author=baggiow link=topic=16320.msg27797#msg27797 date=1396316957]
            在etc/hosts 下增加一行 127.0.0.1 oe.openerp.com
            你这种方式和nginx 一点关系都没有
            你是试试127.0.0.1 www.baidu.com 然后发现访问www.baidu.com:8069 尽然是跳转到openerp
            你只是本地在解析oe.openerp.com 转成了127.0.0.1,你这问题归根揭底是你oe.openerp.com 没有做域名指向,也就是指向你空间的ip地址
            [/quote]
            因为我在本机测试,所以必须要加上host那一行。我试一下增加域名指向后的情况(晚一点我在服务器上测试)。
            另外,我设置之后,用域名访问,oe无法登录了,请问这个问题你了解是什么情况吗?谢谢

            1 条回复 最后回复
            0
            • digitalsatoriD 离线
              digitalsatoriD 离线
              digitalsatori 管理员
              写于 最后由 编辑
              #7

              首先你要确定,DNS已经正确解析你的域名地址到你的服务器IP了。

              要知道,服务器如果在内网的话,你还要作端口映射或DMZ。

              如果这些都没问题了,把你的nginx配置文件发出来看看。

              【上海先安科技】(tony AT openerp.cn)

              1 条回复 最后回复
              0
              • J 离线
                J 离线
                jerry79
                写于 最后由 编辑
                #8

                [quote author=digitalsatori link=topic=16320.msg27806#msg27806 date=1396337485]
                首先你要确定,DNS已经正确解析你的域名地址到你的服务器IP了。

                要知道,服务器如果在内网的话,你还要作端口映射或DMZ。

                如果这些都没问题了,把你的nginx配置文件发出来看看。
                [/quote]
                非常感谢,请问如何才能判断DNS已经正确解析域名了?我现在已经把OE安装到外网服务器了,我使用dnspod解析域名,域名设置里面有设置*,应该可以支持所有的二级域名了吧,如下图:
                [attachimg=1]

                另外,我现在遇到的问题是,使用域名访问OE可以,但是每次都显示数据库选择界面,选择数据库后,输入用户名和密码无法登录。我使用各种办法设置默认数据库,都无效,但是使用域名:8069没有这个问题。

                我的nginx conf代码如下:

                <br />proxy_temp_path /tmp/nginx_proxy_temp;<br />proxy_cache_path&nbsp; /tmp/nginx_proxy_cache levels=1:2&nbsp; keys_zone=oecache:100m inactive=3d max_size=1000m;<br />proxy_buffer_size&nbsp; &nbsp;  32k;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #设置代理服务器(nginx)保存用户头信息的缓冲区大小<br />proxy_buffers&nbsp; &nbsp; &nbsp; &nbsp;  4 32k;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #proxy_buffers缓冲区,网页平均在32k以下的话,这样设置<br />proxy_busy_buffers_size&nbsp; 64k;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #高负荷下缓冲大小(proxy_buffers*2)<br />proxy_temp_file_write_size&nbsp; 64k;&nbsp; &nbsp; &nbsp;  #设定缓存文件夹大小,大于这个值,将从upstream服务器传<br />proxy_connect_timeout&nbsp; &nbsp; &nbsp; 60;<br />proxy_send_timeout&nbsp; &nbsp; &nbsp; &nbsp;  60;<br />proxy_read_timeout&nbsp; &nbsp; &nbsp; &nbsp;  3000;<br /><br />upstream oeserver{<br />&nbsp; &nbsp; &nbsp; &nbsp; server 127.0.0.1:8069;<br />}<br />server {<br />&nbsp; &nbsp; &nbsp; &nbsp; server_name&nbsp; openerp.mydemain.com;<br />&nbsp; &nbsp; &nbsp; &nbsp; root /usr/local/lib/python2.7/dist-packages/openerp-8.0dev_20140326_000101-py2.7.egg/openerp/addons/;<br />&nbsp; &nbsp; &nbsp; &nbsp; listen 80;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; gzip on;<br />&nbsp; &nbsp; &nbsp; &nbsp; gzip_disable &quot;msie6&quot;;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; gzip_vary on;<br />&nbsp; &nbsp; &nbsp; &nbsp; gzip_proxied any;<br />&nbsp; &nbsp; &nbsp; &nbsp; gzip_comp_level 6;<br />&nbsp; &nbsp; &nbsp; &nbsp; gzip_buffers 16 8k;<br />&nbsp; &nbsp; &nbsp; &nbsp; gzip_http_version 1.1;<br />&nbsp; &nbsp; &nbsp;  #添加一个类型 application/javascript<br />&nbsp; &nbsp; &nbsp; &nbsp; gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;<br /><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; location /{<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oecache;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #proxy_cache_key &quot;$host$request_uri$request_body&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache_key $host$request_uri$request_body;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache_valid&nbsp; 200 304 1d;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache_valid&nbsp; any&nbsp;  1d;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_next_upstream http_502 http_504 error timeout invalid_header;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass_header Set-Cookie;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header&nbsp;  Host&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $host;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header&nbsp;  X-Real-IP&nbsp; &nbsp; &nbsp; &nbsp; $remote_addr;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header&nbsp;  X-Forwarded-For&nbsp; $proxy_add_x_forwarded_for;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_redirect&nbsp; off;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass [检测到链接无效,已移除] br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_buffering on;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache_valid&nbsp; &nbsp; &nbsp;  1d;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expires 1d;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_buffering on;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache_valid&nbsp; &nbsp; &nbsp;  1d;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expires 1d;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />
                
                1 条回复 最后回复
                0
                • J 离线
                  J 离线
                  jerry79
                  写于 最后由 编辑
                  #9

                  我又测试了一下,发现在7.0下没有问题,8.0不行,我用的是3月26号的最新版。有大侠能帮忙在8.0下做个测试吗?非常感谢!

                  1 条回复 最后回复
                  0
                  • JoshuaJ 离线
                    JoshuaJ 离线
                    Joshua 管理员
                    写于 最后由 编辑
                    #10

                    你可以看看你的nginx的log(默认是/var/log/nginx/),看看到底是转跳到那个url出现问题。

                    【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                    1 条回复 最后回复
                    0
                    • J 离线
                      J 离线
                      jerry79
                      写于 最后由 编辑
                      #11

                      [quote author=Joshua link=topic=16320.msg27809#msg27809 date=1396346850]
                      你可以看看你的nginx的log(默认是/var/log/nginx/),看看到底是转跳到那个url出现问题。
                      [/quote]
                      我看了一下log,是access.log,没有error.log产生,有两行:

                      <br />&quot;POST /web/login HTTP/1.1&quot; 200 107 &quot;http://openerp.mydomain.com/web/login?db=mydatabase&quot;<br />&quot;POST /web/login HTTP/1.1&quot; 200 121 &quot;http://openerp.mydomain.com/web/login?redirect=http%3A%2F%2Fopenerp$.mydomain.com%2Fweb%3Fdb%3Dmydatabase&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
                      


                      是不是redirect的时候出问题了?

                      1 条回复 最后回复
                      0
                      • J 离线
                        J 离线
                        jerry79
                        写于 最后由 编辑
                        #12

                        偶然发现一个问题,我用域名访问时,首先跳到数据库选择界面,此时url是:<br / [检测到链接无效,已移除] br />然后选择数据库,跳到登录界面,此时url是:<br / [检测到链接无效,已移除] br />这时,如果点登录,是无法登录的,但是如果我手工修改url,为:<br / [检测到链接无效,已移除] 回车
                        然后在登录,就可以的登录成功。
                        这之后,如果使用:http://openerp.mydomain.com/web 访问,则可以不用登录,直接进入系统
                        仍使用http://openerp.mydomain.com/,则还是要跳到数据库选择界面。
                        现在怀疑,在使用域名访问的时候,选择数据库这里有些问题。
                        如果使用http://openerp.mydomain.com:8069访问,只要选择一次数据库,就在也不用出现数据库选择界面了。
                        它的登录界面的url是:<br / [检测到链接无效,已移除] br />最后的参数是web,而不是数据库。

                        1 条回复 最后回复
                        0
                        • J 离线
                          J 离线
                          jerry79
                          写于 最后由 编辑
                          #13

                          问题解决,删除配置文件中 location /中的下面三行

                          <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_buffering on;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache_valid&nbsp; &nbsp; &nbsp;  1d;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; expires 1d;<br />
                          


                          但是还不知道为什么

                          1 条回复 最后回复
                          0

                          • 登录

                          • 没有帐号? 注册

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