Friday, 26 August 2016

Qgis-server...Installing the QGIS Lizmap Plugin & Lizmap Web Client

This post follows on from my previous three (most recent first in list) linked below.

There is no doubt that in just a short time from now we will probably see a 'one-click' installer to by-pass the next steps but a least this method allows you to change 'in/out' the individual libraries if there is are updates using the usual 'sudo apt update && sudo apt upgrade'.

http://www.paulshapley.com/2016/08/qgis-server-bringing-map-into-browser.html

http://www.paulshapley.com/2016/07/how-to-install-qgis-server-on-ubuntu.html

http://www.paulshapley.com/2016/04/how-to-install-postgresql-95-and.html

1.  Firstly...Create a new QGIS project, add your layers from PostGIS, Shapefiles or raster (geotiff), style and symbolise those layers, set the projection and ensure you've set up your 'OWS Server' in 'Project Properties'.

2.  Let's install the 'Lizmap' Plugin first by going into the 'Plugins' menu then 'Manage and Install Plugins', then type in 'Lizmap' in the Search bar.


3.  Tick the 'Lizmap' plugin and 'Install'.

4.  Go back to 'Project Properties' and in the 'General' tab  ensure 'save path' is now set to 'relative'.

5.  Next... click on 'Lizmap' under the 'web' menu and set all the tabs similar to below. Your choices here will activate the relevant tools in the browser when we get to the lizmap-web-client later.

Your layer/s should already be showing in the list.

Now click on the 'Map' tab and tick the 'map tools' that you want in your map browser. Set the scales you need separated with a comma (integer's only). You can set the 'Initial map extent' to the 'map canvas' option.


Then we move onto the 'baselayers' tab. Set as many map options as you like.


Next the 'Tools' tab. In here i would just worry about adding your attribute layers in the bottom block (below).


We can miss on the 'FTP' tab because this is no longer used. In the 'Log' tab (below) you just need to click 'Save' and read the generated log to ensure it is successful.



Once you 'Save' in the 'Lizmap' plugin a file with the same name as your project file e.g. 'southuk.qgs.cfg' this will now go with your qgis project file to be saved in '/home/some_directory/southuk.qgs'.


Installation of the Lizmap Web Client

6.  Go to the following url:-

https://github.com/3liz/lizmap-web-client
 


Click on 'Branch Master' and in the dropdown select 'release_3_0' the repository will now change to the files in the '_3_0' release.



Click 'clone or download' then 'Download ZIP'. Extract the ZIP file into any folder. You now have a folder entitled 'lizmap-web-client-release_3_0' now we need to move it onto our Apache2 Server folder.

In order to do this we need 'gksudo' (which means 'home'=/root) in order to access the Apache2 server folders. In the terminal enter:-

$ gksudo nautilus

You will then be asked for your 'root' password. You are then free to add your 'lizmap-web-client-release_3_0' into '/var/www'



'Exit' Nautilus when done on the command line.

Now we link the lizmap client into the apache2 server 'html' directory so it is available in a standard browser a little later on.

$ sudo ln -s /var/www/lizmap-web-client-release_3_0/lizmap/www/ /var/www/html/lm

$ cd /var/www/lizmap-web-client-release_3_0
$ sudo lizmap/install/set_rights.sh www-data www-data
$ cd /var/www/lizmap-web-client-release_3_0/lizmap/var/config
$ sudo cp lizmapConfig.ini.php.dist lizmapConfig.ini.php
$ sudo cp localconfig.ini.php.dist localconfig.ini.php
$ sudo cp profiles.ini.php.dist profiles.ini.php
$ cd ../../..

7.  Now we can activate the php installer but make sure before this you install php5.6 or php7.0 with the following additional modules:-

$ sudo apt install xauth htop curl libapache2-mod-php7.0 php7.0-cgi php7.0-gd php7.0-sqlite3 php7.0-xml php7.0-curl php7.0-xmlrpc php7.0-pgsql python-simplejson python-software-properties

then:-

$ sudo php lizmap/install/installer.php

Installation start..
[notice] Installation starts for the entry point index
All modules dependencies are ok
Module jelix installed
Module jauthdb_admin installed
Module master_admin installed
Module jacl2 installed
Module jacl2db installed
Module jacl2db_admin installed
Module jauth installed
Module jauthdb installed
Module admin installed
Module lizmap installed
Module view installed
Module proj4php installed
All modules are installed or upgraded for the entry point index
[notice] Installation starts for the entry point admin
All modules dependencies are ok
Module jelix installed
Module jauthdb_admin installed
Module master_admin installed
Module jacl2 installed
Module jacl2db installed
Module jacl2db_admin installed
Module jauth installed
Module jauthdb installed
Module admin installed
Module lizmap installed
Module view installed
Module proj4php installed
All modules are installed or upgraded for the entry point admin
[notice] Installation starts for the entry point script
All modules dependencies are ok
Module jelix installed
Module jauthdb_admin installed
Module master_admin installed
Module jacl2 installed
Module jacl2db installed
Module jacl2db_admin installed
Module jauth installed
Module jauthdb installed
Module admin installed
Module lizmap installed
Module view installed
Module proj4php installed
All modules are installed or upgraded for the entry point script
Installation ended.


$ sudo service apache2 restart 

8.  You need to enable the QGIS 'Demo' repository.

$ cd /var/www/lizmap-web-client-release_3_0/lizmap/var/config

$ sudo gedit localconfig.ini.php

#add the lines:-

[modules]
lizmap.installparam=demo

'Save'...then re-run the 'installer.php' as before:

$ sudo php /lizmap/install/installer.php
$ sudo service apache2 restart 


Give the appropriate to directories and files


9.  $ cd /var/www/lizmap-web-client-release_3_0
     $ sudo chown :www-data temp/ lizmap/var/ lizmap/www lizmap/install/qgis/edition/ -R
     $ sudo chmod 775 temp/ lizmap/var/ lizmap/www lizmap/install/qgis/edition/ -R
     $ sudo service apache2 restart


** At this point it may be that you want to use the Lizmap web client directly on a production server, in which case you would need the installation of some extra php modules necessary for production. If so i recommend following the instruction in the following reference.

Configuring the map server for Lizmap-web-client

http://docs.3liz.com/en/admin_guide/installation/server_configuration.html


My 'Project' Folder


The is an image taken from my project in QGIS named 'southuk.qgs.png' which is used as the 'thumbnail' image in the Lizmap Web Client also added to the folder.


Configuring the Lizmap Web Client

10.  Go to your favourite browser and type the url:-

http://localhost/lm

If you don't get a 'connect' page (as below) and instead you see this error:-

process(new jClassicRequest());

or this:-



It means that your PHP install is not correctly 'interpreted'. You will need to remove the library 'libapache2-mod-php7.0' then install it again before you restart apache with the usual 'sudo service apache2 restart'. It is also a good idea to remove the browser cache too. Then when that is done retype:

http://localhost/lm



If you see this start page 'it works'...

11.  If you click on the 'Connect' button on the top right corner you will be asked for login details in which you can enter 'admin' as 'login' and as 'password'.

Enter 'admin' in both login and password...you can change these later

12.  Go back to the top right corner and click on the 'admin' button and select 'My account' and click on 'Lizmap configuration' in the left hand list as below.

This shows your pre-set services.

13.  Scroll down this page and you will see the 'Repository' settings. Here you can set the 'local folder' of the 'QGIS' demo as:-

/var/www/lizmap-web-client-release_3_0/lizmap/install/qgis/

Set all the 'rights' to 'admins' for now. If all goes well when you click on 'View' you should see the project as a thumbnail image.




14.  Now create a second 'Repository' with the 'local folder' set to (in my case)
       /usr/lib/cgi-bin/project/

      ** It's important to remember the last '/' at the end of the folder path       location.

If all goes well when you select the 'Project' button (top right) you should see your two projects listed one under the other.


Both 'Repositories' should be showing if you've set the 'local folders' correctly and 'saved' without any errors.

15. Just click on one of the Projects and you go into your map view. Now you can see that your layers are the same as in QGIS project. If you make any changes in your project file and save it... simply refresh the browser for the changes to update on your web map.

Go on...experiment, change some themes in your qgis project and see the changes when you refresh your browser. You can for example create a group of layers to appear in the 'Overview' Map in the bottom right corner.




For more information about further customisations to the Lizmap Web Client see:-

http://docs.3liz.com/en/index.html

Please email me if you need help installing the client or any other questions.





















48 comments:

  1. Hello Admin, thank you for enlightening us with your knowledge sharing. PHP has become an inevitable part of web development, and with proper PHP Training in Chennai, one can have a strong career in the web development field. We from Fita provide PHP course in Chennai with the best facilitation. Any aspiring students can join us for the best PHP Training Institute in Chennai

    ReplyDelete
    Replies
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training India . Nowadays Java has tons of job opportunities on various vertical industry.

      Delete
    2. Great post.Thanks for one marvelous posting! I enjoyed reading it;The information was very useful.Keep the good work going on!!

      ETL Testing training in chennai| SAP MM training in chennai | Informatica training in chennai

      Delete
  2. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
    Regards,
    web designing classes in chennai|web design training chennai|web designing course in chennai

    ReplyDelete
  3. Article useful, but it is not the strength of my abilities. I specialize in project work, namely the creation and management of projects. Last time doing projects that are closely associated with php development. I once did this success, but this time I decided to turn to a professional team php developer outsource. I was amazed at how quickly and accurately they have completed their work. They are ahead of schedule, and thus free up time for my vacation.

    ReplyDelete
  4. Great article. Glad to find your blog. Thanks for sharing.

    php training in chennai

    ReplyDelete
  5. Updating with the latest technology and implementing it is the only way to survive in our niche. Thanks for making me this article.
    Node JS training in chennai | Node JS training institute in chennai

    ReplyDelete
  6. Can't get done the 7th step.... help, please! :D

    ReplyDelete
    Replies

    1. Thanks for one marvelous posting! I enjoyed reading it;Great post.The information was very useful.Keep the good work goin on!!
      Hadoop training in chennai | Mainframe training in chennai | SAP SD training in chennai

      Delete
  7. Great tips to become a better web Developer! I have to share this post on my facebook wall to see my friends. I hope they will get some impressive information through this reading. By the way, I am a big fan of Reztech web developing company. Thanks!

    ReplyDelete
  8. Your article was so impressive and informative. Its very interesting to read. Thanks for sharing, Android Training in Chennai | IOS Training in Chennai

    ReplyDelete
  9. Hello Paul,
    Your four articles about QGIS server and Lizmap are very useful. Unfortunately, I have real trouble installing and configuring Lizmap Web Client; I think this is about php and apache configuration and it's not exactly my stuff... Where can I send you a message for a little help? Thank you. Cécile, Paris.

    ReplyDelete
  10. Hi paul,
    If you think the documentation is not complete, please help us to enhance it. https://github.com/3liz/lizmap-documentation

    ReplyDelete
  11. hi paul,
    you done a great work,I’m really impressed with your article, such great & usefull knowledge you mentioned here.
    Web design institute chennai

    ReplyDelete
  12. hi welcome to this blog. really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    selenium training in chennai

    ReplyDelete
  13. This is seriously good, you have really highlighted some of the great points one should know. Awesome work
    Wonderful suggestions and guidance
    java training in chennai

    ReplyDelete
  14. Wow! wonderful blog. when ever I installed any server I spend my money in some computer center only for installing the server, but now I install myself itself really its so helpful to me. I heartily thank you very much for sharing such a wonderful blog. Software Testing Training Institute in Chennai | Selenium Training Institute in Chennai

    ReplyDelete
  15. Thanks for sharing as it is an excellent post Webdesign Nürnberg

    ReplyDelete
  16. Very interesting and Helpful Tips…..Thanks For Sharing.
    Bulk SMS Chennai

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. Thanks for your input. I really appreciate your effort.

    Regards,
    Ahad Arzi(http://ahadarzi.me)

    ReplyDelete
  19. Thanks a lot for sharing this with all of us, I like it and we can communicate. Do you need buy app ratings and reviews. To boost app ranking and double app downloads now.

    ReplyDelete
  20. Pretty article! I found some useful information in your blog, thanks for sharing this great content to my vision, keep sharing..No.1 Software Testing Training Institute in Chennai | Best Selenium Training Institute in Chennai | Java Training in Chennai

    ReplyDelete
  21. I really impressed your article.. Your creating some web client technology..keep updating your post..
    Android Training Institute in Chennai | IOS Training in Chennai | Online Android Training in Velachery

    ReplyDelete
  22. Great info. The Qgis server installation steps are very precise and clear. Easily understandable. Thanks for sharing and keep updating..
    Final Year Project Center in Chennai | IEEE Project Center in Chennai | Diploma Project Center in Chennai

    ReplyDelete
  23. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .IEEE Projects Center in Chennai | IEEE Projects Center in Velachery

    ReplyDelete
  24. That's cool! If you wanto to find best programmers click here https://youteam.co.uk/

    ReplyDelete
  25. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    java Training in Chennai

    Java Training in Bangalore



    ReplyDelete
  26. In this article you shared information about web marketing is very effective for learners. I have got some important suggestions from it.
    B.Com Project Center in Chennai | B.Com Project Center in Velachery

    ReplyDelete
  27. Nice interesting information on the latest technology which helped me to get update according to the recent trends.No.1 IOS Training Institute in Velachery | Best Android Training Institute in Velachery | Core Java Training Institute in Chennai

    ReplyDelete
  28. Your new valuable key points imply much a person like me and extremely more to my office workers. With thanks.

    Hadoop online Training | Informatica Online Training | ETL Testing Online Training

    ReplyDelete
  29. Great post. wonderful information and really very much useful. Thanks for sharing and keep updating.
    Best AWS Training Institute in Chennai | Best AWS Training Institute in Velachery

    ReplyDelete
  30. Your blog was explain everything in detailed manner and it was very interesting to read. Kindly keep updating such a nice blog.
    Final Year Project Center in Chennai | Final Year Project Center in Velachery

    ReplyDelete
  31. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    aws training in Chennai

    ReplyDelete
  32. Very interesting blog which helps me to get the in depth knowledge about the technology...DotNet Project Center in Chennai | DotNet Project Center in Velachery

    ReplyDelete

Featured post

Qgis-server...Installing the QGIS Lizmap Plugin & Lizmap Web Client

This post follows on from my previous three (most recent first in list) linked below. There is no doubt that in just a short time from no...