Here my usual steps to configure wms di qgis (2.4) tested on ubuntu 12.04 and 14.04
1) Install some requested packages:
sudo apt-get install qgis-mapserver libapache2-mod-fcgid
2) Be sure fastcgi is enabled in apache2 modules:
ls -la /etc/apache2/mods-enabled/fcgid.conf
2a) Modify /etc/apache2/sites-available/000-default.conf and add inside VirtualHost:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
Options ExecCGI FollowSymLinks
Require all granted
AddHandler fcgid-script .fcgi
</Directory>
3) Restart apache2 http server
sudo service apache2 restart
4) Try to access to service using a browser type:
http://127.0.0.1/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&REQUEST=GetCapabilities
5) Try a qgis project in your user dirs:
/home/ubuntu/my_qgis_project_dir/my_qgis_project.qgs
Still using a browser verify the web address (note the MAP has an absolute path to the project, otherwise you'll get a 500 error):
http://127.0.0.1/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&MAP=/home/ubuntu/my_qgis_project_dir/my_qgis_project.qgs&REQUEST=GetCapabilities
6) Use qgis (or also other client software) add the WMS service
Qgis menu: Layer → Add layer WMS/WMTS layer
simply add the http addr above... connect to service and add desired layers
If you get 403 errors please verify your dir $HOME permissions mine are drwxr-xr-x
and also some apache2 conf:
http://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/