【发布时间】:2021-05-18 15:17:40
【问题描述】:
这个 index.html 显示了 apache 默认页面。
当我 cd /var/www/html 并 ls 它时,它显示了 index.html,它是 apache 默认索引页面。
我的问题是:我应该怎么做才能将自己的模板更改为页面索引页面,我应该将模板文件夹cp到这个/var/www/html,还是应该在project.conf中做一些事情,或者我应该改变将chown/chmod添加到我的项目中的模板目录中以便我实现它?
这是我的可用站点/project.conf:
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName Server_IP
ServerAlias Server_IP
DocumentRoot /var/www/html #maybe the problem of this line
Alias /static /home/ME/project/static
<Directory /home/ME/project/static>
Require all granted
</Directory>
Alias /media /home/ME/project/media
<Directory /home/ME/project/media>
Require all granted
</Directory>
<Directory /home/ME/project/Project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
<Directory />
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>
ps。当我尝试将documentroot 更改为/home/ME/project_1/templates 时,页面显示我没有权限访问该文件的错误。
【问题讨论】:
标签: python django apache server apache2