Web Hosting Talk







View Full Version : scriptalias


diyoha
02-24-2004, 10:39 PM
Hello,

I have been banging my head on this issue for the last 4 hours with no success perhaps some kind soul has already figured this out.

I am trying to install a cgi-script in my location and share it from different domains. I have it installed on one domain and all is well.
Now I want to create a SCRIPTALIAS to point all the other domains to script within the apache httpd.conf file.


here is what it looks like:

ScriptAlias /cgi-bin/dev/ "/home/ecorderf/www/cgi-bin/dev/"

However this is not working. The server does not even recognize the http://www.mydomain.com/cgi-bin/dev/ as a legitimate directory. It gives a file not found.

Any ideas will be appreciated.

note: this is on a shared dedicated linux server with apache 1.3 and cpanel installed. However I am doing all this from the command line.

thanks

David

xar
02-24-2004, 10:49 PM
well you could do it like this

<VirtualHost ip>
ServerAdmin admin@domain.com
DocumentRoot /home/blah1/public_html
ServerName www.domain.com
ServerAlias domain.com
ScriptAlias /cgi-bin/ "/home/blah/public_html/cgi-bin/"
</VirtualHost>

<VirtualHost ip>
ServerAdmin admin@domain.com
DocumentRoot /home/blah2/public_html
ServerName www.domain.com
ServerAlias domain.com
ScriptAlias /cgi-bin/ "/home/blah/public_html/cgi-bin/"
</VirtualHost>


<VirtualHost ip>
ServerAdmin admin@domain.com
DocumentRoot /home/blah3/public_html
ServerName www.domain.com
ServerAlias domain.com
ScriptAlias /cgi-bin/ "/home/blah/public_html/cgi-bin/"
</VirtualHost>


so that would be 3 virtual hosts / domains that have different DocumentRoot's but share the same cgi-bin

diyoha
02-24-2004, 11:05 PM
Hello,

Thanks for your ideas. However I would like a universal solution! Because I will be adding new domains to my server and I want all the new domains to share that cgi script.

The point is I would like to make an addition to the httpd.conf file that works for new domains that I add.

Any more ideas?

thanks

David

xar
02-24-2004, 11:08 PM
well thats how you add domains

if your going to add domains that share a cgi-bin you have to add what i said in my last post to httpd.conf but change it to fit you

i'm not too sure of any other ways to do that

what i would do would be to make something like

/home/www
and in /home/www

have cgi-bin
then you domain

/home/www/domain1
/home/www/domain2
/home/www/domain3
etc..


so now you just do 3 virtual hosts
and have the shared cgi-bin

diyoha
02-24-2004, 11:13 PM
Hello,

I use CPANEL to add domains. So it is an automated process. I would rather not have to ssh into my system everytime and make a manual update. Too many ways for mistakes to happen. One of which is I forget to do it.

The other issue is I do not want to override the standard CGI directory. I want the normal directory to work as expected. In addition to the global cgi setting I make. So accounts can run scripts normally locally ... and also run the one global script.

David

xar
02-24-2004, 11:15 PM
well if you cant figure it out with cpanel what i told you will work

cpanel is for lazy admins :)

diyoha
02-24-2004, 11:59 PM
thanks,

cpanel (or any other control panel) is for dealing with automation. Concentrating on making money rather than the server :D

David