Apache module

From PhiWiki
Jump to: navigation, search

The Phi engine is available as a standalone Phis server or as an Apache module. The created *.phis pages need to be processed by the Phi engine to create HTML or native code. Phi runs in both Apache modes: prefork MPM and worker MPM and is designed to scale well on multi processor systems.



In the Phisketeer setup you can choose to install the engine as an Apache module. This will copy the necessary files to the Apache directory. Ensure that the Phi libraries are found by Apache ie. by adding C:\Program files\Phisketeer\bin to the system %PATH% variable.

Unix / Linux

Copy the libmod_phi.so.X to Apache's modules directory. Add the Phi libraries to the LD_LIBRARY_PATH variable in the shell where Apache is started to ensure that Apache will find the required libs for example:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/phisketeer-x_y_z/lib

Mac OS X

An Apache module for Mac OS X is currently not available. However the Artephis editor seamlessly integrates the Phis server during package installation for serving your *.phis pages.


Add the following lines to the httpd.conf in the 'LoadModule' section:

LoadModule phi_module path_to_modules/libmod_phi.so.X

In the config section add the following lines:

<IfModule phi_module>
  AddHandler phi .phis
  DirectoryIndex index.phis
  AddType application/x-phi phi

Check the log files if Apache could load the module or if any other Phi related error occured. Phi protocols its errors to the Apache error.log.

Document root

Apache serves documents from its own location, this is usually:

  • Windows: C:\Program files (x86)\Apache Softare Foundation\Apache2.2\htdocs
  • Open SuSE: /srv/www/htdocs or /srv/www/vhosts/your.domain.com
  • Ubuntu: /var/www

You need to save your *.phis pages there if you want them to be served by Apache.