parser


CategoriesInstallation

How to install Parser on Apache?
To do this you should add to Apache configuration files .htaccess or httpd.conf (section <virtualhost>) these lines (it is assumed, that /cgi-bin referres to directory, configured in ScriptAlias in httpd.conf):

AddHandler parsed-html html
Action parsed-html /cgi-bin/parser3.cgi
Also one can Install Parser on Apache web-server as server module.

How to install Parser on IIS?
Start Management Console, click right mouse button on the name of your web-site and select “Properties”.
Go to “Home directory” sheet and in “Application settings” section click “Configuration...” button. In opened dialog box click “Add” button.
In “Executable” field type full name of CGI-script parser3.exe or ISAPI extension parser3isapi.dll.
In “Extension” field type “.html”.
Switch “Check that file exists” checkbox on.
Click “OK” button. Then in Web Site Properties dialog go to “Documents” sheet, and addindex.html to the list of files, used as index documents.
We also recommend you to remove handlers of those file name extensions which you do not use.

I did it all kinda right, but get “…safe mode…”, what’s up?
Binaries of CGI version of Parser for *nix in download section are compiled in SAFE MODE. Such Parser checks group and owner of a file before reading it, and reads only those files, group or owner of which are same as group or owner of the process in which Parser works.

This is done on purpose, so that in case of error in a script malicious users would not exploit it and get access to the files they never need any access, such as /etc/passwd.

It is sometimes the case when system administrator configured your web-server in such a way that group and user, on behalf of which CGI process works (Group and User directives in httpd.conf, for Apache) do not match niether group nor user to which belong files created by you.

In that case you would get the message “…safe mode…”
Possible steps:
Ask your system administrator to read this message, he/she would understand it.
If you feel like it, Compile Parser from source code and turn that option off.

On my *unix I get a message from Apache web-server “Internal Server Error”, what am I doing wrong?
Look into error log file of web-server, and also into suexec.log (if you have it), there you would find detailed description of what have happened.
Typicaly error “Premature end of script headers” means that you have forgotten to set the “executable” bit or have chosen the version of Parser which does not match your server operating system (ask system administrator what is it).
Also the reason could be that you uploaded to server an executable file NOT in binary mode. In that case size of uploaded file would differ from that of file on your local disk.
Another reason could be that you have a typo error in .htaccess file, log file record would countain detailed information on what’s wrong.
If you would see some other error in a log file, it’s text would suggest you how to fix it.

When I try to learn version of Parser by accessing parser3.cgi by HTTP I get standard browser error message while .html documents are handled by Parser successfully. What can be the reason and how to fix that?
We guess, that by “browser” you mean MSIE and you forgot that by default in this browser
[x] Friendly HTTP error messages
are displayed. This option tells browser, that when it gets HTTP response which size is less then 512 bytes it should not display that response, but rather browser’s own error message. Hence, this is fixed by turning this MSIE option off.

My browser displays Parser code, not its result. What's wrong (I am using Apache web-server)?
Parser is not assigned as a handler of your documents after all.
To test whether Parser itself works, type this in your browser's address line:
http://your_site/cgi-bin/parser3.cgi (or .exe, for Win32 version) You should see something like this:

Parser/3.x.x
If you can see it, that means Parser is uploaded where it should have been, and its rights are set correctly.

If you have uploaded parser correctly, and you have not forgotten to put directives specified in documentation to .htaccess, you may have forgotten to allow Apache to process .htaccess in httpd.conf file by directive AllowOverride (see Apache documentation). To check whether .htaccess is processed, put there some arbitrary wrong instruction, say «mytest», to the very beginning of it. If, after page reload you do NOT see 500 error (which must appear if you configured everything right), that means you have .htaccess file ignored. Change AllowOverride directive or turn to your administrator.

I’ve installed Parser, code like ^eval(2+2) works fine. Could I test whethere I’ve installed ALL right?
To test Parser, download from appropriate section a test document, unpack it to webspace of your site and open it in from your site in a browser.
This document tries to run several tests and reports results. You can see sample results here.