plepe / openstreetbrowser-editor

An editor for OpenStreetBrowser categories
GNU General Public License v3.0
0 stars 0 forks source link

installing issue #1

Open engragy opened 7 years ago

engragy commented 7 years ago

Hiiiii plepe

i have been trying the new update i have deleted the old data then followed your instructions , then created two folders categories , openstreetbrowser-categories-main inside the editor folder

my apache web server user is called "api", so i did the last commands like this `setfacl -R -m user:api:rwX openstreetbrowser-categories-main/'

'setfacl -R -dm user:api:rwX openstreetbrowser-categories-main/'

'setfacl -R -dm user:api:rwX openstreetbrowser-categories-main/'

at the end the web browser displayed the localhost as this Create new category: index, overpass but index or overpass is empty pages

the apache error log says [Fri Dec 01 22:30:04.344877 2017] [:error] [pid 2685] [client ::1:43460] PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /home/api/openstreetbrowser/editor/lib/modulekit/form/inc/form.php:183\nStack trace:\n#0 /home/api/openstreetbrowser/editor/index.php(78): form->show()\n#1 {main}\n thrown in /home/api/openstreetbrowser/editor/lib/modulekit/form/inc/form.php on line 183, referer: http://localhost/

i hope i didn't do something wrong

plepe commented 7 years ago

So you use the same system user as the web server? Then the setfacl lines wouldn't have been necessary.

"DOMDocument not found" => you need to install "php-dom".

plepe commented 7 years ago

I want to elaborate on the web server user question. When you are using Debian/Ubuntu, the web server (apache2) itself is usually running as user 'www-data'. It is possible to change this, but this is very uncommon.

PHP scripts are usually run (if you don't use php-fcgi or php-fastcgi or the obsolete php-suphp) as the web server (the user 'www-data') and not the local user (e.g. 'api').

So if PHP tries to write to the files you created as user 'api' you will get a permission denied error. If this happens, use the setfacl as I described it in the README to grant permissions to 'www-data'.

engragy commented 7 years ago

hi plepe i have installed 'php7.0-xml' instead of 'php-dom' as the system suggested and now the editor is working, can i edit the already created categories of openstreetbrowser as i want to understand first how to define a category before creating new one , if not possible can you give a link to help me understand about categories and querying if i need to know about it as well.

i do want to add Arabic language to openstreetmap browser and editor, so which files i should edit.

also excuse me if i thought that making my user the same as Apache user would make things easier, but after mentioned it i think it made a lot of trouble i wasn't aware of :) .. i am new to Linux but interested.

sorry for asking to much ,but do you know a document that descries how to install openstreetmap-website in production mode (i mean with phusion passenger, cgimap )

plepe commented 7 years ago

Of course you can edit already created categories - it's your copy :-) Preparing a tutorial how to create categories sounds like a good idea, but this will take some time ...

The languages: Just add Arabic (the iso639-1 code, 'ar') to the $languages array in conf.php (openstreetbrowser as well openstreetbrowser-editor). You need to create a copy of the following files:

You don't need plurals: if you have e.g.:

    "tag:amenity=restaurant": {
        "message": "Restaurant",
        "!=1": "Restaurants"
    },

you can replace this by the string in singular:

    "tag:amenity=restaurant": "Restaurant in Arabic language",

You may add additional language strings, the list is not complete.

About apache user: running under the same user does make thinks easier, I was just not sure if you succeeded.

You should pull the newest version of openstreetbrowser-editor (it now features a live preview): "git pull; npm install".

You might want to check the category "water" for a rather simple category.

Please ask :-) It's no bother!

plepe commented 7 years ago

You also should copy (and adapt) the $config['defaultView'] variable from conf.php-dist to conf.php.