Tutorial: "Hello World!" Configuration
Every CppCMS based application should come with a configuration file. You can find a configuration file template with full comments in docs folder at your CppCMS installation.
We will write a simple file that consists of few lines:
server.api = "fastcgi" server.mod = "prefork" server.socket = "/tmp/fcgi-hello.socket"
This will define a basic settings for the runtime mode:
- API that uses CppCMS in communication with web server, in our case "fastcgi". Other options are "scgi" and "cgi".
- Worker mode of CppCMS -- prefork -- application forks several processes that process queries. Other possible options are single process and thread mode -- "process" and single process multiple threads mode "thread".
- The socket that would use the web server to connect with your fastcgi application
We would save it as "config.txt" and run cppcms_run utility
cppcms_run hello.fcgi -c config.txt
If you have lighttpd, nginx or apache2 with mod_fastcgi installed, they would be configured and started with your application.
Now restart your web server, open a web browser and go to http://localhost:8080/hello.fcgi. You should see the traditional "Hello World"