Welcome to the new Roxen & ChiliMoon FAQs. Our intention is to support and increase the Roxen & ChiliMoon community.
You can expect the following features sooner or later to appear at this site:
Help us to maintain these FAQs! Support the community with high quality documentation.
Documentation, mailing lists, etc.
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2005-12-15 by Michael Stenitzer
Subscribe
Sign up by mailing roxen-request@roxen.com. You can send to the list via roxen@roxen.com
Unsubscribe
If you want to unsubscribe the list, just send a mail to roxen-request@roxen.com with subject 'unsubscribe'
Alternative read-only access to the mailing lists
Applies to: Roxen ,
Posted at 2004-11-29 by Michael Stenitzer, Last updated at 2004-11-30 by Michael Stenitzer
There are three mailinglists available for ChiliMoon:
chilimoon-announce
On this list announcement are made for changes in the ChiliMoon project. A chilimoon user should at least be a member of this list.
chilimoon-users
This list is to discuss every day problems when using the ChiliMoon Webserver. Users are also invited to discuss RXML.
chilimoon-dev
On this list the discussion of future development of the ChiliMoon Webserver takes place.
The chilimoon-dev list is also available on lyskom, subscribe to ChiliMoon (-) Mooh, Mooh at the kom.lysator.liu.se lyskom server.
Applies to: ChiliMoon
Posted at 2004-12-01 by Marc Dirix
No there isn't. ChiliMoon is only based on the Roxen Webserver parts.
Code-parts needed by Roxen CMS are kept as is, making it possible, however currently not supported, to run Roxen CMS ontop of ChiliMoon.
Applies to: ChiliMoon
Posted at 2004-12-06 by Michael Stenitzer
ChiliMoon is what we like to call a "next generation" internet server[1]. ChiliMoon is a fork of the Roxen Webserver which is a very extensible internet server built completly in the Pike programming language. ChiliMoon will be based on Roxen 4.0.
Currently [Dec 04] a couple of people are preparing a public announcement and a first release of ChiliMoon.
Note [1]: It is important to distinguish between a webserver and an internetserver. Internet is much more than just the world wide web.
Applies to: ChiliMoon
Installing Pike, Roxen & ChiliMoon on different platforms
Posted at 2004-11-16 by Sascha Nemecek
No, but you might need to restart Roxen with --remove-dumped.
When you are already running a custom Roxen-Pike setup, do not forget to update all symlinks, so that they pointing to the new Pike installation (e.g. /roxen/server-4.0.172/bin/roxen).
Applies to: Roxen , ChiliMoon
Posted at 2004-11-21 by Michael Stenitzer
You have to fill out the registration form at download.roxen.com.
The license agreement says that you are allowed to install one "Web Site", but the intention is only to limit the number of CMS sites. The restrictions built in to the product only applies to CMS modules and there is nothing to stop you from fully taking advantage of the WebServer parts.
Applies to: Roxen ,
Posted at 2004-11-21 by Michael Stenitzer, Last updated at 2004-11-30 by IzNoGooD
cd /usr/local/roxen/server/mysql
mkdir libexec
mkdir share
ln -s /usr/local/libexec/mysqld libexec
ln -s /usr/local/share/mysql share
Adjust the paths in the last two lines with paths to match wherever MySQL is installed on your system. ChiliMoon supplies a script in the mysql directory to do this job for you.
Note: be aware that you might be restricted to certain MySQL versions. (see according FAQ)
Applies to: Roxen ,
Posted at 2004-11-21 by Michael Stenitzer, Last updated at 2005-01-09 by Michael Stenitzer
The problem is due to Redhat’s new thread library.
Workaround: Add the following lines to ../local/environment:
LD_ASSUME_KERNEL=2.4.1
export LD_ASSUME_KERNEL
See Bug3492
Applies to: Roxen (3.3) ,
Posted at 2004-11-21 by Michael Stenitzer
You find an error message in the debug log:
Failed to start MySQL. Aborting
If you copied your configurations directory from an older Roxen, delete the file <roxenhome>/configurations/_mysql/my.cnf so that 4.0 can recreate it with correct options. It's probably missing a
user = root
line.
Note: If you run the Roxen process with another UID/GID you can also use this UID/GID for the MySQL process (don't forget to chown/chgrp the mysql-files to the UID/GID before starting Roxen with this combination).
Applies to: Roxen (4.0) ,
Posted at 2004-11-22 by Michael Stenitzer
They are just normal TAR files. You might want to rename them to have a glance into the containing files.
Applies to: Roxen ,
Posted at 2004-11-27 by Michael Stenitzer, Last updated at 2004-12-05 by Michael Stenitzer
If you choose the binary installation files all libraries are compiled in. You just need your native database libraries to run Roxen / ChiliMoon with a different database than MySQL.
If you want to install the source package or build your own Pike, you have to be sure to install the necessary libraries in advance:
GMP and Nettle are both bundled with Pike source distributions and are built during the Pike build process if you don't have a local installation.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-30 by IzNoGooD
Anonymous access to the CVS should be possible through:
cvs -d :pserver:anonymous@cvs.lysator.liu.se:/cvsroot/ChiliMoon login
cvs -d :pserver:anonymous@cvs.lysator.liu.se:/cvsroot/ChiliMoon co ChiliMoon/2004
Applies to: ChiliMoon
Posted at 2004-12-02 by Marc Dirix
There are no real issues to be taken care of when migrating from Roxen 4.0 to ChiliMoon at the moment.
One should however keep in mind that all compatibility layers for older Roxen versions have been stripped. So if you use them, please reconsider first updating your RXML code.
Applies to: ChiliMoon
Status: Answer to be confirmed
Maybe it is worth mentioning that the scope "roxen" has been changed to "server".
Roxen and ChiliMoon are written in Pike
Posted at 2004-11-16 by Sascha Nemecek, Last updated at 2004-12-05 by Sascha Nemecek
The official download place is pike.ida.liu.se/download/
A well maintained mirror is:
Be aware that daily builds are usally not as stable as official releases and not recommend for production environment.
Fresh Pike source snapshots are provided by Xenofarm at IDA:
You can get the latest cvs version from roxens' cvs:
cvs -z3 -d :pserver:anon@cvs.roxen.com:/cvs logincvs -z3 -d :pserver:anon@cvs.roxen.com:/cvs co Pike/7.7
Applies to: Roxen , ChiliMoon
Posted at 2004-11-16 by Sascha Nemecek, Last updated at 2004-12-05 by Sascha Nemecek
It is not necessary to place the whole Pike installation in your Roxen's server location. Simply symlink roxen/server/bin/roxen to your Pike binary, e.g.:
ln -s /usr/local/pike/7.6.15/bin/pike /usr/local/roxen/server-4.0.158/bin/roxen
Be aware that Roxen's different versions are usually restricted to certain Pike versions.
You can also select a pike to use by setting the environment variable *PIKE*:
$ PIKE=/usr/local/bin/pike
$ export PIKE
$ ./start
If you have multiple server versions inside a single roxen directory, you can also place a pike symlink in <roxenhome>/local/bin instead of <roxenhome>/<serverversion>/bin
Applies to: Roxen ,
Posted at 2004-11-21 by Michael Stenitzer
Chilimoon 2004
Roxen 2.0
Roxen 2.1
Roxen 2.2
Roxen 3.3
Roxen 3.4 [see Note 1]
Roxen 4.0
[Note 1] there has been no official release of WebServer 3.4, it was only available as Roxen CMS Personal Edition or as WebServer from CVS
[Note 2] supported only in Pike 7.4 compatibility mode
Applies to: Roxen , ChiliMoon
Posted at 2004-11-21 by Michael Stenitzer, Last updated at 2004-12-05 by Sascha Nemecek
When building pike straight from CVS : A common reason is, that you must have a (old) pike binary in the path when you build pike since some of the source files are generated by pike programs.
Compiling from a source dist (such as provided by Xenofarm) is supported without having a prior installed pike.
Applies to: Roxen , ChiliMoon
Posted at 2005-08-07 by Bill Welliver
The GotPike.org website has an assortment of Pike related content, including a Pike mailing list search engine, and the Pike Module Repository.
Applies to: Roxen , ChiliMoon
Manage your Roxen and ChiliMoon server
Posted at 2004-11-15 by Michael Stenitzer
If you have recently changed a nameserver setting for your domain it might fail to bind because its being cached by Roxen’s own DNS cache.
Flush the caches in the Tasks -> Maintenance tab.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
Delete the files under roxen/var/demomodule-bookmarks/<your site>/.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
Go to Tasks -> Maintenance -> Create site template
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
If you use relative paths in Roxen’s / ChiliMoon's configuration they always refer to the start directory (e.g. /usr/local/roxen/server/).
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
Don't worry if you find a regular error message “Update: Failed to connect to update server to fetch information about new packages” in event log. The update server has been out of work for a long time. It’s working again with Roxen 4.0 (well, at least it does not show any error messages, at the other hand i haven't recieved any update package so far).
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
You just have to move the current log, wait a couple of minutes, and then Roxen will start a new one at the old location on its own.
Additionally you may want to install a cron job to compress or remove old log files, e.g.:
find /usr/local/roxen/logs/ -name 'Log.????-??-??' -mtime +7 \
-exec gzip {} \;
find /usr/local/roxen/logs/ -name 'Log.????-??-??.gz' -mtime +30 \
-exec rm {} \;
This will gzip files after a week and remove them after a month.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
Run
create_configinterface -a
to create a new create a new administrator user with which you can change the password of the old one.
You can get more options of for creating a configuration interface (e.g. how to create with a batch process) by running
create_configinterface --help
You can get the address or port either by having a look at the configuration file for the administration interface (search for <var name='URLs'> by default in the file /configurations/Administration_Interface) or have a look into the debug log (logs/debug/default.1).
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
By default Roxen / ChiliMoon writes encoded user-agent identification strings (spaces are replaced by %20) to the log files. You have several solutions to solve this:
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer, Last updated at 2004-12-05 by Sascha Nemecek
Error message: "Binding the port failed on <IP> for <url>."
If Roxen / ChiliMoon says it can’t register the port, it most likely failed to bind it. Reasons might be:
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
You can not run two https servers on the same IP and the same port. IP and port must together form an unique pair. If you have several virtual https servers, they need either different IPs or different port numbers. This is a restriction of the https protocol.
Applies to: Roxen , ChiliMoon
Posted at 2017-05-16 by Paulo Amaral
To turn off messages like this:
RXML parse error: Error in expr attribute: syntax error, unexpected '*'
| <set expr=" * 20" variable="var.thuows">
| <cache minutes="30" variable="form.zopc">
| <trimlines>
| <cache enable-protocol-cache="yes">
1. Go to the admin site (not /edit);
2. Find the module "Tags -> RXML parser" in the modules tree on the left;
3. Open the tab "RXML Errors";
4. Set "Quiet RXML parse errors" and "Quiet RXML run errors" to "Yes".
To force errors to be displayed regardless the configuration above, add <debug on> to the page code.
Applies to: Roxen ,
Posted at 2004-11-16 by Sascha Nemecek
Unfortunately, no! You'll have to use the normal <if><else> structure instead.
Applies to: Roxen ,
Posted at 2004-11-17 by Michael Stenitzer
Use the demo module, but be careful to restrict access through the security tab.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
Using RXML always causes a lot of spaces and newlines to be added to the code. You can try to put thing that does not have to generate output in a <nooutput>-container. Another way to go is to add the whitespace remover module, which will remove superfluously whitespace, but in doing so you add an additional parsing overhead.
Applies to: Roxen , ChiliMoon
You can also use <nooutput>/ in the context of defines, where it is important to add no additional whitespace. Here is a simple example:
<define tag="example" trimwhites="trimwhites">
<attrib name="attribute1">1</attrib>
<attrib name="attribute2">somevalue</attrib>
<nooutput>
<do-something />
<emit host="&var.myhost;" source="sql" query="&var.query;"><set variable="example.output" from="sql.value" /></emit>
</nooutput>&example.output:none;
</define>
Please consider that this technique requires the trimwhites attribute to be set!
The problem with <nooutput /> was always that the containers have to be well formed - which leads in real life to restrictions soon.
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-12-05 by Sascha Nemecek
For Roxen:
Check the compatibility level of your site's settings tab. After an server update it will be set to your old server's level.
For Chilimoon:
ChiliMoon aims to be compatible with RXML 2.0, all other compatibilty layers are removed. If your page contains older RXML-code please update the code even if it still works, it might not work with future versions.
If you think the RXML 2.0 parser is not behaving the way it should, then post a message at the ChiliMoon developers mailinglist (chilimoon-dev.)
Applies to: Roxen , ChiliMoon
Status: Answer to be confirmed
Posted at 2004-11-17 by Michael Stenitzer
<maketag>/ is your friend.
<maketag type=container name=comment>&var.anything;</maketag>
or
<maketag type=container name=cdata>&var.anything;</maketag>
Applies to: Roxen , ChiliMoon
To dynamically generate <!-- HTML comments --> using variables, use < and > inside <eval/>:
<eval><!-- &var.comment_contents; --></eval>
Posted at 2004-11-17 by Michael Stenitzer
If you want to redefine an HTML tag with RXML's <define>/ you might end up in an infinite loop by parsing the redefined tag again and again. Use the <?noparse ?> processing instruction around the redefined HTML tag in your definition.
Example:
<define container=”h2”>
<?noparse <h2?> &_.args:none;>Header</h2>
</define>
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2006-01-07 by Marc Dirix
The new implementation in Roxen and Chilimoon is to use <append type="array">:
<set variable="var.array" value="value1" />
<append variable="var.array" value="value2" />
<append variable="var.array" value="value3" />
Output either by:
<emit source="values" variable="var.array" >
&_.value; &_.index;
</emit>
Or where n is the index of the value (e.g. 1,2,3...):
&var.array.n;
--
Currently this is only possible in a very restriced way. Use <set> in combination with the split attribute. E.g.:
<set variable="var.array" value="name1::value1;name2::value2;name3::value3" />
<emit source="values" scope="outer" variable="var.array" split=";">
<emit source="values" scope="inner" variable="outer.value" split="::">
<cond>
<case variable="inner.counter == 1">
<set variable="var.name" from="inner.value" />
</case>
<case variable="inner.counter == 2">
<set variable="var.value" from="inner.value" />
</case>
</cond>
</emit>
<p>Name: &var.name;<br />
Value: &var.value;</p>
</emit>
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-11-30 by IzNoGooD
Some tags don't take input between open and close tag. They have to be terminated at the end of the opening tag: <tag />.
For example sqltable which takes a query as argument not between open and close tag: <sqltable query="select names from group where age=10" />
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
Use <delimiter>/ which adds the content of this container to every processed row except the last one.
<set variable="var.test" value="this,that,other"/>
<emit source="values" values="&var.test;" split=",">
team LIKE '&_.value;' <delimiter>OR</delimiter>
</emit>
Result:
team LIKE 'this' OR team LIKE 'that' OR team LIKE 'other'
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
You explicitly have to allow <insert#href/> in the admin-interface in the additional rxml-tags' module. Note that the thread will be blocked while it fetches the web page.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
If you are setting an attribute with a value not available at the time a <define>/ is parsed, you might end up in an empty attribute.
Example:
<define container="c">
<attrib name="headline">&var.name;</attrib>
The problem is, that the <attrib>/ containers being parsed at definition time (together with define, as they are actually belonging to define). At that time your variable var.name has no value assigned.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
Use
<emit></emit>
<else>No rows returned</else>
See also documentation for <emit></emit>.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
The intention of the concept <eval><insert file="file" /></eval> is to insert a file into another one and parse it (<eval>/) after insertion. Therefore it is important NOT to use extensions which will be parsed by the RXML parser (like rxml, html, xml etc., set in the rxml-parser module interface) at the stage of insertion.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
<expire-time now="now"/>
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
Be careful that header names in http are case sensitive.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
<tag &var.test; /> is not allowed according to XML specifications and does not work in Roxen. Variables (entity references) are only recognized in normal text and in argument values.
You can achieve this by using a "splice" argument:
<tag ::="&var.test;" />
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
You have to use <maketag>/
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
Roxen parses the arguments to all tags, but only for entity references and not other tags (which would encourage invalid XML).
<set variable="var.tmp"><tag/></set> (verify)
<form action="&var.tmp;">...</form>
You can also build your tag (<form> in the example above) by using <maketag>/
Applies to: Roxen , ChiliMoon
Posted at 2007-01-24 by Michael Stenitzer
The reason is that the server does not know about the encoding in a form because this information is usually not sent by the browser. This is also the reason why <vform> might fail verification for an input-length.
Use <roxen-automatic-charset-variable/> in the form, so Roxen will know about your encoding. See the Roxen manual page for further information.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-16 by Sascha Nemecek, Last updated at 2004-11-22 by Michael Stenitzer
If one wants to specify a variable reference in the content that should not be expanded right away, it is possible to use the special syntax with a ":" first, e.g. "&:foo.bar;". Every parse step just removes one colon at the front and leaves the rest.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2007-01-26 by Michael Stenitzer
<if sizeof="var.test = 0">empty or not set</if>
<if match="&var.test; = ">empty or not set</if>
<if variable="var.test = ">empty, but set</if>
<if variable="var.test = ?*">the variable contains 1 or more characters</if>
<if sizeof="var.test">variable set (might be empty)</if>
<if sizeof="var.test > 0">the variable contains 1 or more characters</if>
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-11-22 by Michael Stenitzer
<define></define>, unlike most RXML tags, does not preparse its content while <set></set> does. Use either the preparse="preparse" attribute to parse it immediately or use <eval>/ to parse it at the time of inserting the variable.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-11-22 by Michael Stenitzer
It is depreciated. Use <set></set>. But <cset>/ also has an advantage to <set>/: it does not need type conversion. see Bug 3553 community.roxen.com/crunch/show_bug.cgi?id=3553 .
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-11-22 by Michael Stenitzer
Escape the dot in the variable name with a second dot.
Example:
scope: form, variable: test.1
&form.test..1;
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-12-07 by Sascha Nemecek
Only the scope "var" and "form" are always available. If you temporarily want to add an additional scope, you can do this by using the <scope>/ container.
If you have problems with the extend attribute, you should have a look at roxens bug crunch and check if you are using a recent rxmltags.pike (>1.471). See: https://community.roxen.com/crunch/show_bug.cgi?id=3831.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-11-22 by Michael Stenitzer
The values are split by NULL characters.
form.ID=v1\0v2\0v3\0v4
Use <emit#value> to retrieve all single values
<emit source="values" value="&form.ID;">
&_.value; <br />
</emit>
You can also use &form.ID.1;, if you know what index your value has.
Applies to: Roxen (2.1+) , ChiliMoon
In my experience only:
<emit source="values" variable="form.ID"> &_.value; </emit>
works in ChiliMoon, haven't tried it against Roxen yet.
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2007-01-26 by Michael Stenitzer
<set variable="var.1" value="1" />
<set variable="var.test1" value="finally!" />
&var.test&var.1;; <!-- does not work! -->
Solution 1:
<eval>&var.test&var.1;;</eval>
Solution 2:
<insert variable="var.test&var.1;" />
Solution 3:
<if variable="var.test&var.1;">
<!-- Checking if the variable exists first since next variable assignment generates run error -->
<set variable="var.tmp" from="var.test&var.1;"/>
&var.tmp;
</if>
Applies to: Roxen , ChiliMoon
If you can do this backwards eg, create a variable seperated by \0, doesn't that leave us with an indexable array? However,
<set variable="var.ID" value="V1\0V2\0V3" />
does not seem to work.
Posted at 2004-11-22 by Michael Stenitzer
Possible error messages are:
RXML parse error: Cannot append another value ... to non-sequential type any.
or
RXML parse error: Unknown tag ... is not allowed in context of type any.
This is due to the fact that <set>/ and <append>/ needs type conversion if the content is not a string but of type "text/html". The type conversion attribute in <set> is undocumented.
Example:
<set variable="var.test" type="text/html">this is a <a href="#">link</a></set>
Applies to: Roxen , ChiliMoon
This error also happens when using RXML tags and variables inside <set>...</set> (without the value="..." parameter).
In this case you must set the variable type as *text/plain*:
<set variable="var.myquery" type="text/plain">
SELECT `column1`,
`column2`,
`column3`
FROM `mytable`
WHERE `ispublished`=<if variable="form.state=published">1</if><else>0</else>
AND `username`='&fom.namesearch:mysql;'
</set>
Differences between different versions
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2004-12-02 by Marc Dirix
For Roxen:
Move the configuration file to the correct path in the file system (e.g. /usr/local/roxen/configuration/). Be aware that the compatibility level is automatically set to your old server's version, what can bring up quite annoying and hard to find errors. Set the compatibility level in the site's settings tab.
For ChiliMoon:
ChiliMoons' installation script will automatically detect a previous configuration file and will not overwrite it with a new one. Once the server is restarted setting will be as with a previous version. No compatability layer is activated because there aren't any.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-22 by Michael Stenitzer
The passed contents of a defined container is RXML evaluated at the first encountered <contents/>. The result of this will be reused for each succeeding <contents/> within the same definition.
Applies to: Roxen (changed after 2.2) ,
Posted at 2004-12-02 by Marc Dirix, Last updated at 2004-12-06 by Michael Stenitzer
ChiliMoon
Unfortunately not at the moment. It should not be hard to convert the current caudium parser into a working ChiliMoon module. Just keep in mind not to make large changes in the ChiliMoon core.
Roxen > 2.0
There is a compatibility module available, although it is not recommended to be used. There are many reasons to move on to RXML 2.
Applies to: Roxen , ChiliMoon
Connecting to different database servers, advanced ways to query your database
Posted at 2004-11-15 by Michael Stenitzer, Last updated at 2004-11-29 by Marcus Agehall
Roxen and ChiliMoon stores some stuff in its local database:
Argument cache, cimg cache, precompiled security patterns (eg htaccess), gbutton cache, gtext cache, roxen module list, precompiled pike files, session cache, update information, etc...
Most of which is information that is easily reconstructed, or doesn't matter much if it gets lost. Therefore this data does not have to be backuped.
One important point here is that the <accessed/> tag may store information in the database. If the database gets zapped, your accesscounters may get zapped as well. This may be bad, so to make sure that you don't suffer any data loss, please back up the internal mysql-files as well.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer, Last updated at 2005-02-14 by
No you can't. Developers have chosen MySQL for many reasons, not the least of them MySQL being the fastest in the way it is used (for caching purposes eg.) It is not recommended to use the internal database for your own project, because there are no backups made of the database.
You are not forced to use MySQL for your own data, it just uses it for its own purposes. You are free to use whatever database server you want for your own data.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer, Last updated at 2005-12-02 by Sascha Nemecek
Yes. "Create new database" in the administration interface's DBs tab. Choose type "external" and insert an Url in the form of
Unix: mysql://user:password@:/path/to/mysql/socket/db-name
Win: mysql://user:password@:C_/path/to/configurations/_mysql/pipe
Roxen uses socket when connection is made to mysql://localhost/db and if the operating system permit it.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-20 by Michael Stenitzer, Last updated at 2004-12-05 by Michael Stenitzer
You can access the the internal databases from the command-line MySQLl program if you have read/write access to the mysql socket file (which is located in the "_mysql/" sub-directory of the configuration directory usally accessed as "../configurations" relative to the server directory).
Start the MySQL command-line client like this:
mysql --socket=/usr/local/roxen/configurations/_mysql/socket -u rw
An alternative is to connect via TCP-IP. Connect to the MySQL server via socket file. Create an user with the rights for external access (see MySQL manual) and change the bind addresse in /usr/local/roxen/configurations/_mysql/my.cfg to
bind-address = 192.168.0.13 # (or whatever your IP is).
port=3307 # optionally, if you want to change from the standard port 3306
Another option to change the bind address and port is to set the environmental variables in roxen's startup-script
export MYSQL_HOST=192.168.0.13 # (optionally, default 127.0.0.1)
export ROXEN_MYSQL_TCP_PORT=3306
Applies to: Roxen , ChiliMoon
Posted at 2004-11-20 by Michael Stenitzer
The cleanest way is to set up your database links inside the administration interface, so you don't have to embed any database names or passwords in the script itself:
<?pike
object sq=DBManager.get("mydb");
array result=sq->query("select id, name, address from mytable");
write("%d records:<br>\n", sizeof(result));
foreach (result, mapping row)
{
write("ID: %s<br>Name:%s<br>Address:%s<br><br>\n",
row->id, row->name, row->address);
}
?>
Applies to: Roxen , ChiliMoon
Posted at 2004-11-20 by Michael Stenitzer, Last updated at 2004-12-02 by Michael Stenitzer
Roxen older than 4.0 shipped with MySQL 3.23 but should also work with MySQL 4.0 (but not later). You have to be careful to compile Pike earlier than 7.4 using MySQL 3.23 client libraries - they connect just fine to a MySQL >=4.0 server. Roxen 4.0 ships with MySQL 4.0. Pike 7.4 and later compiles with MySQL 4.0 / 4.1 client libraries.
ChiliMoon has the same requirements for MySQL version as Pike CVS does. Which means MySQL >=4.0 server for now.
Applies to: Roxen , ChiliMoon
Status: Answer to be confirmed
If you receive the following message:
Couldn't reconnect to SQL-server Client does not support authentication protocol requested by server; consider upgrading MySQL client
You must either update your Pike version to support the MySQL 4.1 authentication or tell mysql to use the old password authentication: mysqld --old-passwords
When trying to access a MySQL Server >= 4.1 using newer user account, you have to recreate the passwords with MySQL's OLD_PASSWORD() function.
mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
At least under Windows, Roxen seems to have problems with UTF8 character encoding. Try disabling it in my.ini as a quick workaround:
# default-character-set=utf8
Posted at 2004-11-20 by Michael Stenitzer
Applies to: Roxen , ChiliMoon
Posted at 2004-11-20 by Michael Stenitzer
Applies to: Roxen , ChiliMoon
Posted at 2004-11-21 by Michael Stenitzer
Internally the column variables are "UNDEFINED" if the value in the row is NULL. Undefined variables in RXML tested with <if variable="sql.col">/ will return false for a NULL value in the row's column "col", and true for an empty string in this column. Inserting an undefined variable in RXML will give an empty string as result.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-21 by Michael Stenitzer
In your main page write
<img src="getimage?id=12332" />
The getimage.html page that looks like
<header name="Content-Type" value="image/jpeg" /><emit source="sql" query="select * from binfiles where id=&form.id"><img src="&sql.binary;"/></emit>
Important note: write this in one line so you don't add any extra linefeeds to the output image.
Alternative option:
<emit source='sql' query='select imagedata from images where id=37'>
<cimg data='&sql.imagedata:none;'/>
</emit>
This solution is worse from a scalability viewpoint, since using the cimg tag produces a copy of the image in the image cache
Applies to: Roxen , ChiliMoon
Posted at 2004-11-27 by Michael Stenitzer
If you install Roxen / ChiliMoon from source you have to ensure to have your native database client libraries installed (and Pike can find them) before you compile Pike.
To verify if your database drivers are available in your Pike, use the Pike module list task in the Roxen / ChiliMoon Administration interface: tasks -> debug_information -> features show the available Pike modules. To get new modules included, you have to install your database client libraries first and either reinstall Roxen or recompile Pike.
On linux you can directly test if your database libraries are available (example checks for Oracle):
ldd /<roxen-home>/pike/lib/pike/modules/___Oracle.so
If you are using other OS then you have to use truss(1) or some equivalent command and try to connect to the oracle from hilfe:
# cd /<roxen-home>/server/bin
# truss ./roxen
Pike v7.0 release xyz running Hilfe a.b (Incremental Pike Frontend)
object db=Sql.sql("oracle:///<sid>");
Native database drivers are supported for Oracle, Sybase, Msql, Postgres, Informix. Others can be used with an ODBC driver.
Applies to: Roxen , ChiliMoon
If you want to use a oracle database within your network and you are using roxen on a windows OS you have to specifiy a DSN in the ODBC settings.
Then Roxen pulls this from the Registry.
Then define the DB in roxen with the DSN name. To keep it clear DON'T give the DSN the same name as the database.
odbc://username:pass@<dnsname>/database so like this:
odbc://my:pass@my_database/product_db
this works for me.
FYI
When using Oracle as DB i noticed the connect string should end with /
oracle://user:pass@//host[:port]/SID/
that should be the connect string.
when omitting the last / one gets:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
Posted at 2004-11-30 by IzNoGooD, Last updated at 2004-12-05 by Michael Stenitzer
It is possible, however it is not recommended in a production server. Always keep in mind that there might be no backups made of the internal database.
Applies to: Roxen , ChiliMoon
Posted at 2005-05-02 by Sascha Nemecek, Last updated at 2005-07-21 by Sascha Nemecek
if you have access to the startup scripts of the Roxen server, simply set and export the following environment variables
export ORA_NLS33=/usr/local/oracle/app/oracle/product/8.1.7/ocommon/nls/admin/data
export LNG=american_america.WE8ISO8859P1
or add them to the local/environment.
Applies to: Roxen (4.0) , ChiliMoon
Posted at 2006-02-23 by Marc Dirix, Last updated at 2006-02-24 by Sascha Nemecek
You can use <else>/ directly behind <emit>/ and <sqlquery>/. With <sqlquery>/ the statements between the <else>/ tags are executed when the query fails. Furthermore you can use <then>/ when the query succeeds.
<sqlquery query="foo" />
<then>
Success handling code.
</then>
<else>
Error handling code.
</else>
With <emit>/ the statements between the <else> tags are executed when the query returns no result whereas the contents of the <then>/ container are executed after the last returned result.
<emit source="sql" query="foo" />
Code for the queryresult.
</emit>
<then>
Success handling code.
</then>
<else>
Sorry, no results.
</else>
Note that the <else>/ tag will not suppress SQL error messages.
Applies to: Roxen , ChiliMoon
How to secure your websites with Roxen and ChiliMoon
Posted at 2004-11-21 by Michael Stenitzer
Load the password module and one of the modules to provide a user database (SQL User Database, System User Database etc.).
<if not="not" user=”NAME” group=”GROUP”> <!-- you can use user and/or group -->
<auth-required />
failed login
</if>
<else>
logged in
</else>
Other options are:
Applies to: Roxen , ChiliMoon
also u can check out my "AW_easy Protect" module: bunnyhero.de/RXML/view.html/roxen/modules/AW_EasyProtect.pike
Link seems to outdated, could you please repost a current one
Posted at 2004-11-21 by Michael Stenitzer
Sometimes (e.g. when you use some gtext in a password protected part of the website), you will be asked a second time for the password:
If your gtext module and protected filesystem have the same authentication realms (you can set auth realm in gtext security tab without specifying any specific restrictions), then you won't be asked for a password a second time.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-21 by Michael Stenitzer
If you have a chained certificate, simply list the certificate files comma-separated in the "SSL certificate file" field.
Note: If you have Roxen older than 3.3.69 the spaces around the commas aren't ignored. Bug 2722 community.roxen.com/crunch/show_bug.cgi?id=2722
Applies to: Roxen , ChiliMoon
In Roxen 3.4 and later, the certificate chain is specified by adding multiple rows.
Posted at 2004-11-22 by Michael Stenitzer
If you're using .htaccess or security patterns, you can start the server with -DHTACCESS_DEBUG and/or -DSECURITY_PATTERN_DEBUG to get authentication debug traces in the debug log.
Currently there is no debug mode for the userdb_sql module
Applies to: Roxen , ChiliMoon
Posted at 2005-09-27 by Michael Stenitzer
To remove a cookie in all browsers (IE, Firefox, Opera) which has been set by the the HTTP Cookie Authentication Module use <remove-cookie/> without the domain attribute:
<remove-cookie name="_roxen_cookie_auth" path="/" />
Applies to: Roxen , ChiliMoon
Using scripting languages with Roxen and ChiliMoon (Inline Pike, Java, Perl, PHP, CGI etc.)
Posted at 2004-11-14 by Michael Stenitzer, Last updated at 2005-05-21 by Sascha Nemecek
Run PHP as CGI (Roxen and ChiliMoon)
/(.*)\.php(.*)$ /cgi-bin/php/$1.php$2
Note: This is for php files ending in ".php".
Note2: Remember to set the correct values in php.ini to work with a PHP binary safely (see www.php.net/ )
Note3: For M$ windows users the redirect patern should be:
/(.*)\.php(.*)$ /cgi-bin/php.exe/$1.php$2
Use the PHP scripting support module (ChiliMoon) UNVERIFIED
Note: according to some unverified information this solution is not working with threads.
Use Scripting: PHP Support. This module allows ChiliMoon/Caudium users to run PHP scripts, optionally in combination with RXML.
Applies to: Roxen , ChiliMoon
Status: Answer to be confirmed
Posted at 2004-11-14 by Michael Stenitzer, Last updated at 2004-12-09 by Michael Stenitzer
Variables are available within your script just like in RXML but written in the form scope.variable instead of the entity style &form.scope; .
<set variable="var.test" value="test" />
<?pike
write("<h2>"+var.test+"</h2>");
var.test = "prost";
?>
<h2>&var.test;</h2>
See the documentation docs.roxen.com for further parsing information.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-14 by Michael Stenitzer
The <pike>/ container is depreciated, but still available in the way it was in Roxen 2.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-14 by Michael Stenitzer
To avoid memory leaks in Perl, the Perl support in Roxen runs under the pragma "use strict" which requires variables to be declared.
Note: The memory leaks aren't permanent, since the subprocesses get restarted now and then.
Applies to: Roxen , ChiliMoon
Status: Answer to be confirmed
Posted at 2004-11-14 by Michael Stenitzer
Example how to read and write RXML variables:
<perl>
my $variable = '&var.test;';
print $variable ;
print '<set variable="var.test" value="asdasd" />';
</perl>
If you use the processing instruction <?perl ... ?> instead, RXML variable are not available since it doesn't RXML-parse its content. Therefore you don't need quoting (unless you want "?>" inside a string in your Perl code).
You can not access something like id->variables from within a <perl>/ container as the Perl tag is evaluated in a separate subprocess that has no access to the RequestID object. (to be confirmed)
The form variables are available in the internal hash %Roxen::Request::req_vars. There is a function $r->get_http_variables that returns this hash. (to be confirmed)
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer, Last updated at 2004-12-09 by Michael Stenitzer
Error: Process.create_process(): Access denied.
_builtin.create_process:create(({" … "}),mapping[11])
_builtin: create_process() modules/scripting/cgi.pike (version 2.36):748: run()
...
An error like this is usually based on wrong owner settings of the CGI script. Check if the CGI script is executable for the user running the script.
Applies to: Roxen , ChiliMoon
Extend and debug your Roxen and ChiliMoon webserver
Posted at 2004-11-15 by Michael Stenitzer, Last updated at 2004-11-21 by Michael Stenitzer
There are as usual several ways to get your debug and error messages:
You can controll the logging and visibilty of error information on your web page by several settings:
Note: The debug logs (including backtraces of internal errors and - if set so in the configuration - RXML errors) are rotated in ../logs/debug/default.1 - ../logs/debug/default.5. So after one restart you’ll find debug information from the last run in ../logs/debug/default.2.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer, Last updated at 2004-11-21 by Michael Stenitzer
You can start Roxen with the flags -DPC_DEBUG and -DSBNOTIFY_DEBUG to get more information in the debug log about what the persistent cache and notification systems are doing.
You can also find some general cache information in the admin interface’s Tasks -> Status -> Cache status tab.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
There is some documentation cluttered all over the place:
Applies to: Roxen , ChiliMoon
Dear anybody who helps me I am just started working with linux,and installed debian3.1 with 2.6.8.2kernel with Roxen4.0.325 (apt-get install roxen4). I try to compile with source php4.4.2 module (configure –with-roxen=/usr/share/roxen4 –enable-roxen –zts make make-install).Everything makes without errors my questions: Where can I find php module files and how can I add module to Roxen?
Posted at 2004-11-17 by Michael Stenitzer
This is the way to acces variables in the "form" scope:
id->variables->var1
All other scopes, especially the "var" scope, must be accessed through
RXML.get_context()->user_get_var("scope.myvar");
RXML.get_context()->user_set_var("scope.myvar","value");
or
RXML.get_context()->user_get_var("myvar", "scope");
RXML.get_context()->user_set_var("var","value", "scope");
Note: You can also use this method in inline Pike, although it is easier to use the form scope.context in the Pike processing instruchtion <?pike ?> (see Roxen Scripting FAQs)
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
Reload your module (in the module's status tab) in the administration interface or flush the cache (Tasks-> Maintenance-> Flush chaches).
Applies to: Roxen , ChiliMoon
A module can also be reloaded in the modules status page inside a virtual server's configuration. By doing this a module will only be reloaded inside the selected virtual server making it possible to debug changes to the module withouth breaking it in other vritual servers.
Posted at 2004-11-17 by Michael Stenitzer
For Roxen: Use Crunch, a kind of bugzilla at community.roxen.com/crunch/ . You have to register at Roxen Community community.roxen.com/register/
For ChiliMoon: Currently you have to use bugzilla at bugzilla.lysator.liu.se/
Applies to: Roxen , ChiliMoon
Posted at 2004-11-17 by Michael Stenitzer
Use debug options provided by the start programme.
./start -help
gives you more information this.
Another way to debug Roxen's / ChiliMoon's modules or core is to insert something like this in the code:
werror("report a: %O, b: %O\n", a, b);
The result will be printed into the debug files. (logs/debug/default.1). Read more at community.roxen.com/articles/004_errors/
You can also write from RXML directly into the debug log
<debug werror="This is printed in the debug log"/>
Applies to: Roxen , ChiliMoon
Working with Roxen and ChiliMoon modules (general and concerning certain modules)
Posted at 2004-11-12 by Michael Stenitzer, Last updated at 2004-12-30 by Michael Stenitzer
Roxen 4 uses Pike 7.4 or 7.6. IMHO has not been maintained for a long time.
Try this patch
--- imho.pike Mon Aug 11 09:19:53 2003
+++ imho.pike.patch Mon Aug 11 09:09:56 2003
@@ -6541,7 +6541,7 @@
if(query("sendmethod")=="SMTP")
break;
{
- array stat=(array)file_stat(value);
+ mixed stat=file_stat(value);
if(!stat || !(stat[0] & 73))
return "Must be an executable file.";
}
@@ -6781,7 +6781,7 @@
// Roxen tries to kill us. Escape...
// Destroy all sessions after 60 seconds if the new IMHO hasn't been compiled by then.
a[0]=call_out(lambda(mixed ... foo){foo[1]->destroy_clients();}, 60,
- "IMHO_Survivor", new(object_program(this_object()), g, variables,
+ "IMHO_Survivor", object_program(this_object())(g, variables,
0,0,0,0,0,0,0,0,0,0), a, my_configuration() );
}
Applies to: Roxen (4.0) ,
Just adding a
#pike 7.0
to the beginning of imho.pike should be sufficient.
Posted at 2004-11-12 by Michael Stenitzer, Last updated at 2004-11-14 by Sascha Nemecek
Do not use "raw" in your forwarding pattern.
LOCATION / CALL http://otherhost/dir/
The problem is with keep-alive. The relay module does not like it, if the backend server keeps the connection. For some reason, some browsers send a keep-alive request, and if you specify the 'raw' option, it gets handed to the backend server which of course honors it. After a couple of minutes, the browser times out and drops the connection. The connection to the backend is dropped in turn, the browser repeats the request, and from then on everything is fine.
Applies to: Roxen , ChiliMoon
Posted at 2004-11-12 by Michael Stenitzer
The module is still used by a different module (e.g. “Tab list” uses the “GButton” module).
Applies to: Roxen , ChiliMoon
Posted at 2004-11-15 by Michael Stenitzer
Roxen/ChiliMoon starts to look in the filesystem with longest mountpoint first. It's only undefined if two modules have the same mountpoint.
e.g. if you have three filesystem with the following mountpoints:
/foo/bar/gazonk/
/foo/bar/
/foo/
/
The file /foo/bar/gazonk/file will be searched in the order shown above. For identical mountpoints (e.g. two filesystems mounted at /foo/) you can change the search order if you change the module’s priority settings.
Applies to: Roxen , ChiliMoon
Posted at 2007-02-13 by Michael Stenitzer
If you include a file with redirect rules by using the '#include <filename>' syntax you must use UNIX-style linebreaks (LF only) in this file.
Applies to: Roxen ,
Comments
Posted by Marc Dirix (2004-12-06)
Synchronisation between ChiliMoon and Roxen webserver will keep taking place.