請使用文字編輯器開啟 httpd.conf 檔案,然後,加入下面這幾行就可以了 ( 假設虛擬網站是 http://xyz.arthurtoday.com 為例) 。
WSGIScriptAlias /wsgi /var/www/xyz.arthurtoday.com/public_html/webapp.wsgi
<Directory /usr/local/www/wsgi-scripts>
Order allow,deny
Allow from all
</Directory>
第一行是告訴 Apache HTTP Server 說, 只要是連到 http://xyz.arthurtoday.com/wsgi 的任何位置 ( 例如,http://xyz.arthurtoday.com/wsgi/hello 或 http://xyz.arthurtoday.com/wsgi/abc ) 都用 webapp.wsgi 去執行的意思,而接著的那個 <Directory> 是設定權限的部分,所以就照貼就好了,改好之後要記得要指行下面的指令讓 apache 重新載入設定。
/etc/init.d/apache2 reload 。
第一行是告訴 Apache HTTP Server 說, 只要是連到 http://xyz.arthurtoday.com/wsgi 的任何位置 ( 例如,http://xyz.arthurtoday.com/wsgi/hello 或 http://xyz.arthurtoday.com/wsgi/abc ) 都用 webapp.wsgi 去執行的意思,而接著的那個 <Directory> 是設定權限的部分,所以就照貼就好了,改好之後要記得要指行下面的指令讓 apache 重新載入設定。
/etc/init.d/apache2 reload 。

0 意見:
張貼意見