1. 更新科大的源 vim /etc/apt/sources.list

1 deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ jessie main contrib non-free rpi
apt-get update && apt-get upgrade

2. 安装apache2

apt-get install apache2

3. 修改wsgi.py

vim mysite/wsgi.py

4. 修改网站的配置文件 

vim /etc/apache2/sites-available/mysite.conf

ServerName mysite.com
WSGIScriptAlias / /home/code/web/mysite/mysite/wsgi.py


# Default Web Document root directory path
DocumentRoot /home/code/web/mysite


# Directory default attribute
<Directory /home/code/web/mysite>
Order allow,deny
Allow from all
</Directory>


# web static documents directory path
Alias /static /home/code/web/mysite/static


# Directory default attribute
<Directory /home/code/web/mysite/static>
Order allow,deny
Allow from all
</Directory>

5. 激活网站配置

vim mysite/settings.py

debug = False

vim mysite/wsgi.py

树莓派-部署apache服务器

a2ensite mysite.conf

service apache2 reload 

出现错误  Invalid command 'WSGIScriptAlias'  解决方法

apt-get install libapache2-mod-wsgi
service apache2 restart

相关文章:

  • 2022-01-06
  • 2022-02-02
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2018-01-21
  • 2022-01-13
猜你喜欢
  • 2022-01-05
  • 2021-06-04
  • 2021-08-29
  • 2021-12-25
  • 2021-12-25
  • 2021-12-16
  • 2022-02-19
相关资源
相似解决方案