程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了配置 Apache2 WSGI django大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决配置 Apache2 WSGI django?

开发过程中遇到配置 Apache2 WSGI django的问题如何解决?下面主要结合日常开发的经验,给出你关于配置 Apache2 WSGI django的解决方法建议,希望对你解决配置 Apache2 WSGI django有所启发或帮助;

所以我正在为我的班级构建一个博客引擎。这应该是一个简单的任务,但由于某种原因,我无法让 Django 在 apache 2 上工作,我什至还没有开始研究数据库,这是这个项目的目标。

我已经多次重新安装了 apache2,但都没有成功。与 Wsgi 相同,我非常密切地遵循本指南,只是真正更改文件夹名称以更符合项目

https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04

我使用 ./manage.py runserver 0.0.0.0:8000 进行了测试,测试域上的所有内容都检查正常。 picture of working port 8000

这是我的最终配置文件

<VirtualHost *:80>
        # The Servername directive sets the request scheR_808_11845@e,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.example.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/serviceaccount/MyBlogENGIne/static
    <Directory /home/serviceaccount/MyBlogENGIne>
         Options Indexes FollowSymlinks Includes ExecCGI
        require all granted
    </Directory>

    <Directory /home/serviceaccount/MyBlogENGIne/BlogENGIne>
          Options Indexes FollowSymlinks Includes ExecCGI
        <files wsgi.py>
                require all granted
        </files>
    </Directory>

    WsgiDaemonProcess MyBlogENGIne python-home=/home/serviceaccount/MyBlogENGIne/BlogENGIneEnv python-path=/home/serviceaccount/MyBlogENGIne
    WsgiProcessGroup MyBlogENGIne
    WsgiScriptAlias / /home/serviceaccount/MyBlogENGIne/BlogENGIne/wsgi.py


</VirtualHost>

# vim: Syntax=apache ts=4 sw=4 sts=4 sr noet

但是,在完成下一步部分的所有操作后(配置 let-encrypt),我没有得到 Web 应用程序的运行版本;相反,我得到了一个页面索引。

Index Of web

如果我不能让它在我的网络项目中工作,我不知道该怎么办,请帮忙。我已经连续做了近 2 天,没有任何进展

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的配置 Apache2 WSGI django全部内容,希望文章能够帮你解决配置 Apache2 WSGI django所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。