当我尝试打开我的 IP 地址时,Apache 默认页面正在打开



最近我使用 apache2 在 linode 中托管了一个 Web 应用程序。它工作正常,但突然发生了一些事情,当我尝试打开我的网页时,它开始打开 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

你需要运行 Django 应用程序。有几种方法,我喜欢通过gunicorn运行Django应用程序,让Nginx或Apache处理静态内容并通过Apache代理Django调用。

在我看来,您现在可能根本没有运行该应用程序。 通过切换到项目的根目录并使用python manage.py runserver命令对其进行测试。我怀疑你让它在某个地方运行并阻止了它。当你开始的时候,你会想要使用运行服务器以外的其他东西。

最新更新