New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing issue #1

Open
engragy opened this Issue Dec 1, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@engragy

engragy commented Dec 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@plepe

plepe Dec 1, 2017

Owner

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".

Owner

plepe commented Dec 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@plepe

plepe Dec 1, 2017

Owner

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'.

Owner

plepe commented Dec 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@engragy

engragy Dec 2, 2017

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 )

engragy commented Dec 2, 2017

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

This comment has been minimized.

Show comment
Hide comment
@plepe

plepe Dec 2, 2017

Owner

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:

  • openstreetbrowser/lang/en.json
  • openstreetbrowser/node_modules/openstreetmap-tag-translations/tags/en.json
  • openstreetbrowser/node_modules/openstreetmap-tag-translations/languages/en.json

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!

Owner

plepe commented Dec 2, 2017

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:

  • openstreetbrowser/lang/en.json
  • openstreetbrowser/node_modules/openstreetmap-tag-translations/tags/en.json
  • openstreetbrowser/node_modules/openstreetmap-tag-translations/languages/en.json

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

This comment has been minimized.

Show comment
Hide comment
@plepe

plepe Dec 2, 2017

Owner

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

Owner

plepe commented Dec 2, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment