[GeoNode-users] geonode loads with IP not with URL/domain name

Mehdi Ahmadi mehmadi at gmail.com
Sun Aug 20 23:45:23 PDT 2017


Thanks Simone. It solved my problem. You are awesome!

On Mon, Aug 21, 2017 at 12:09 AM, Simone Dalmasso <simone.dalmasso at gmail.com
> wrote:

> Hi, make sure the domain you have set is correct, for example
> Http://xxx.example.com will be only "xxx.example .com"
>
> That is the only error I see from the logs.
> ps please always keep the list in copy.
>
> 2017-08-19 11:57 GMT-04:00 Mehdi Ahmadi <mehmadi at gmail.com>:
>
>> Thanks again! The *latest error message* in error.log file is as
>>
>> >> Invalid HTTP_HOST header: '<hostname>'. You may need to add u'
>> <hostname>' to ALLOWED_HOSTS.
>>
>> My hostname is already in the ALLOWED_HOSTS. Is there any other place I
>> can check for this?
>>
>> there is also an error in processing WSGI in my_geonode (where I did my
>> customization):
>> >> mod_wsgi (pid=28575): Exception occurred processing WSGI script
>> '/admin/my_geonode/my_geonode/wsgi.py'.
>>
>> I have modified wsgi.py in my_geonode according to the documentation (
>> http://docs.geonode.org/en/master/tutorials/admin/customize
>> _lookfeel/customize/setup_admin.html)
>>
>> Is there any other settings I need to add in wsgi.py when I use hostname
>> instead of localhost?
>>
>>
>> Here is the entire error.log file (after removing pid and tid and
>> datetime) for reference:
>> [wsgi:warn] mod_wsgi: Compiled for Python/2.7.11.
>> [wsgi:warn] mod_wsgi: Runtime using Python/2.7.12.
>> [mpm_event:notice] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0
>> Python/2.7.12 configured -- resuming normal operations
>> [core:notice] AH00094: Command line: '/usr/sbin/apache2'
>> [wsgi:error]  Invalid HTTP_HOST header: '<hostname>'. You may need to add
>> u'<hostname>' to ALLOWED_HOSTS.
>> [wsgi:error]  Internal Server Error: /
>> [wsgi:error]  Traceback (most recent call last):
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 87, in get_exception_response
>> [wsgi:error]      response = callback(request, **param_dict)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/utils/decorators.py", line 110, in _wrapped_view
>> [wsgi:error]      response = view_func(request, *args, **kwargs)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/views/defaults.py",
>> line 60, in bad_request
>> [wsgi:error]      return http.HttpResponseBadRequest(template.render())
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/backends/django.py", line 74, in render
>> [wsgi:error]      return self.template.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 210, in render
>> [wsgi:error]      return self._render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]      return self.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 135, in render
>> [wsgi:error]      return compiled_parent._render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]      return self.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 135, in render
>> [wsgi:error]      return compiled_parent._render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]      return self.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 65, in render
>> [wsgi:error]      result = block.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 159, in render
>> [wsgi:error]      return template.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 212, in render
>> [wsgi:error]      return self._render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]      return self.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/announcements/templatetags/announcements_tags.py", line 24, in render
>> [wsgi:error]      request = context["request"]
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/context.py", line 71, in __getitem__
>> [wsgi:error]      raise KeyError(key)
>> [wsgi:error]  KeyError: 'request'
>> [wsgi:error]  mod_wsgi (pid=28574): Exception occurred processing WSGI
>> script '/path/to/my_geonode/my_geonode/wsgi.py'.
>> [wsgi:error]  Traceback (most recent call last):
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/wsgi.py", line 189, in __call__
>> [wsgi:error]      response = self.get_response(request)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 209, in get_response
>> [wsgi:error]      response = self.get_exception_response(request,
>> resolver, 400)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 90, in get_exception_response
>> [wsgi:error]      response = self.handle_uncaught_exception(request,
>> resolver, sys.exc_info())
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 268, in handle_uncaught_exception
>> [wsgi:error]      return callback(request, **param_dict)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/utils/decorators.py", line 110, in _wrapped_view
>> [wsgi:error]      response = view_func(request, *args, **kwargs)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/views/defaults.py",
>> line 45, in server_error
>> [wsgi:error]      return http.HttpResponseServerError(template.render())
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/backends/django.py", line 74, in render
>> [wsgi:error]      return self.template.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 210, in render
>> [wsgi:error]      return self._render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]      return self.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 56, in render
>> [wsgi:error]      result = self.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 159, in render
>> [wsgi:error]      return template.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 212, in render
>> [wsgi:error]      return self._render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]      return self.nodelist.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]      bit = self.render_node(node, context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]      return node.render(context)
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/announcements/templatetags/announcements_tags.py", line 24, in render
>> [wsgi:error]      request = context["request"]
>> [wsgi:error]    File "/usr/lib/python2.7/dist-packa
>> ges/django/template/context.py", line 71, in __getitem__
>> [wsgi:error]      raise KeyError(key)
>> [wsgi:error]  KeyError: 'request'
>> [wsgi:error] Invalid HTTP_HOST header: '<hostname>'. You may need to add
>> u'<hostname>' to ALLOWED_HOSTS.
>> [wsgi:error] Internal Server Error: /favicon.ico
>> [wsgi:error] Traceback (most recent call last):
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 87, in get_exception_response
>> [wsgi:error]     response = callback(request, **param_dict)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/utils/decorators.py", line 110, in _wrapped_view
>> [wsgi:error]     response = view_func(request, *args, **kwargs)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/views/defaults.py",
>> line 60, in bad_request
>> [wsgi:error]     return http.HttpResponseBadRequest(template.render())
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/backends/django.py", line 74, in render
>> [wsgi:error]     return self.template.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 210, in render
>> [wsgi:error]     return self._render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]     return self.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 135, in render
>> [wsgi:error]     return compiled_parent._render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]     return self.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 135, in render
>> [wsgi:error]     return compiled_parent._render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]     return self.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 65, in render
>> [wsgi:error]     result = block.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 159, in render
>> [wsgi:error]     return template.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 212, in render
>> [wsgi:error]     return self._render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]     return self.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/announcements/templatetags/announcements_tags.py", line 24, in render
>> [wsgi:error]     request = context["request"]
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/context.py", line 71, in __getitem__
>> [wsgi:error]     raise KeyError(key)
>> [wsgi:error] KeyError: 'request'
>> [wsgi:error] mod_wsgi (pid=28575): Exception occurred processing WSGI
>> script '/path/to/my_geonode/my_geonode/wsgi.py'.
>> [wsgi:error] Traceback (most recent call last):
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/wsgi.py", line 189, in __call__
>> [wsgi:error]     response = self.get_response(request)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 209, in get_response
>> [wsgi:error]     response = self.get_exception_response(request,
>> resolver, 400)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 90, in get_exception_response
>> [wsgi:error]     response = self.handle_uncaught_exception(request,
>> resolver, sys.exc_info())
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/core/handlers/base.py", line 268, in handle_uncaught_exception
>> [wsgi:error]     return callback(request, **param_dict)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/utils/decorators.py", line 110, in _wrapped_view
>> [wsgi:error]     response = view_func(request, *args, **kwargs)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/views/defaults.py",
>> line 45, in server_error
>> [wsgi:error]     return http.HttpResponseServerError(template.render())
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/backends/django.py", line 74, in render
>> [wsgi:error]     return self.template.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 210, in render
>> [wsgi:error]     return self._render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]     return self.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 56, in render
>> [wsgi:error]     result = self.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/loader_tags.py", line 159, in render
>> [wsgi:error]     return template.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 212, in render
>> [wsgi:error]     return self._render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 202, in _render
>> [wsgi:error]     return self.nodelist.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/base.py",
>> line 905, in render
>> [wsgi:error]     bit = self.render_node(node, context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packages/django/template/debug.py",
>> line 79, in render_node
>> [wsgi:error]     return node.render(context)
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/announcements/templatetags/announcements_tags.py", line 24, in render
>> [wsgi:error]     request = context["request"]
>> [wsgi:error]   File "/usr/lib/python2.7/dist-packa
>> ges/django/template/context.py", line 71, in __getitem__
>> [wsgi:error]     raise KeyError(key)
>> [wsgi:error] KeyError: 'request'
>>
>>
>>
>>
>> On Sat, Aug 19, 2017 at 7:26 PM, Simone Dalmasso <
>> simone.dalmasso at gmail.com> wrote:
>>
>>> Yeah, take a look at the apache logs /var/logs/apache2/error.log. It'll
>>> give you more info
>>>
>>> 2017-08-19 10:55 GMT-04:00 Mehdi Ahmadi <mehmadi at gmail.com>:
>>>
>>>> Thanks Simone. I just run (sudo geonode-updateip XXXXXX; replacing
>>>> XXXXX with hostname) and restarted apache, but still the same problem shows
>>>> up.
>>>>
>>>> It seems that the command updates geoserver layers and adds the
>>>> <hostname> to the allowed hosts. I already did this local_settings.py file.
>>>> I can confirm that the ALLOWED_HOSTS in /etc/geonode and my_geonode
>>>> (for customization) contains both my IP and Hostname.
>>>>
>>>> Any other advice?
>>>>
>>>> On Sat, Aug 19, 2017 at 7:06 PM, Simone Dalmasso <
>>>> simone.dalmasso at gmail.com> wrote:
>>>>
>>>>> Hi, if you change the hostname then you have to run "geonode updateip
>>>>> XXXXXX", this is because of security checks in django.
>>>>>
>>>>> Hope this helps
>>>>>
>>>>> 2017-08-19 9:32 GMT-04:00 Mehdi Ahmadi <mehmadi at gmail.com>:
>>>>>
>>>>>> I have successfully installed geonode on a remote server made some
>>>>>> customization. Now, it loads with IP address with no problem; however, I
>>>>>> get the following apache error when I try to load the website using
>>>>>> URL/host name. Strange enough, geoserver works fine when I try both
>>>>>> /geoserver and /geoserver. Pinging the host name shows my ip address and my
>>>>>> nameservers seem to be set appropriately.
>>>>>>
>>>>>> Do you guys have any idea what is the likely reason for this problem?
>>>>>>
>>>>>>
>>>>>> Error message:
>>>>>> Internal Server Error
>>>>>>
>>>>>> The server encountered an internal error or misconfiguration and was
>>>>>> unable to complete your request.
>>>>>>
>>>>>> Please contact the server administrator at webmaster at localhost to
>>>>>> inform them of the time this error occurred, and the actions you performed
>>>>>> just before this error.
>>>>>>
>>>>>> More information about this error may be available in the server
>>>>>> error log.
>>>>>> ------------------------------
>>>>>> Apache/2.4.18 (Ubuntu) Server at ulsdi.ir Port 80
>>>>>>
>>>>>> _______________________________________________
>>>>>> geonode-users mailing list
>>>>>> geonode-users at lists.osgeo.org
>>>>>> https://lists.osgeo.org/mailman/listinfo/geonode-users
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Simone
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thanks,
>>>> Mehdi
>>>>
>>>
>>>
>>>
>>> --
>>> Simone
>>>
>>
>>
>>
>> --
>> Thanks,
>> Mehdi
>>
>
>
>
> --
> Simone
>



-- 
Thanks,
Mehdi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20170821/be45e72f/attachment-0001.html>


More information about the geonode-users mailing list