Perl cgi outside of cgi-bin on ccgi server?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Perl cgi outside of cgi-bin on ccgi server?
Perl cgi outside of cgi-bin on ccgi server?
06-05-2009 9:01 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
i.e. something like: http://ccgi.xx.force9.co.uk/yy/zz.pl
where 'yy' is not cgi-bin (and not below cgi-bin).
I've tried various settings in the .htaccess file, but I can't get it to work. Is the ccgi server setup so that perl cgi can only be inside or below the cgi-bin folder?
Thanks,
Woll
Re: Perl cgi outside of cgi-bin on ccgi server?
06-05-2009 9:10 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
RewriteEngine On
RewriteRule yy/zz.pl /cgi-bin/zz.pl
Re: Perl cgi outside of cgi-bin on ccgi server?
06-05-2009 12:17 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
What I am actually trying to do is to create a mirror (on the ccgi server) of my live site for testing purposes, which I think means that your suggestion wouldn't work. I will start another thread on that subject, to keep things neat.
Woll
Re: Perl cgi outside of cgi-bin on ccgi server?
08-05-2009 4:20 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
e.g. this would not work:
RewriteEngine On
RewriteRule /cgi-bin/zz.pl /cgi-bin/test_site/zz.pl
Thanks,
Woll
Re: Perl cgi outside of cgi-bin on ccgi server?
08-05-2009 3:47 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Perl cgi outside of cgi-bin on ccgi server?
08-05-2009 4:12 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/cgi-bin
RewriteRule ^/([a-z/.]+)$ cgi-bin/$1
and place your entire website structure in the /cgi-bin folder/
if my theory is right (and I havent tested it) you should then just be able to access: http://ccgi.xxx.plus.com/yyy/zzz.pl ; and it would redirect (internally) to: http://ccgi.xxx.plus.com/cgi-bin/yyy/zzz.pl
It would work for an entire structure - unless someone went directly to the cgi-bin/ folder (that's what the cautionary Rewritecond does)
?
B.
Re: Perl cgi outside of cgi-bin on ccgi server?
08-05-2009 4:49 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Barry It would work for an entire structure - unless someone went directly to the cgi-bin/ folder
I might have misunderstood but I think this is the OP's issue.
Re: Perl cgi outside of cgi-bin on ccgi server?
08-05-2009 5:06 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
B.
Re: Perl cgi outside of cgi-bin on ccgi server?
09-05-2009 1:30 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
It's related to trying to create a test version of a live site, so updates can be checked on the Force9 server before they go live (I posted a separate thread on that).
So, the live site has things in cgi-bin and an index.html in the root folder and the perl scripts are accessed from the html pages using URLs like '/cgi-bin/zz.pl'. The most natural way to create the test version would be to create a 'test_site' folder at the top level and reproduce the same hierarchy as the live site below that folder - with no changes to the source/html - and have a ReWrite to redirect the test site domain to the 'test_site' folder. However, that wont work because (as Ben replied) you can't have perl scripts outside of cgi-bin.
To get round that, you could have the test site (or both sites as suggested) below /cgi-bin, but that also wouldn't work, because the server setup ignores ReWrite rules if the URL starts with '/cgi-bin' (I guess something to do with the way the ScriptsAlias directive works), so the URLs in the source like '/cgi-bin' wont get redirected and will end up running the scripts in the live site instead of the scripts in the test site!
At the moment, I am thinking that the only way to do it would be to create the test site by uploading the new version of the site to the server and then actually editing the URLs in all the files (using an automated script!), so that the perl scripts are called using URLs like '/cgi-bin/test_site/zz.pl', instead of directly inside '/cgi-bin'.
Thanks for the input.
Woll
Re: Perl cgi outside of cgi-bin on ccgi server?
09-05-2009 5:04 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Gabe
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Perl cgi outside of cgi-bin on ccgi server?