.flx script replacement

Discussion in 'Installation/Configuration' started by teves, Jan 15, 2007.

  1. teves

    teves Member

    Hello everyone,

    I really need your help!
    The problem in short: I need to migrate a MAC web server to a a root server I hired at hetzer.de. What I am speaking of is roughly 150 Domains.
    I have put Suse 10.1 perfect setup and ISPConfig on the new server.
    There is no problem with the migration itself, everything working fine, so far!

    The (old) MAC Server is running a server software called 4D Webstar. Within that software there is running a plugin called Flexmail. Flexmail supports files with .flx extension and is used to easily create web forms (eg. contact scripts).

    The problem is, that obviously many of the hosted domains use these flexmail scrips. I could easily write new ones in PHP, but the time I have is too short for that now. I need to get those .flx scripts running somehow for a while and program new ones later.

    I have already found something to acomplish that, I suppose. It is, as far as I understand it, a perl script that can execute flx scripts (and more). It is called Formication form processor and can be downloaded here: http://www.villainy.com/developers.html

    Thing is: It is badly documented, and I can't find any hints on the web.
    So my question is: does anybody have experience with that piece of software? Or is there anybody who can have a look into the download archive and tell me what to do?

    Thank you,
    regards, Tom
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Did you download and unpack that archive? Isn't there a README or INSTALL file in it?
     
  3. teves

    teves Member

    Hello,

    yes, I forgot to mention that. I have already tried to 'install' it, as far as you can call it installation.
    The package contains mainly four files (the rest are text and example files, but not enough text and examples ;-) ).

    The four files are:
    formication.pl - the perl script
    formication.c - a very short programme, it seems, (~8 lines), don't know if this is C
    formication.cgi - obviously a binary file
    .htaccess - this contains the added MIME type.

    It seems to be quite easy, but I can't get it running.
    I changed the paths in .htaccess to fit my needs and gave enough rights to the files, but it won't work.

    Thank you,
    regards, Tom
     
  4. mlz

    mlz New Member

    Did you place those four files in the /cgi-bin directory in your web site? Both Fornication.pl and fornication.cgi must be located in /cgi-bin to operate. Do you have suexec installed?

    Try using one of the example files and see if it produces the desired results.
     
  5. teves

    teves Member

    Hi,

    no I have whether suexec installed nor the files in /cgi-bin. :rolleyes:

    I will try this tomorrow, but: how do I install suexec, and what is suecex anyway?

    Thank you,
    Tom
     
  6. teves

    teves Member

    Hello,

    ok I know a bit more now. Suexec is for executing cgi scrips in a safe environment and is installed on my ispconfig server because it's a part of the perfect setup suse 10.1.
    I have enabled it in the ISPConfig Administration tab also. Then have copied the .pl and .cgi files to the cgi-bin directory but it doesn't work.

    I think the .htaccess file is not correct, but I don't know how it should look like. At the moment it looks like this:

    Action formication /formication.cgi
    AddHandler formication .fcn


    It is obvious that the /formication.cgi part of the first line must be the path to the cgi-bin directiory, but what is the correct path? From the root directory, a path to the folder would be /srv/www/webNN/cgi-bin, but as far as I know you must give the path relative to the web directory.
    The /formication.cgi would mean that the file is in the /srv/www/webNN/web directory, so the correct path to cgi-bin would be /../cgi-bin/
    But this is not allowed....

    Can someone help?

    thank you!
    regards, Tom
     
  7. falko

    falko Super Moderator ISPConfig Developer

    Have you tried
    Code:
    Action formication /cgi-bin/formication.cgi
    AddHandler formication .fcn
    ?
     
  8. teves

    teves Member

    Hi,

    yes I have tried that. With that code in .htaccess the script file (/web/kontakt.fcn) is offered as download.... :rolleyes:

    regards, tom
     
  9. falko

    falko Super Moderator ISPConfig Developer

    So formication.cgi seems to be called, but it seems it doesn't know what to do with .fcn files.
     
  10. teves

    teves Member

    Hi,

    I tested a few things, but now I got no idea left.

    Looking into the suexec.log everything seems to be all right. First I had a few complaints about the file permissions, but I have changed them and errors in the log are gone, but the problem is still the same.

    I installed the formication test script to see if it would run, but it also gets offered as download.

    The part of the Vhosts_ispconfig.conf for this web is the following:

    ######################################
    # Vhost: www.domainname.tld:80
    ######################################
    #
    #
    <VirtualHost IP:IP:IP:IP:80>
    SuexecUserGroup webNN_admin webNN
    ServerName www.domainname.tld:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/webNN/web
    ServerAlias domainname.tld
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias /cgi-bin/ /srv/www/webNN/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /srv/www/webNN/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    Alias /error/ "/srv/www/webNN/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /srv/www/webNN/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/webNN/user/$1/web/$3
    </VirtualHost>


    The .htaccess file in the /web directory contains the following lines:

    Action formication /cgi-bin/formication.cgi
    AddHandler formication .fcn


    The formication files lie in the cgi-bin directory and have 755 permissions and webNN_admin:webNN owner and group.

    Seems absolutely OK to me, but still the .FCN scripts are not executed but offered as download.
    So to me it seems to be an apache/ispconfig related problem.

    Can anybody help?

    Thank you!
    regards, Tom
     
  11. teves

    teves Member

    Hello,

    I have found a solution, so this problem is finally solved! :D

    Thank you all for your help!

    regards, Tom
     
  12. martinfst

    martinfst ISPConfig Developer ISPConfig Developer

    May we ask how you solved the problem? Might be beneficial for future readers of this thread.
     
  13. teves

    teves Member

    Hello,

    may I first tell you that I dislike this forum (from a technical point of view). When you type a posting and it takes you a time (quite a short time!) then you are automatically logged out, and if you wish to send your posting, you have to log in again. After doing so you get redirected to a non existing thread and your text is gone. If you are lucky, you can go back in your browser and copy the text. Today I was not that lucky! :mad:
    Can't this be changed, please? For it's a very good forum concerning the information you can get from it! :)

    OK I won't type my novel again, so I put it down in short:

    I tried to find out if cgi was working at all with a "Hello World" script from Falko I got from somewhere in the forum. It worked, so I knew the problem needed to be in formication itself.
    I installed it once again, this time by wget and not via ftp. I noticed that the setuid flag was set for formication.cgi, which had been different the last time. But this didn't change a thing, suexec gave out a warning in its log file that setuid was set.
    Then I wondered what formication.pl was for. I changed the .htaccess file from
    Action formication /cgi-bin/formication.cgi
    AddHandler formication .flx


    to

    Action formication /cgi-bin/formication.pl
    AddHandler formication .flx


    The effect was that the .flx now was shown as text and not offered as download. I took it for a good sign and searched the web a little more.
    Then I found out that the first line in a .pl script must contain the path to perl on the system (if you need to know more, search for 'shebang')
    I took the path from Falko's "Hello World" script and put it in.

    And then -unbelievable! - it worked.

    regards, Tom

    P.S.: Someone could have told me about the shebang thing; it took me bloody ages to find out ;) !
     
  14. falko

    falko Super Moderator ISPConfig Developer

    I've never had such a problem (and I use this forum quite often :D ).
    Which URL do you use for the forum (howtoforge.com / .net / .org ...)? Does your browser allow cookies?
     
  15. teves

    teves Member

    Hi Falko,

    while I'm typing this is the URL I see:

    http://www.howtoforge.com/forums/newreply.php?do=newreply&noquote=1&p=57771

    I'm using Firefox 2.0 and cookies are allowed. (The setting is: allow cookies, keep them until they're not valid anymore (free translation from German ;) )

    I should point out that it seems I only have the problem when I do not check "remember me" at the login (I often forget that... :rolleyes: ).
    But at any rate I should not be 'kicked out' already after typing for about 10 Minutes.
    It is also not a real problem, but an annoyance. Today it went really wrong for the first time....
    Don't take this too serious. I was really mad this morning, when my 6 Megabytes of text had disappeared..... ;)

    regards, Tom
     
  16. falko

    falko Super Moderator ISPConfig Developer

    I don't know after how many minutes it kicks you out. Have to check that. But I always use "Remember me", and vBulletin always knows me (but I'm on this site every day, I don't know when/if it forgets you if you don't visit the site for a couple of days - have to check that, too).
     

Share This Page