[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] Problem with sub-domain and cgi scripts



I have created sub-domains on my server buy adding a second
file called subdomain.conf in this file I have added the
sub-domain like the example at the bottom of this email and also set the DNS up to make this
all work. The sub-domain work just fine like this.
But when I add a CGI script or an ASP script they do not what to work.
You get a file can't be found error. It is look for the CGI file in the main
web directory for the main site.
Below is a little bit of the env of what is going on
You can see with the SCRIPT_FILENAME it is looking for the script in
the wrong directory it should be looking in
/home/sites/home/web/sub_domains/runwith.domain.com/web
not /home/sites/home/web/
I had to add the script to /home/sites/home/web/ to get it to work

The question is how can I make it run the scripts inside the
sub_domain???

REDIRECT_SCRIPT_URI="http://runwith.domain.com/printenv.cgi";
REDIRECT_SCRIPT_URL="/printenv.cgi"
SCRIPT_FILENAME="/home/sites/home/web/printenv.cgi"
SCRIPT_NAME="/printenv.cgi"
SCRIPT_URI="http://runwith.domain.com/printenv.cgi";

<VirtualHost 222.111.222.111>
ServerName runwith.domain.com
ServerAdmin rkurth
DocumentRoot /home/sites/home/web/sub_domains/runwith.domain.com/web
RewriteEngine on
RewriteCond %{HTTP_HOST}    !^222.111.222.111(:80)?$
RewriteCond %{HTTP_HOST}    !^runwith.domain.com(:80)?$
RewriteRule ^/(.*)    http://runwith.domain.com/$1 [L,R]
RewriteOptions inherit  
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-httpd-php .php4 .php3
AddType application/x-httpd-php .php
</VirtualHost>