CGI Survival Guide

Everything else that doesn't fall into one of the other PB categories.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

CGI Survival Guide

Post by blueznl »

Well, okay, let's try it then. Should I post the questions here or in another part of the forum? If it's in the wrong please could some of the admin's / moderators move it please?

This thread is a reaction to:

http://www.purebasic.fr/english/viewtop ... 13&t=40196
http://www.purebasic.fr/english/viewtop ... =7&t=31517

I want to add a little page to the Survival Guide on programming for web servers, ie. CGI (and similar?) stuff. I'm a total newby on this, and know little about hosting stuff, let alone PHP (brr) HTML (ai ai) or Apache (what do helicopters have to do with hosting?) so... I need help.

It's probably best to first figure out what I have to run on a (virtual) server to test CGI stuff. I'd like to bring it to a level similar to the Survival Guide section on VirtualBox or SQL. Not too deep, just enough to get started...

http://www.xs4all.nl/~bluez/purebasic/p ... 12.htm#top
http://www.xs4all.nl/~bluez/purebasic/p ... 13.htm#top

So... what should we (hehe, see how I managed to slip that in :-)) cover?

Some suggestions:

- devving from home / setting up a server (VirtualBox?)
- installing Apache (or something else?)
- ...
- the rules of CGI
- doing things in PureBasic
- further remarks

Of course, I'm not interested in doing things with PHP etc. and I realise that most if it might not directly be PureBasic related, at least not at first :-)

So, this is where I am lost :-) So... suggestions, help, what not?
( 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
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: CGI Survival Guide

Post by DoubleDutch »

This is a good idea. I'also like a section with the differences between getting something working on a Windows or Linux server (with regard to CGI) - like some kind of framework that sets up access to a database, etc...
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: CGI Survival Guide

Post by Fred »

Would be interesting to see how far you go :)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: CGI Survival Guide

Post by DoubleDutch »

Also please add a list of WebHosts that have been verified to let you run applications (and on which OS) without running foul of the T&C. I know DreamHost lets you (Linux based), but I don't know of any others.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: CGI Survival Guide

Post by blueznl »

Well, then start by suggesting what server software I should use :-)
( 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... )
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: CGI Survival Guide

Post by Fred »

which ? Apache !
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: CGI Survival Guide

Post by blueznl »

That may be the logical choice for you, but as I said, I haven't got any experience with webhosting platforms or webservers, in spite of my professional background... I'll have a look at it.
( 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... )
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: CGI Survival Guide

Post by moogle »

For server software you could use EasyPHP, it includes Apache/MySQL and is a pretty quick way to set up a home/test webserver for scripts and things :)
It's just like XAMP or any other software that speeds up setting a webserver up.
Image
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Re: CGI Survival Guide

Post by citystate »

what? no-one has suggested (a enhanced version of) Atomic Webserver? :D :D :D
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: CGI Survival Guide

Post by moogle »

citystate wrote:what? no-one has suggested (a enhanced version of) Atomic Webserver? :D :D :D
:lol:
Image
User avatar
JackWebb
Enthusiast
Enthusiast
Posts: 109
Joined: Wed Dec 16, 2009 1:42 pm
Location: Tampa Florida

Re: CGI Survival Guide

Post by JackWebb »

blueznl wrote:That may be the logical choice for you, but as I said, I haven't got any experience with webhosting platforms or webservers, in spite of my professional background... I'll have a look at it.
Blue,

I hope I'm still on time for the CGI party. I'd be happy to share with you everything I've learned (not an expert but I do this all the time in PB).. Start with Abyss webserver (Windows). It's a very easy to use and robust production server. For developers it's great because there is a fully functioing FREE version with support via forums. The commercial version (which I have) allows you to run multiple websites on the same server. That's the only difference. But for learning how to do CGI the free version is all you need. I've even used the AtomicWebServer but it doesn't support POST methods only GET which is fine for most situations. But also has no security.

Webhosts and domain names. Most webhosts will not allow you to run .EXE files, save your money and host yourself. It will not just save you money but time since you can work locally. As far as domain names and dynamic IP addresses. Again save your money and go to no-ip.com or DynDns.com and get a free subdomain that will handle your dynamic IP. You can buy a domain name if you really want one and they will host it for your dynamic IP, (they act as your DNS) neat!

PB and CGI. Actually Pure does CGI very well. It's probably more coding than say PHP, but think of the possibilities and SPEED, low server load etc.. BTW PHP is the slowest language known to man.. And very prone to PHP hackers, I see them in my user log all the time (you will too).

I posted an example over at Aprelium.com http://www.aprelium.com/forum/viewtopic ... highlight=

Apache.. Great webserver but you will spend more time learning Apache than CGI....


BTW, thank you for the Survival Guide!
Jack
Make everything as simple as possible, but not simpler. ~Albert Einstein
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: CGI Survival Guide

Post by blueznl »

Thanks for the offer, track this space, I'll post my first questions probably in here...

I'm a little distracted with a bit of graphics at the moment, but this hasn't been forgotten, so, you're not just in time, you're even early :-)
( 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... )
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: CGI Survival Guide

Post by Seymour Clufley »

I wrote a CGI include that handles all the communication coming in and out of a PB exe. I've been using it for ages and it also handles returning images (although I haven't tested that for a while). If it would help, I'll post it.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: CGI Survival Guide

Post by blueznl »

Anything helps, but be prepared to answer questions :twisted:
( 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

PureWeb Framework?

Post by greyhoundcode »

JackWebb wrote:PB and CGI. Actually Pure does CGI very well. It's probably more coding than say PHP, but think of the possibilities and SPEED, low server load etc.. BTW PHP is the slowest language known to man.. And very prone to PHP hackers, I see them in my user log all the time (you will too).
I personally am a big fan of and do a great deal of work in PHP. It's very productive, and though many a flame war has started over debates about how fast PHP is versus ASP.NET, JSP, Coldfusion and the rest, I think it's fair to say it is a "market leader" in web development. I would also suggest it is no less or more secure than PB: it is the use or lack of good programming practice that largely determines security.

However, I have no intention of starting a flame war: I too would like to use PB for CGI to take advantage of the superior speed and just because I rather like the PB syntax generally.

Getting to my point however, we all know that reinventing the wheel is to be avoided. In the world of PHP, we very often make use of frameworks which provide the structure and 'wiring' for our web apps, and take care of a range of common tasks, from sanitising request data to managing database-based sessions, generating CAPTCHAs, sticky form data, transparent connectivity with a range of databases and the list goes on.

Wouldn't it be fantastic to have a PB equivalent of one of these frameworks: and in the best traditions of web development grant an open source license so that the entire community can benefit?
Post Reply