Cobbler Web界面提示报错 “Internal Server Error”
問題: 在訪問cobbler web界面到時(shí)候出現(xiàn)以下提示
解決步驟:
1. SSL 的報(bào)錯(cuò)日志如下:
[root@localhost?~]#?tail?-f?/var/log/httpd/ssl_error_log[Tue?May?28?16:54:16.665181?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]???self._setup(name)[Tue?May?28?16:54:16.665190?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]???File?"/usr/lib/python2.7/site-packages/django/conf/__init__.py",?line?41,?in?_setup[Tue?May?28?16:54:16.665205?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]?????self._wrapped?=?Settings(settings_module)[Tue?May?28?16:54:16.665209?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]???File?"/usr/lib/python2.7/site-packages/django/conf/__init__.py",?line?110,?in?__init__[Tue?May?28?16:54:16.665217?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]?????mod?=?importlib.import_module(self.SETTINGS_MODULE)[Tue?May?28?16:54:16.665223?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]???File?"/usr/lib64/python2.7/importlib/__init__.py",?line?37,?in?import_module[Tue?May?28?16:54:16.665445?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]?????__import__(name)[Tue?May?28?16:54:16.665455?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]???File?"/usr/share/cobbler/web/settings.py",?line?89,?in?<module>[Tue?May?28?16:54:16.665500?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]???from?django.conf.global_settings?import?TEMPLATE_CONTEXT_PROCESSORS[Tue?May?28?16:54:16.665516?2019]?[:error]?[pid?7001]?[remote?192.168.1.109:44]???ImportError:?cannot?import?name?TEMPLATE_CONTEXT_PROCESSORS2. 查看cobbler的py配置文件
[root@localhost?~]#?sed?-n?'38,41p'?/usr/share/cobbler/web/settings.pyif?django.VERSION[0]?==?1?and?django.VERSION[1]?<?4:????ADMIN_MEDIA_PREFIX?=?'/media/'else:????STATIC_URL?=?'/media/'[root@localhost?~]#?sed?-n?'89p'?/usr/share/cobbler/web/settings.pyfrom?django.conf.global_settings?import?TEMPLATE_CONTEXT_PROCESSORS3. 初步判斷應(yīng)該是pythone-django版本問題
##下載get-pip.py[root@localhost?~]#?wget?http://bootstrap.pypa.io/get-pip.py--2019-05-28 17:48:55--? http://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.24.175, 2a04:4e42:2e::175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.24.175|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://bootstrap.pypa.io/get-pip.py [following]
--2019-05-28 17:48:56--? https://bootstrap.pypa.io/get-pip.py
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.24.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1709825 (1.6M) [text/x-python]
Saving to: ‘get-pip.py’
100%[=======================================================================>] 1,709,825?? 99.6KB/s?? in 24s???
2019-05-28 17:47:07 (69.8 KB/s) - ‘get-pip.py’ saved [1709825/1709825]
##調(diào)用本地python運(yùn)行pip.py腳本[root@localhost?~]#?python?get-pip.pyDEPRECATION:?Python?2.7?will?reach?the?end?of?its?life?on?January?1st,?2020.?Please?upgrade?your?Python?as?Python?2.7?won't?be?maintained?after?tt?date.?A?future?version?of?pip?will?drop?support?for?Python?2.7.Collecting?pip??Downloading?https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-y.whl?(1.4MB)?????|████████████████████████████████|?1.4MB?134kB/sCollecting?wheel??Downloading?https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-nonany.whlInstalling?collected?packages:?pip,?wheelSuccessfully?installed?pip-19.1.1?wheel-0.33.4
##安裝pip[root@localhost?~]#?pip?install?Django==1.8.9DEPRECATION:?Python?2.7?will?reach?the?end?of?its?life?on?January?1st,?2020.?Please?upgrade?your?Python?as?Python?2.7?won't?be?maintained?after?tt?date.?A?future?version?of?pip?will?drop?support?for?Python?2.7.Collecting?Django==1.8.9??Downloading?https://files.pythonhosted.org/packages/a7/a2/f4e7926062f5c61d98e87b9d0365ca1a0fab6be599dbea90ce2fab27f395/Django-1.8.9-py2.py3-nonany.whl?(6.2MB)?????|████████████████████████████████|?6.2MB?65kB/sInstalling?collected?packages:?Django??Found?existing?installation:?Django?1.11.20????Uninstalling?Django-1.11.20:??????Successfully?uninstalled?Django-1.11.20Successfully?installed?Django-1.8.9
##查看pip版本號(hào)[root@localhost?~]#?python?-c?"import?django;?print(django.get_version())"1.8.9
4. 重啟HTTP服務(wù)
[root@localhost?~]#?systemctl?restart?httpd5. 瀏覽器界面刷新即可
轉(zhuǎn)載于:https://blog.51cto.com/10802692/2401673
總結(jié)
以上是生活随笔為你收集整理的Cobbler Web界面提示报错 “Internal Server Error”的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: awk 系列Part5:如何使用 awk
- 下一篇: 热备份路由选择协议(HSRP)