最近我已经使用apache2在linode托管了一个Webapp。它工作正常,但是突然发生了一些事情,当我尝试打开网页时,它开始打开apache默认页面。如果有人遇到过,请您帮我摆脱困境。
谢谢大家。
! https://i.stack.imgur.com/1NOHl.jpg 以前是/ var / www / html,我已经修改为/ var / www / html_backup
<VirtualHost *:80>
# 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 ip_addrs
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html_backup
# 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
答案 0 :(得分:0)
您需要运行Django应用。有几种方法,我喜欢通过gunicorn运行Django应用程序,并让Nginx或Apache处理静态内容,并通过Apache代理Django调用。
在我看来,您现在可能根本没有运行该应用程序。通过切换到项目的根目录并使用python manage.py runserver
命令对其进行测试。我怀疑您在某处运行它并将其停止。出发时,您需要使用runserver以外的其他方式。