私が取り組んでいるアプリケーションには、2つのサーバーがあります。1つはAPiで、もう1つはアプリです。どちらもピラミッドを使用して作成されており、少なくとも2台の別々のマシンに配置する予定です。
しかし、私のラップトップでは、api.localhostをapiサーバーにマップし、app.localhostをアプリサーバーにマップできるようにしたいと考えています。
私は次のことをしました:
これは私のhttpd.confファイルです:
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=ranjith group=staff processes=1 \
threads=4 \
python-path=/home/ranjith/VENV/lib/python2.7/site-packages
<VirtualHost *:80>
ServerName app.localhost
WSGIScriptAlias / /home/ranjith/workspace/app.wsgi
</VirtualHost>
<VirtualHost *:80>
ServerName api.localhost
WSGIScriptAlias / /home/ranjith/workspace/api.wsgi
</VirtualHost>
<Directory /home/ranjith/VENV>
WSGIProcessGroup pyramid
Order allow,deny
Allow from all
</Directory>
これらのエントリを/etc/hostsに追加しました
127.0.0.1 api.localhost
127.0.0.1 app.localhost
サーバー用に2つのWSGIファイルを追加しました。それらは開発サーバーで動作するように動作します
しかし、ローカルホストサブドメインを構成する方法が本当にわからず、WSGIについての実際の知識もありません。
sudo serviceapache2restartを実行しました
それは言う:
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
これはエラーメッセージではないと思います。
http://app.localhostと入力すると、404エラーが発生するため、アプリにアクセスできません。
httpd.confファイルの何が問題になっていますか?