The CGI path: can anyone shine a light?

Everything else that doesn't fall into one of the other PB categories.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I can't see them mentioning anything like "you can install virtually any application on your web space".

http://order.1and1.com/xml/order/MsHost ... tic#block7
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

It's in their KnowledgeBase:

http://faq.oneandone.co.uk/scripting/se ... les/3.html

Observe the URL. "Self programmed executable files". What does that suggest? I think it suggests exe's quite specifically.

But at that URL is the following:

"Can I compile and install any program I want on my 1&1 server?

You can install virtually any application on your web space so long as you do not require root access for the installation.
Please see the 1&1 Terms and Conditions for more information about installation allowances and restrictions.
"

And if you go to the Terms & Conditions, it's a monolithic set of documents in which there is no mention of "CGI" let alone "executable".
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

"Can I compile and install any program I want on my 1&1 server?
Ah, unlucky. Notice how they sell server packages and web hosting packages. This question applies when you purchase a server package. Although I agree, it's misleading when the answer mentions web space.

As you can see here, they tell you which languages are supported under which web hosting packages:
http://faq.oneandone.co.uk/scripting/cgi_options/1.html
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

Well well!

I've just received an invoice from 1&1. There was no text explaining what was going on; no "human" verbiage at all - just an invoice.

They've terminated the contract!

Strangely they've also cancelled my contract for a domain name that I'd registered with them. I actually didn't want the domain cancelled, but it's probably better than being lumbered with a useless 17-month contract!

So, a speedy and total response!

@BlueZNL... if you do add a CGI section to the Survival Guide (which I think would be a good idea as CGI is quite daunting for the beginner) please include a statement telling people categorically to phone up prospective web hosts and ask if they allow CGI executables. Don't go by what they say on their sites, as you may get the wrong idea, like I did!
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Glad it worked out in the end
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
User avatar
greyhoundcode
Enthusiast
Enthusiast
Posts: 112
Joined: Sun Dec 30, 2007 7:24 pm

PureBasic and .htaccess

Post by greyhoundcode »

Realise this is an old thread, however I do a lot of work in PHP and have been thinking about porting a project over to PB, primarily for the potential speed benefits. Anyway ... an earlier post mentioned the anomaly of having files ending in .exe, and another poster suggested .htaccess as a solution.

I just wanted to elaborate upon this and suggest the following as a potential (though untested) .htaccess template for anyone else going down this road.

Code: Select all

# Ensure that mod_rewrite is on

RewriteEngine On

# Directory in which executable resides:

RewriteBase /app_directory/

# Allow direct access to existing files

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Provide executable with request via Get Data

RewriteRule ^(.*)$ webapp.exe?q=$1 [PT,L]
The idea being that webapp.exe would receive the path in variable $q: so if someone accessed http://www.domain.com/app_directory/sho ... ting_story then showpage/65/an_interesting_story would be placed inside $q, accessible to the app as get data, as demonstrated in links to other threads already provided.

It is an approach I use all the time with PHP (tweaked appropriately for the server environment, needless to say) and indeed the above is an adaptation of the suggested rewrite rules for the Kohana and Codeigniter frameworks - it would be interesting to hear feedback from a PB developer who has used a similar approach, or knows of pitfalls relating to it.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: The CGI path: can anyone shine a light?

Post by blueznl »

Would it be interesting for all to add a page to the Survival Guide? I'd need some help with that though...

Edit: (Ah, just noticed I posted that question before :-))
Last edited by blueznl on Mon Dec 07, 2009 4:51 pm, edited 1 time in total.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
greyhoundcode
Enthusiast
Enthusiast
Posts: 112
Joined: Sun Dec 30, 2007 7:24 pm

Re: The CGI path: can anyone shine a light?

Post by greyhoundcode »

I think that could be a good idea: might also serve as an intro to web app development for those who primarily generate GUI programs.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: The CGI path: can anyone shine a light?

Post by blueznl »

I don't want to hijack this thread, so I've opened a new one regarding CGI here:

http://www.purebasic.fr/english/viewtop ... 24#p308324

... unless the devs want to move it elsewhere...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
JackWebb
Enthusiast
Enthusiast
Posts: 109
Joined: Wed Dec 16, 2009 1:42 pm
Location: Tampa Florida

Re: The CGI path: can anyone shine a light?

Post by JackWebb »

I'm glad that Seymour got his money back. For future reference there is an alternative solution. The internet and neworks being the monolithic interconected beasts that they are. Allow for things to be placed anywhere on the network as long as it's connected. So in a stuation like Seymour's, you could host your executables from any machine anywhere. All you have to do is point to it as if you were pointing to a file. They don't even need to have the same OS.

In another scenario.. If you were building a site that was graphics intensive but your home IP doesn't have enough bandwidth to properly host this site. You could split the load and have the "professionally hosted" website handle the graphics while you run your executables from the kitchen table. Of course that machine would need to be up all the time, but the possibilties for PB.cgi are endless..

Jack
Make everything as simple as possible, but not simpler. ~Albert Einstein
Post Reply