apache - Apache2 multiple name-based virtual hosts on one machine with rails/rack -
am stuck on configuring apache serve 2 different sites name based virtual hosts at:
http://experimental/
and
http://api.experimental/
on 1 machine setup works fine, , apache reports this:
apachectl -d dump_vhosts apache2: not reliably determine server's qualified domain name, using 127.0.0.1 servername virtualhost configuration: wildcard namevirtualhosts , _default_ servers: *:* namevirtualhost default server experimental (/etc/apache2/sites-enabled/00-nowa.conf:3) port * namevhost experimental (/etc/apache2/sites-enabled/00-nowa.conf:3) port * namevhost api.experimental (/etc/apache2/sites-enabled/00-nowa.conf:15) syntax ok
on 2nd machine not work, both urls end pointing first app, it's output of same command has additional : lines:
apachectl -d dump_vhosts apache2: apr_sockaddr_info_get() failed experimental apache2: not reliably determine server's qualified domain name, using 127.0.0.1 servername [tue may 14 15:36:08 2013] [warn] namevirtualhost *:80 has no virtualhosts [tue may 14 15:36:08 2013] [warn] namevirtualhost *:80 has no virtualhosts virtualhost configuration: wildcard namevirtualhosts , _default_ servers: *:* experimental (/etc/apache2/sites-enabled/00-nowa.conf:3) *:* api.experimental (/etc/apache2/sites-enabled/00-nowa.conf:15) syntax ok
the vhost files each machine broken one:
<virtualhost *> servername experimental railsenv production documentroot /home/nowa/nowa_app/nowa/current/public <directory /home/nowa/nowa_app/nowa/current/public > allow options -multiviews </directory> </virtualhost> <virtualhost *> servername api.experimental rackenv production passengermininstances 2 passengermaxpoolsize 10 documentroot /home/nowa/nowa_app/services/api_gateway/current/app </virtualhost>
and working:
<virtualhost *> servername experimental railsenv production documentroot /home/nowa/nowa_app/nowa/current/public <directory /home/nowa/nowa_app/nowa/current/public > allow options -multiviews </directory> </virtualhost> <virtualhost *> servername api.experimental rackenv production passengermininstances 2 passengermaxpoolsize 10 documentroot /home/nowa/nowa_app/services/nowa_api_gateway/current/app </virtualhost>
why output of apachectl -d dump_vhosts different? have missed? :c
asked on #httpd irc room , turns out apache misinterpreting
<virtualhost *>
as ip based vhost entry, not name based one, changing fixed it:
<virtualhost *:80>
this because namevirtualhost defined on broken server:
namevirtualhost *:80
complete working config:
<virtualhost *:80> servername experimental railsenv production documentroot /home/nowa/nowa_app/nowa/current/public <directory /home/nowa/nowa_app/nowa/current/public > allow options -multiviews </directory> </virtualhost> <virtualhost *:80> servername api.experimental rackenv production passengermininstances 2 passengermaxpoolsize 10 documentroot /home/nowa/nowa_app/services/api_gateway/current/app </virtualhost>
Comments
Post a Comment