当我在django网站上提交表单时,为什么我的apache2服务器会暂时崩溃?

当我在django网站上提交表单时,为什么我的apache2服务器会暂时崩溃?,django,apache,web,apache2,Django,Apache,Web,Apache2,我用Django做了一个网站。它具有登录功能,允许您创建、更新和类似帖子。它可以在本地运行的开发服务器上正常工作,但是当我在apache2上设置它时,几乎所有的功能都可以工作。中断的部分是,每当我创建、更新或类似帖子时,页面都不会加载,apache服务器会关闭一段时间。当我检查apache日志时,它给出了一个空的408错误。我已经尝试将apache配置中的两个超时都设置得更大,但这没有帮助 我很抱歉,如果这个问题的答案是在这里,因为我无法找到它,尽管搜索,如果你知道一个请联系我。如果需要任何额外

我用Django做了一个网站。它具有登录功能,允许您创建、更新和类似帖子。它可以在本地运行的开发服务器上正常工作,但是当我在apache2上设置它时,几乎所有的功能都可以工作。中断的部分是,每当我创建、更新或类似帖子时,页面都不会加载,apache服务器会关闭一段时间。当我检查apache日志时,它给出了一个空的408错误。我已经尝试将apache配置中的两个超时都设置得更大,但这没有帮助

我很抱歉,如果这个问题的答案是在这里,因为我无法找到它,尽管搜索,如果你知道一个请联系我。如果需要任何额外信息,请询问。谢谢大家!

编辑1: 设置

/etc/apache2/sites available/resume\u site.conf

RewriteEngine on
RewriteCond %{http_host} !^www.andyflynnsmiles.com [nc]
RewriteRule ^(.*)$ http://www.andyflynnsmiles.com/$1 [r=301,nc]

RewriteCond %{SERVER_NAME} =www.andyflynnsmiles.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
/etc/apache2/sites available/resume_site-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        ServerName www.andyflynnsmiles.com
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

        Alias /static /home/andysmiles/resume_site/platformer_project/static
        <Directory /home/andysmiles/resume_site/platformer_project/static>
                Require all granted
        </Directory>

        Alias /media /home/andysmiles/resume_site/media
        <Directory /home/andysmiles/resume_site/media>
                Require all granted
        </Directory>

        <Directory /home/andysmiles/resume_site/platformer_project>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>

        <Directory /home/andysmiles/resume_site>
                Require all granted
        </Directory>

        WSGIScriptAlias / /home/andysmiles/resume_site/resume_site/wsgi.py
        WSGIDaemonProcess resume_site python-path=/home/andysmiles/resume_site python-home=/home/andysmiles/resume_site/venv
        WSGIProcessGroup resume_site



Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias andyflynnsmiles.com
SSLCertificateFile /etc/letsencrypt/live/andyflynnsmiles.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/andyflynnsmiles.com/privkey.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
</IfModule>

#ServerName指令设置请求方案、主机名和端口
#服务器使用来标识自身。这在创建时使用
#重定向URL。在虚拟主机的上下文中,服务器名
#指定必须在请求的主机:标头中显示的主机名
#匹配此虚拟主机。对于默认虚拟主机(此文件),此
#该值不是决定性的,因为它被用作最后的宿主。
#但是,必须为任何其他虚拟主机显式设置它。
服务器名www.andyFlynsmiles.com
服务器管理员webmaster@localhost
DocumentRoot/var/www/html
#可用日志级别:trace8、…、trace1、调试、信息、通知、警告、,
#错误、暴击、警报、紧急情况。
#还可以为特定应用程序配置日志级别
#模块,例如。
#日志级别信息ssl:警告
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
#对于conf/available/中的大多数配置文件
#在全局级别启用或禁用,可以
#仅包含一个特定虚拟主机的行。例如
#以下行仅为此主机启用CGI配置
#在使用“A2F”全局禁用后。
#包括conf available/service-cgi-bin.conf
别名/static/home/andysmiles/resume\u site/platformer\u project/static
要求所有授权
别名/media/home/andysmiles/resume\u站点/media
要求所有授权
要求所有授权
要求所有授权
WSGIScriptAlias//home/andysmiles/resume\u site/resume\u site/wsgi.py
WSGIDaemonProcess resume\u site python path=/home/andysmiles/resume\u site python home=/home/andysmiles/resume\u site/venv
WSGIProcessGroup恢复_站点
Include/etc/letsencrypt/options-ssl-apache.conf
ServerAlias和yFlynsmiles.com
SSLCertificateFile/etc/letsencrypt/live/andyflynsmiles.com/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/andyflynnsmiles.com/privkey.pem

您需要更清楚地了解这里的情况。例如,您是如何运行django项目的?apache是如何设置路由的?请展示您的一些设置。我想我已经添加了apache路由设置,但我不知道您所说的“例如,您如何运行django项目?”是什么意思。django站点是如何运行的?我不知道您的意思。抱歉,您必须以某种方式实际运行它。为了测试它,通常是
python manage.py runserver
,为了生产,您可以使用类似于gunicorn的东西。