IguanaCMS - The first ever CMS written in FreeBasic

User projects written in or related to FreeBASIC.
miilvyxg
Posts: 193
Joined: Dec 07, 2021 6:51

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by miilvyxg »

Julcar wrote:
miilvyxg wrote:Finally. How to use this CMS? The only thing I found on chiselapp is a repo with a source tree. No way to 'clone' this repo to my computer like git clone. No way to download it via the web interface either. You give it to us only to watch?
You can download the source code from the fossil page as a zip: http://chiselapp.com/user/julcar/reposi ... ca4db9.zip

Also with a fossil client you can clone the repository as with git

In the zip file there is a file called compile.bat for building the CMS on windows, there is also compile.sh but is some out of date because I've not tested on linux for a while

To use it you can deploy any web server that has CGI feature for example IIS, Apache, Lighttpd, Hiawatha, Mongoose, Abyss, etc.

You must configure your webserver to execute binary .exe as CGI by registering the .exe extension as CGI
Open a sourceforge repo like fbc or github man. This chiselapp site's UI sucks. I can't find where to download as zip at all. The link you gave is for the latest commit at this time only. What about later commits?

Oh I see. I bit of trial and error I got it from your link: http://chiselapp.com/user/julcar/reposi ... naCMS/zip/

Hope it is the latest snapshot.

p/s: that site is not even have https!
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

Yes you are right, maybe Fossil was not the best choice for the long-term, but at the time I did it was the most friendly source code manager for me, somebody that did not touched any SCM before.

Btw you can add the https protocol to the adress and will work
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

I installed Laragon. What to do next? I have Apache.

https://laragon.org/download/index.html
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

operator+ wrote:I installed Laragon. What to do next? I have Apache.

https://laragon.org/download/index.html
Are you using windows or linux?
If Linux, you must place the compiled binary into cgi-bin folder and chmod 755.
If using Windows, you have to configure CGIHandler to open .exe files as CGI
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:
operator+ wrote:I installed Laragon. What to do next? I have Apache.

https://laragon.org/download/index.html
Are you using windows or linux?
If Linux, you must place the compiled binary into cgi-bin folder and chmod 755.
If using Windows, you have to configure CGIHandler to open .exe files as CGI
Is there step by step guide? I'm on Windows.
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

Ok, here is a step by step of what you should do in Apache on Windows to get working IguanaCMS:

1) in your root folder create (if not exists already) a cgi-bin folder
2) inside cgi-bin create a .htaccess with this text:

Code: Select all

Options +ExecCGI
SetHandler cgi-script .exe
3) Download IguanaCMS source code and compile it
4) Move or copy index.exe to your cgi-bin folder
5) Edit sitelist.json with your base path (the path where index.exe can find for data/ and temp/ dirs)
Let's say you downloaded IguanaCMS source code to C:\IguanaCMS, then your sitelist.json should look like this:

Code: Select all

{
  "default_site" : {
    "default_base_path" : "C:\\IguanaCMS\\"
  }
}
6) Copy your sitelist.json to cgi-bin folder (must be in the same dir as index.exe)
7) In your Apache's root folder create or edit the .htaccess with this content:

Code: Select all

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} "=/"
RewriteRule ^/* cgi-bin/index.exe [L]

RewriteCond %{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} ^[-0-9a-zA-Z/_]+\.html$
RewriteRule ^[-0-9a-zA-Z/_]+\.html$ cgi-bin/index.exe [L]
Now you should be able to open http://127.0.0.1 and see a 404 not found page but with the IguanaCMS logo.

If the case above, then you could start configuring your Iguana by editing data/settings.json, basically changing the site_url would be enough by the moment.

To use the admin panel you must get into http://127.0.0.1/users/register.html and fill your user name and password, the answer for the captcha question can be found in data/captcha.json

After registering, you still don't have admin privilegies, then you must go to data/users/your_username.json and change user_active property valeu to true and the "user_group" property from 0 to 1.

Just apologize me for the crappy web design, I'm trying to improve it :)
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

It works. Thank you.
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Not quite works. The page I saw at localhost is of index.php (not Iguana). After I removed this file, what I saw is Index of / with cgi-bin listed, click on cgi-bin gave me 403 Forbidden You don't have permission to access this resource.
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

Mmm, make sure you have enabled Rewrite Module in httpd.conf, if that does not work, you could look if apache is running under administrator privileges.
My experience says that apache is very tricky when executing this kind of binary cgi, especially on Windows
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:Mmm, make sure you have enabled Rewrite Module in httpd.conf, if that does not work, you could look if apache is running under administrator privileges.
My experience says that apache is very tricky when executing this kind of binary cgi, especially on Windows
What about nginx? Is it a little easier? Not only me but other reported .htaccess is ignored in XAMPP/WAMPP (don't blame Laragon because it was derived from those). Nginx has Windows version, it's a zip. Could you try Nginx and give a step by step guide? Thank you.

https://nginx.org/en/download.html

(I tried to use TinyWeb Server but it doesn't work or I don't know how to configure it but it expects an index.html not index.exe).
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

operator+ wrote:
Julcar wrote:Mmm, make sure you have enabled Rewrite Module in httpd.conf, if that does not work, you could look if apache is running under administrator privileges.
My experience says that apache is very tricky when executing this kind of binary cgi, especially on Windows
What about nginx? Is it a little easier? Not only me but other reported .htaccess is ignored in XAMPP/WAMPP (don't blame Laragon because it was derived from those). Nginx has Windows version, it's a zip. Could you try Nginx and give a step by step guide? Thank you.

https://nginx.org/en/download.html

(I tried to use TinyWeb Server but it doesn't work or I don't know how to configure it but it expects an index.html not index.exe).
Nginx does not support CGI, only FastCGI and SCGI (I have plans to implement SCGI in the future)
In the other side, to get Tinyweb working you have to create a blank index.html in root and copy index.exe to cgi-bin, then you can init http://127.0.0.1/cgi-bin/index.exe
Alternatively you can use the "refresh" meta tag to redirect automagically to cgi-bin/index.exe
Note that if using Tinyweb, you must change in settings.json the site_fancy_url property to false, as Tinyweb does not support url rewrites
Other alternative is Hiawatha Webserver which supports cgi and url rewrite (I can supply a config file if needed)
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:Nginx does not support CGI, only FastCGI and SCGI (I have plans to implement SCGI in the future)
In the other side, to get Tinyweb working you have to create a blank index.html in root and copy index.exe to cgi-bin, then you can init http://127.0.0.1/cgi-bin/index.exe
Alternatively you can use the "refresh" meta tag to redirect automagically to cgi-bin/index.exe
Note that if using Tinyweb, you must change in settings.json the site_fancy_url property to false, as Tinyweb does not support url rewrites
Other alternative is Hiawatha Webserver which supports cgi and url rewrite (I can supply a config file if needed)
I followed your instructions. The only thing I see on http://127.0.0.1/cgi-bin/index.exe is a blank page with only the text main. There is nothing else. Maybe I'm just out of luck.
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

operator+ wrote:
Julcar wrote:Nginx does not support CGI, only FastCGI and SCGI (I have plans to implement SCGI in the future)
In the other side, to get Tinyweb working you have to create a blank index.html in root and copy index.exe to cgi-bin, then you can init http://127.0.0.1/cgi-bin/index.exe
Alternatively you can use the "refresh" meta tag to redirect automagically to cgi-bin/index.exe
Note that if using Tinyweb, you must change in settings.json the site_fancy_url property to false, as Tinyweb does not support url rewrites
Other alternative is Hiawatha Webserver which supports cgi and url rewrite (I can supply a config file if needed)
I followed your instructions. The only thing I see on http://127.0.0.1/cgi-bin/index.exe is a blank page with only the text main. There is nothing else. Maybe I'm just out of luck.
Ok, if you see the text "main" is a good signal, that means that you are indeed executing index.exe, now make sure that sitelist.json is present in the same folder as index.exe and configured with the right base path (the folder where /data can be found).
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:Ok, if you see the text "main" is a good signal, that means that you are indeed executing index.exe, now make sure that sitelist.json is present in the same folder as index.exe and configured with the right base path (the folder where /data can be found).
Going to http://127.0.0.1/users/register.html I only saw 403 Forbidden. I followed your instructions so I have sitelist.json next to index.exe and it already points to the correct location.
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Even with tiny's cgitest doscgi.exe I got 403 Forbidden. I have no idea.
Post Reply