当前位置:论坛首页 > Linux面板 > 求助

【已完成】配置python+uwsgi网站无法运行

发表在 Linux面板2022-11-7 09:53 [复制链接] 3 4130

  1. 请问我改如何配置,请有经验的朋友帮助一下,环境是 python3.10+django+iwsgi,用论坛官-方的方法进行配置,无法访问,,代码本地运行没问题就是服务器不可以
复制代码

  1. your server socket listen backlog is limited to 100 connections
  2. your mercy for graceful operations on workers is 60 seconds
  3. mapped 166752 bytes (162 KB) for 2 cores
  4. *** Operational MODE: threaded ***
  5. Traceback (most recent call last):
  6.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/config.py", line 564, in configure
  7.     handler = self.configure_handler(handlers[name])
  8.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/config.py", line 745, in configure_handler
  9.     result = factory(**kwargs)
  10.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/handlers.py", line 153, in __init__
  11.     BaseRotatingHandler.__init__(self, filename, mode, encoding=encoding,
  12.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/handlers.py", line 58, in __init__
  13.     logging.FileHandler.__init__(self, filename, mode=mode,
  14.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/__init__.py", line 1146, in __init__
  15.     StreamHandler.__init__(self, self._open())
  16.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/__init__.py", line 1175, in _open
  17.     return open(self.baseFilename, self.mode, encoding=self.encoding,
  18. PermissionError: [Errno 13] Permission denied: '/www/wwwroot/LMathsWeb/logs/LMaths.com_DeBug-Log.log'

  19. The above exception was the direct cause of the following exception:

  20. Traceback (most recent call last):
  21.   File "/www/wwwroot/LMathsWeb/./LMathsWeb/wsgi.py", line 28, in <module>
  22.     application = get_wsgi_application()
  23.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
  24.     django.setup(set_prefix=False)
  25.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/__init__.py", line 19, in setup
  26.     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  27.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/utils/log.py", line 75, in configure_logging
  28.     logging_config_func(logging_settings)
  29.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/config.py", line 809, in dictConfig
  30.     dictConfigClass(config).configure()
  31.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/logging/config.py", line 571, in configure
  32.     raise ValueError('Unable to configure handler '
  33. ValueError: Unable to configure handler 'debug'
  34. unable to load app 0 (mountpoint='') (callable not found or import error)
  35. unable to find "application" callable in file /www/wwwroot/LMathsWeb/LMathsWeb
  36. unable to load app 0 (mountpoint='') (callable not found or import error)
  37. *** no app loaded. going in full dynamic mode ***
  38. *** uWSGI is running in multiple interpreter mode ***
  39. spawned uWSGI master process (pid: 30707)
  40. spawned uWSGI worker 1 (pid: 30708, cores: 2)
  41. spawned uWSGI http 1 (pid: 30710)
复制代码


使用道具 举报 只看该作者 回复
发表于 2022-11-7 12:08:57 | 显示全部楼层
堡塔安全木兰 发表于 2022-11-7 10:17
提示PermissionError: [Errno 13] Permission denied: '/www/wwwroot/LMathsWeb/logs/LMaths.com_DeBug-Log ...

感谢你的恢复,,解决上面问题后,,有出现新的问题,数据库无法链接,但账号密码都正确,数据库权限也设置了



  1. 2022-11-07 12:06:23 base.py [line:885] INFO: Added job "box_office_job" to job store "default"
  2. 2022-11-07 12:06:23 base.py [line:171] INFO: Scheduler started
  3. 2022-11-07 12:06:23 base.py [line:171] INFO: Scheduler started
  4. 2022-11-07 12:06:23 base.py [line:944] DEBUG: Looking for jobs to run
  5. 2022-11-07 12:06:23 base.py [line:944] DEBUG: Looking for jobs to run
  6. 2022-11-07 12:06:23 base.py [line:1023] DEBUG: Next wakeup is due at 2022-11-07 15:48:30+08:00 (in 13326.921118 seconds)
  7. 2022-11-07 12:06:23 base.py [line:1023] DEBUG: Next wakeup is due at 2022-11-07 15:48:30+08:00 (in 13326.921118 seconds)
  8. 2022-11-07 12:06:23 log.py [line:224] ERROR: Internal Server Error: /
  9. Traceback (most recent call last):
  10.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
  11.     return self.cursor.execute(sql, params)
  12.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
  13.     return self.cursor.execute(query, args)
  14.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
  15.     res = self._query(query)
  16.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
  17.     db.query(q)
  18.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 254, in query
  19.     _mysql.connection.query(self, query)
  20. MySQLdb._exceptions.ProgrammingError: (1146, "Table 'mywebdata.information_article_Tags' doesn't exist")

  21. The above exception was the direct cause of the following exception:

  22. Traceback (most recent call last):
  23.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
  24.     response = get_response(request)
  25.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
  26.     response = wrapped_callback(request, *callback_args, **callback_kwargs)
  27.   File "/www/wwwroot/LMathsWeb/./sitesubject/views.py", line 166, in index
  28.     b = Article.objects.filter(id__exact=A.title).prefetch_related('Tags').only('ContentTitle', 'Author',
  29.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 317, in __getitem__
  30.     qs._fetch_all()
  31.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1326, in _fetch_all
  32.     self._prefetch_related_objects()
  33.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 813, in _prefetch_related_objects
  34.     prefetch_related_objects(self._result_cache, *self._prefetch_related_lookups)
  35.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1730, in prefetch_related_objects
  36.     obj_list, additional_lookups = prefetch_one_level(
  37.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1872, in prefetch_one_level
  38.     all_related_objects = list(rel_qs)
  39.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 262, in __len__
  40.     self._fetch_all()
  41.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
  42.     self._result_cache = list(self._iterable_class(self))
  43.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
  44.     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  45.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
  46.     cursor.execute(sql, params)
  47.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
  48.     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  49.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
  50.     return executor(sql, params, many, context)
  51.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
  52.     return self.cursor.execute(sql, params)
  53.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
  54.     raise dj_exc_value.with_traceback(traceback) from exc_value
  55.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
  56.     return self.cursor.execute(sql, params)
  57.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
  58.     return self.cursor.execute(query, args)
  59.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
  60.     res = self._query(query)
  61.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
  62.     db.query(q)
  63.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 254, in query
  64.     _mysql.connection.query(self, query)
  65. django.db.utils.ProgrammingError: (1146, "Table 'mywebdata.information_article_Tags' doesn't exist")
  66. 2022-11-07 12:06:23 log.py [line:224] ERROR: Internal Server Error: /
  67. Traceback (most recent call last):
  68.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
  69.     return self.cursor.execute(sql, params)
  70.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
  71.     return self.cursor.execute(query, args)
  72.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
  73.     res = self._query(query)
  74.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
  75.     db.query(q)
  76.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 254, in query
  77.     _mysql.connection.query(self, query)
  78. MySQLdb._exceptions.ProgrammingError: (1146, "Table 'mywebdata.information_article_Tags' doesn't exist")

  79. The above exception was the direct cause of the following exception:

  80. Traceback (most recent call last):
  81.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
  82.     response = get_response(request)
  83.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
  84.     response = wrapped_callback(request, *callback_args, **callback_kwargs)
  85.   File "/www/wwwroot/LMathsWeb/./sitesubject/views.py", line 166, in index
  86.     b = Article.objects.filter(id__exact=A.title).prefetch_related('Tags').only('ContentTitle', 'Author',
  87.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 317, in __getitem__
  88.     qs._fetch_all()
  89.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1326, in _fetch_all
  90.     self._prefetch_related_objects()
  91.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 813, in _prefetch_related_objects
  92.     prefetch_related_objects(self._result_cache, *self._prefetch_related_lookups)
  93.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1730, in prefetch_related_objects
  94.     obj_list, additional_lookups = prefetch_one_level(
  95.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1872, in prefetch_one_level
  96.     all_related_objects = list(rel_qs)
  97.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 262, in __len__
  98.     self._fetch_all()
  99.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
  100.     self._result_cache = list(self._iterable_class(self))
  101.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
  102.     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  103.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
  104.     cursor.execute(sql, params)
  105.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
  106.     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  107.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
  108.     return executor(sql, params, many, context)
  109.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
  110.     return self.cursor.execute(sql, params)
  111.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
  112.     raise dj_exc_value.with_traceback(traceback) from exc_value
  113.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
  114.     return self.cursor.execute(sql, params)
  115.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
  116.     return self.cursor.execute(query, args)
  117.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
  118.     res = self._query(query)
  119.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
  120.     db.query(q)
  121.   File "/www/wwwroot/LMathsWeb/d651643ec7c17a40c4e7c03b0f692b99_venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 254, in query
  122.     _mysql.connection.query(self, query)
  123. django.db.utils.ProgrammingError: (1146, "Table 'mywebdata.information_article_Tags' doesn't exist")
  124. [pid: 5729|app: 0|req: 1/1] 127.0.0.1 () {46 vars in 1066 bytes} [Mon Nov  7 12:06:21 2022] GET / => generated 1714 bytes in 3143 msecs (HTTP/1.0 500) 7 headers in 244 bytes (1 switches on core 0)
复制代码
使用道具 举报 回复 支持 反对
发表于 2022-11-7 15:08:16 | 显示全部楼层
宝塔用户_qrmmjq 发表于 2022-11-7 12:08
感谢你的恢复,,解决上面问题后,,有出现新的问题,数据库无法链接,但账号密码都正确,数据库权限也设置了

...

另一个帖子已回,这边就先结帖了
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表