我已经在网上找到了一些答案,但我仍在努力超越apache2默认页面。该webapp可以在本地正常运行,无需使用Apache。我在ubuntu计算机上为此使用了一个AWS EC2实例。
整个代码托管在计算机上的 /home/ubuntu/sm
中,venv
位于/home/ubuntu/sm/venv
中,并在ip addr 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>
对劣质代码的评论,关注,建议和批评,都表示赞赏。