发布时间:2019-07-13 11:39:20编辑:auto阅读(1529)
今天在做cobbler的时候所有都做好了,但就是访问不了,报下边这样一个错误:
- MOD_PYTHON ERROR
- ProcessId: 370
- Interpreter: '127.0.0.1'
- ServerName: '127.0.0.1'
- DocumentRoot: '/var/www/html'
- URI: '/cobbler_web/'
- Location: '/cobbler_web'
- Directory: None
- Filename: '/var/www/cobbler_web'
- PathInfo: '/'
- Phase: 'PythonHandler'
- Handler: 'django.core.handlers.modpython'
- Traceback (most recent call last):
- File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
- default=default_handler, arg=req, silent=hlist.silent)
- File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 1229, in _process_target
- result = _execute_target(config, req, object, arg)
- File "/usr/lib64/python2.4/site-packages/mod_python/importer.py", line 1128, in _execute_target
- result = object(arg)
- File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 212, in handler
- return ModPythonHandler()(req)
- File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 174, in __call__
- self.load_middleware()
- File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 39, in load_middleware
- for middleware_path in settings.MIDDLEWARE_CLASSES:
- File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 276, in __getattr__
- self._setup()
- File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 42, in _setup
- self._wrapped = Settings(settings_module)
- File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 125, in __init__
- raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
- 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文件,所以会报出来模块错误。
解决办法:
- cd /usr/share/zoneinfo/America
- cp New_York NewYork
重新访问就可以了
上一篇: Python数组的遍历
下一篇: 趣味谈python变量问题
47481
45782
36781
34305
28952
25587
24432
19603
19092
17624
5455°
6038°
5554°
5629°
6555°
5367°
5367°
5873°
5847°
7160°