部署Django网站时在apache2默认页面上卡住

部署Django网站时在apache2默认页面上卡住,django,apache2,mod-wsgi,Django,Apache2,Mod Wsgi,我已经在网上浏览了一些答案,但我仍然在努力通过apache2默认页面。webapp在本地运行良好,没有apache。我在ubuntu机器上使用了一个AWSEC2实例 整个代码托管在机器上的/home/ubuntu/sm中,venv位于/home/ubuntu/sm/venv中,并在ip地址3.X.X.212上运行 我尝试过添加、编辑、删除一些变量,但都没有效果。我也没有在错误日志中找到任何东西。“优雅地重新启动”的条目开始显得自恋,因为我已经被困在这个问题上这么久了 apachectl-S生成以

我已经在网上浏览了一些答案,但我仍然在努力通过apache2默认页面。webapp在本地运行良好,没有apache。我在ubuntu机器上使用了一个AWSEC2实例

整个代码托管在机器上的
/home/ubuntu/sm
中,
venv
位于
/home/ubuntu/sm/venv
中,并在ip地址3.X.X.212上运行

我尝试过添加、编辑、删除一些变量,但都没有效果。我也没有在错误日志中找到任何东西。“优雅地重新启动”的条目开始显得自恋,因为我已经被困在这个问题上这么久了

apachectl-S
生成以下响应:

[Tue Nov 05 05:16:52.198045 2019] [alias:warn] [pid 13664:tid 139764718218176] AH00671: The Alias directive in /etc/apache2/sites-enabled/sm.conf at line 33 will probably never match because it overlaps an earlier Alias.
VirtualHost configuration:
*:80                   ip-172-*-*-29.ap-southeast-2.compute.internal (/etc/apache2/sites-enabled/sm.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/run/apache2/" mechanism=default 
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
“sm.conf”
是用于此操作的配置文件,如下所示:

    ServerAdmin webmaster@localhost

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

    Alias /robots.txt /home/ubuntu/sm/website/static/robots.txt
    Alias /favicon.ico /home/ubuntu/sm/website/static/favicon.ico
    Alias /static/ /home/ubuntu/sm/website/static
    Alias /static/ /home/ubuntu/sm/media

    WSGIDaemonProcess website.net processes=2 threads=15 python-home=/home/ubuntu/sm/venv/lib/python3.6 python-path=/home/ubuntu/sm/
    WSGIProcessGroup website.net
    WSGIScriptAlias /sm /home/ubuntu/sm/sm/wsgi.py process-group=website.net

    <Directory /home/ubuntu/sm/>
            AllowOverride all 
            Require all granted 
            Options FollowSymlinks 
    </Directory> 

    <Directory /home/ubuntu/sm/sm>
            <Files wsgi.py>
            Require all granted
            </Files>
    </Directory>

    <Directory /home/ubuntu/sm/website/static/>
            Require all granted
    </Directory>

    <Directory /home/ubuntu/sm/media>
            Require all granted
    </Directory>

ServerAdminwebmaster@localhost
日志级别信息
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
别名/robots.txt/home/ubuntu/sm/website/static/robots.txt
别名/favicon.ico/home/ubuntu/sm/website/static/favicon.ico
别名/static//home/ubuntu/sm/website/static
别名/static//home/ubuntu/sm/media
WSGIDaemonProcess website.net processs=2线程=15 python home=/home/ubuntu/sm/venv/lib/python3.6 python路径=/home/ubuntu/sm/
WSGIProcessGroup网站.net
WSGIScriptAlias/sm/home/ubuntu/sm/sm/wsgi.py进程组=website.net
允许超越所有
要求所有授权
选项如下符号链接
要求所有授权
要求所有授权
要求所有授权


评论、关注、建议、对劣质代码的批评,我们都很感激。

您为静态和媒体目录提供了相同的
别名
,这就是您收到错误的原因检查这里的文档:()不是这样。没有为媒体定义任何功能。而且,我已经切换到那个位置并返回。没有变化我在这里找到了一些解决类似问题的方法:()看看这是否有帮助