cobbler MOD_PYTHON ERROR

 今天在做cobbler的时候所有都做好了,但就是访问不了,报下边这样一个错误:

 

  1. MOD_PYTHON ERROR  
  2.   
  3. ProcessId:      370  
  4. Interpreter:    '127.0.0.1'  
  5.   
  6. ServerName:     '127.0.0.1'  
  7. DocumentRoot:   '/var/www/html'  
  8.   
  9. URI:            '/cobbler_web/'  
  10. Location:       '/cobbler_web'  
  11. Directory:      None  
  12. Filename:       '/var/www/cobbler_web'  
  13. PathInfo:       '/'  
  14.   
  15. Phase:          'PythonHandler'  
  16. Handler:        'django.core.handlers.modpython'  
  17.   
  18. Traceback (most recent call last):  
  19.   
  20.   File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch  
  21.     default=default_handlerarg=reqsilent=hlist.silent)  
  22.   
  23.   File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 1229, in _process_target  
  24.     result = _execute_target(config, req, object, arg)  
  25.   
  26.   File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 1128, in _execute_target  
  27.     result = object(arg)  
  28.   
  29.   File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 212, in handler  
  30.     return ModPythonHandler()(req)  
  31.   
  32.   File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 174, in __call__  
  33.     self.load_middleware()  
  34.   
  35.   File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 39, in load_middleware  
  36.     for middleware_path in settings.MIDDLEWARE_CLASSES:  
  37.   
  38.   File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 276, in __getattr__  
  39.     self._setup()  
  40.   
  41.   File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 42, in _setup  
  42.     self._wrapped = Settings(settings_module)  
  43.   
  44.   File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 125, in __init__  
  45.     raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)  
  46.   
  47. ValueError: Incorrect timezone setting: America/NewYork  

 

    这个问题是因为cobbler的web程序在调用时区的时候找不到这样一个模块,去查看/usr/share/cobbler/web/setting.py这个文件的发现有这么一行:TIME_ZONE = 'America/NewYork',说明python调用的模块是时区中America目录下的NewYork文件,但是在/usr/share/zoneinfo/这个时区的文件夹下边的America目录只能发现New_York这个文件,没有NewYork文件,所以会报出来模块错误。

解决办法:

  1. cd /usr/share/zoneinfo/America  
  2.   
  3. cp New_York NewYork  

 

重新访问就可以了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章