Difference "How to run the application at the root of the web server" ver. 1 versus ver. 2
Content:
<!--toc--> |
|
Most of the time, one would want to run the cppcms application so that accessing the root of the web server (the root of your domain name) would display the root content of your application. |
|
However, the simplest set up requires the required path to be prefixed by the application name, which is not usually pretty. The fix requires to set up the web server with some URL rewriting mechanism. The exact set up depends on the web server used. |
|
|
# Apache2 |
|
Use mod_rewrite. |
|
.htaccess: |
|
<IfModule mod_rewrite.c> |
RewriteEngine on |
|
RewriteCond %{REQUEST_FILENAME} !-f |
RewriteCond %{REQUEST_FILENAME} !-d |
RewriteRule ^(.*)$ my_app.cgi/$1 [L,QSA] |
</IfModule> |
|
|
Of course, Apache2 must be properly configured to allow .htaccess override of mod_rewrite. |
|
|
Or use a script alias: |
|
# Content of /etc/apache2/sites-enabled/tatoebacpp |
|
FastCGIConfig -maxProcesses 1 -processSlack 1 |
<VirtualHost *:80> |
|
ServerName tato.sysko.fr |
ServerAlias *.tato.sysko.fr |
|
# Usually it is given in fastcgi.conf by default |
|
FastCgiServer /blablabla/tatoebacpp_git/build/tatoeba -initial-env CPPCMS_CONFIG=/blablabla/tatoebacpp_git/config.js -socket |
/tmp/hello-fcgi-socket |
|
ScriptAliasMatch ^(.*)$ /blablabla/tatoebacpp_git/build/tatoeba$1 |
|
|
AddHandler fastcgi-script /blablabla/tatoebacpp_git/build/tatoeba |
|
</VirtualHost> |
|
About
CppCMS is a web development framework for performance demanding applications.
Support This Project


Navigation
Main Page
Valid CSS
| Valid XHTML 1.0