创建配置文件
/etc/apache2/sites-available# sudo nano mysite.conf
<VirtualHost *:8000> #ServerName hello.djangoserver DocumentRoot /www2 <Directory /www2> #DirectoryIndex testMain.html Options Indexes FollowSymLinks Require all granted </Directory> </VirtualHost>
启用配置
cd /etc/apache2/sites-available sudo a2ensite mysite sudo service apache2 reload
监听端口
cd /etc/apache2 sudo nano ports.conf
Listen 8000