From: http://karlinapp.ethz.ch/qgis_wms/configuration/
You need to have a webserver installed (e.g. Apache) and place the files for the QGIS mapserver in the FastCGI or CGI directory of your webserver. On Windows, QGIS mapserver currently can only be used as a CGI application. You also need to make sure the webserver finds libqgis_core.so/dll and libqgis_gui.so/dll and the Qt libraries when starting the server application.
For Apache this can achieved by extending the LD_LIBRARY_PATH in the webserver configuration file:
CGI: Enter the following line into apache2.conf: SetEnv LD_LIBRARY_PATH Path_to_Qt_libraries:Path_to_QGIS_libraries
FastCGI: Enter the following line into fcgid.conf: DefaultInitEnv LD_LIBRARY_PATH Path_to_Qt_libraries:Path_to_QGIS libraries