Talk:VisualEditor/Installation on a shared host

Jump to navigation Jump to search

About this board

Previous discussion was archived at Talk:VisualEditor/Installation on a shared host/Archive 1 on 2015-08-27.

How to edit the .gitignore?

3
FrustratedNoob (talkcontribs)

Okay, I'm not a programmer. How the heck do I edit the .gitignore file in step #4?

Can we possibly have some instructions that don't assume everyone who wants to use parsoid is a programmer?

First I installed and logged into the heroku CLI, then tried to download the git, but turns out I also need git, so I had to install and set up that. Then I get the git and I get to step 4 and there's no clue, not even a hint on how to do that it is asking. I searched everywhere in google for how to edit a file in heroku and came up with nothing usable, except mentions of its "ephemeral file system", which did not help me at all, no matter how I reworded it or used advanced google search modifiers.

So then I searched for how to download a file from heroku, and still nothing. There doesn't appear to be any kind of file manager in the heroku interface.. there has to be a way to open/edit files and edit them, or download them. I found references to installing vim but none of them worked. I'm very frustrated, please add some clear instructions for non-programmers to make this accessible to everyone who uses and administers a MediaWiki, and not just the programmers.

Mine is not the first comment regarding this. Others are having problems with the same thing. 14 steps when someone has no clue on how to use git or heroku is not a clear set of instructions at all. Please at least supply the necessary commands required to do the setup as other MediaWiki resources do.


Malyacko (talkcontribs)

Partially overlapping with Topic:Vp658eh047idd3mk. The page does not require any programming.

You edit the .gitignore file in the Parsoid directory by opening that file with a text editor. I have no idea about Heroku so feel free to ask in a Heroku forum how to edit files and to improve that page.

TiltedCerebellum (talkcontribs)

Try the following (for people that don't know git, they don't realize that they aren't working remotely, they are working locally, and they aren't going to know the necessary git comands if they don't work with git all of the time):

  1. Make sure Git is installed (heroku requires Git).
  2. Install the Heroku Command Line Interface.
  3. Using Git CMD log in with:
    heroku login
    
  4. Clone Parsoid (to your local machine) with:
    git clone https://gerrit.wikimedia.org/r/mediawiki/services/parsoid
    
  5. Look at the location provided in your command prompt, your cloned files will be placed locally there e.g.: C:\Users\<user>\parsoid
  6. Enter the Parsoid directory you just created on your local machine:
    cd parsoid
    
  7. In Windows Explorer, browse to the path above on your local machine, and edit the hidden file .gitignore and remove the lines config.yaml and composer.lock
  8. In Windows Explorer, create your config file by copying config.example.yaml and renaming it to config.yaml
  9. Edit the config.yaml file you just created by changing the example URI for the URL of your API, for example uri: 'https://www.yoursite.wiki/api.php' If your wiki uses https, then uncomment the line strictSSL: false If the domain: 'localhost' line is uncommented, comment it (helps to avoid the "Invalid domain" error)
  10. Save the changes.
  11. Add the Heroku remote to your git repo with:
    heroku git:remote -a <yourappname>
    
  12. Stage the edited config files for committing with:
    git add .
    
  13. Commit your changes with:
    git commit -am "Initial commit"
    
  14. You have to specify an identifier to allow the commit with:
    git config user.email yourname@exaple.com
    
  15. Push and deploy your local changes to the remote location with:
    git push heroku master
    
  16. Visit https://yourappname.herokuapp.com to verify that your Parsoid service works.
  17. Make sure you DONT leave in the trailing slash in the LocalSettings.php portion of code, it will cause it to not work. I edited the MW page to remove the trailing slash. 'url' => 'https://APPNAME.herokuapp.com' NOT 'url' => 'https://APPNAME.herokuapp.com/'
Reply to "How to edit the .gitignore?"
Sophivorus (talkcontribs)

I'm having trouble making this solution work in localhost. I followed the steps precisely and I'm confident about it since I've made it work many times before while NOT in localhost. But when in localhost, I get this error:

Error loading data from server: apierror-visualeditor-docserver-http: HTTP 500.

I enabled all error reportings but I can't seem to get any more info than that. Anyone know what could be the cause, the solution, or a way to get more info?

Reply to "Make it work on localhost"

Use of VisualEditor in Mediawiki 1.34

2
孤鸿影子 (talkcontribs)

Tested on Mediawiki 1.31 and 1.34, can be used in 1.34.

Need to add configuration

$ wgVirtualRestConfig ['modules'] ['parsoid'] ['forwardCookies'] = true;

(will cause security issues),

You need to modify 3 places, follow the instructions to modify 2 places, and modify the 3rd place, "domain" your mediawiki domain name, to deploy using this zip file package


Sophivorus (talkcontribs)

Thanks, I just added that line to the documentation.

Is free version of Heroku sufficient ?

4
Summary by Sophivorus

Free Heroku apps are sufficient. The only limitation is that after one hour of not being used, free Heroku apps go to sleep and take a few extra seconds to awaken. If you want to avoid this, you need to hire a Heroku dyno (USD 7 per month).

Symac (talkcontribs)

Hello,

Before going further and trying this install procedure, I wanted to know how sufficient the free version of heroku is. I am not used to Heroku so am not sure I am able to understand the pricing information.

The free version comes with "a monthly pool of 1000 Free dyno hours; unverified accounts receive 550. When a Free dyno is active, it draws from the pool; your free apps can run as long as there are dyno hours left in your monthly pool."

Based on a daily usage of 6 hours (will definitely be less), for 5 days a week and 4 weeks a month, I need 5 * 4 * 6 = 120 hours. So the 1000 hours a month are quite enough., am I right ?

Am I right or is this not the correct way of counting things on heroku ?

And regarding the CPU power, is 512 MB ram; 1 web/1 worker enough or will it be slow ? The project won't serve lot of people but I need it to be reactive for people using it.

Thanks.

AhmadF.Cheema (talkcontribs)

A couple of problems that I came across in the past were that, free dynos sleep after 30 minutes of inactivity which although helps in conserving the free hours, creates the problem that the user who will "wake" the dynos will face connection errors and will have to retry a couple of times before the Visual Editor finally works.

Another issue is that, if you are using this method of VisualEditor installation, it means you are probably using Shared Hosting. In this scenario using VisualEditor on large pages (like hundreds of kilobytes large), you are likely to end up crossing over the system resources limit of your host.

Jer Hughes (talkcontribs)

Would it be possible to create some kind of very light task (something that takes seconds), and have a cronjob that run every 25 minutes, so the dyno never sleeps?

AhmadF.Cheema (talkcontribs)

How to add second Mediawiki ?

2
Summary by Sophivorus

In your config.yaml do:

# Configure Parsoid to point to your MediaWiki instances.
mwApis:
    - uri: 'https://wiki1.com/w/api.php'
      strictSSL: false
    - uri: 'https://wiki2.com/w/api.php'
      strictSSL: false
    - uri: 'https://wiki3.com/w/api.php'
      strictSSL: false
    # And so on
41.222.179.171 (talkcontribs)

Hi. VisualEditor is moving in my mediawiki... but how to add second mediawiki??

config.yaml (line 39-42)

# the URL of you mediawiki API endpoint.

uri: 'http://wiki.mysite0001.com/api.php'

uri: 'http://wiki.mysite0002.com/api.php'

# the "domain" is used for communication wiht Visual Editor

it's not moving second Mediawiki...

please tell me how to add...second api...

Sophivorus (talkcontribs)

Error at step 19, no composer.lock file

6
Summary by Sophivorus

Instructions have been completely updated and tested, this no longer applies.

MGFlow58 (talkcontribs)

I have made sure that composer.lock is in .gitignore, however, when using ( git push heroku master ), i get an error saying the following:

remote: -----> PHP app detected                                                                                                                                                                                                                                                
remote:                                                                                                                                                                                                                                                                        
remote:  !     ERROR: No 'composer.lock' found!                                                                                                                                                                                                                                
remote:  !                                                                                                                                                                                                                                                                     
remote:  !     A 'composer.lock' file was not found in your project, but there                                                                                                                                                                                                 
remote:  !     is a 'composer.json' file with dependencies inside 'require'.                                                                                                                                                                                                   
remote:  !                                                                                                                                                                                                                                                                     
remote:  !     The lock file is required in order to guarantee reliable and                                                                                                                                                                                                    
remote:  !     reproducible installation of dependencies across platforms and                                                                                                                                                                                                  
remote:  !     deploys. You must follow the Composer best practice of having                                                                                                                                                                                                   
remote:  !     your lock file under version control in order to deploy. The                                                                                                                                                                                                    
remote:  !     lock file must not be in your '.gitignore'.                                                                                                                                                                                                                     
remote:  !                                                                                                                                                                                                                                                                     
remote:  !     Please perform the following steps locally on your computer to                                                                                                                                                                                                  
remote:  !     resolve this issue before attempting another deploy:                                                                                                                                                                                                            
remote:  !     1) remove 'composer.lock' from file '.gitignore', if present                                                                                                                                                                                                    
remote:  !     2) if no 'composer.lock' exists, run 'composer update'                                                                                                                                                                                                          
remote:  !     3) stage the lock file changes using 'git add composer.lock'                                                                                                                                                                                                    
remote:  !     4) if you edited '.gitignore', also run 'git add .gitignore'                                                                                                                                                                                                    
remote:  !     5) commit the change using 'git commit'                                                                                                                                                                                                                         
remote:  !                                                                                                                                                                                                                                                                     
remote:  !     Please remember to always keep your 'composer.lock' updated in                                                                                                                                                                                                  
remote:  !     lockstep with 'composer.json' to avoid common problems related                                                                                                                                                                                                  
remote:  !     to dependencies during collaboration and deployment.                                                                                                                                                                                                            
remote:  !                                                                                                                                                                                                                                                                     
remote:  !     Please refer to the Composer documentation for further details:                                                                                                                                                                                                 
remote:  !     https://getcomposer.org/doc/                                                                                                                                                                                                                                    
remote:  !     https://getcomposer.org/doc/01-basic-usage.md                                                                                                                                                                                                                   
remote:               

I've tried for a long time to figure out what I am doing wrong, can anyone please help me? I've made sure to do all steps up to this one (except step 11 and 12 as my site is not https, i use godaddy). Additionally, the only file I have named composer is composer.json, but no composer.lock. Any help would be greatly appreciated!

87.21.243.225 (talkcontribs)

same problem here :(

MGFlow58 (talkcontribs)

I'm kind of upset because it seems like a lot of extensions have trouble on a shared host, with this one it looked like I was actually getting somewhere but i feel the tutorial is outdated

NH35 (talkcontribs)

I generated that file (composer.lock) using composer. Everything was successful but inAPPNAME.herokuapp.com I have error "Forbidden You don't have permission to access / on this server.".

What i changed in original instruction? I removed composer.lock line in config.yaml


My log file https://justpaste(dot)it/63ogi

73.142.232.147 (talkcontribs)

I have the exact same problem. I managed to resolve the issue with "composer.lock", but unfortunately when I load the site, I receive the "Forbidden" error. Any idea?

Br shadow (talkcontribs)
Summary by Sophivorus

Instructions have been completely updated and tested, this no longer applies.

109.130.22.27 (talkcontribs)

When i try to open the web app i get this


403 Forbidden

Forbidden

You don't have permission to access / on this server.


Logs :


[Tue Apr 02 17:45:11.600374 2019] [autoindex:error] [pid 139:tid 140463323920128] [client 10.39.172.94:28878] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive


Thanks in advance


NH35 (talkcontribs)
Summary by Sophivorus

Instructions have been completely updated and tested, this no longer applies.

197.206.174.112 (talkcontribs)

I managed after a hard time to get VE work with the help of heroku.

But when it's https I get the same error , can anyone please explain in details how to get the config file for https work ? ( I mean step 11 & 12 ) cuz I use cloudflare , where to create file ? ( the etc thing ? ) and how to get cert key and I am using cloudflare ?.

AhmadF.Cheema (talkcontribs)
197.206.174.112 (talkcontribs)

Yeah I am talking about that part of the documentation , I don't understand how to get cert key and what etc file on the host or ? I am using cloudflare for ssl.

Qd p2 (talkcontribs)

You can change url app Heroku "https://..." to "http://.." (pass step 11 & 12 )

Qd p2 (talkcontribs)

example:

'url' => 'http://.........herokuapp.com',

'domain' => 'localhost',

'prefix' => 'your wiki prefix',

'forwardCookies' => true

OMG ! STILL NOT WORKING !

1
Summary by Sophivorus

Instructions have been completely updated and tested, this no longer applies.

41.109.77.145 (talkcontribs)

why the H ! it's bee, a year and a half without success !

apierror-visualeditor-docserver-http: HTTP 404

7
Summary by Sophivorus

Instructions have been completely updated and tested, this no longer applies.

Jer Hughes (talkcontribs)

I followed the steps, and can even verify "Welcome to the Parsoid web service" is displayed (Step 20), but I get "Error loading data from server: apierror-visualeditor-docserver-http: HTTP 404" after I complete Step 21 and try to edit a page.

The directions say to use this format:

// URL to the Parsoid instance
'url' => 'APPNAME.herokuapp.com',
// Parsoid "domain", see below (optional)
'domain' => 'localhost',
// Parsoid "prefix", see below (optional)
'prefix' => 'your wiki prefix',

I tried:

'url' => 'fake-appname-12345.herokuapp.com',
//'domain' => 'localhost',
//'prefix' => 'your wiki prefix',

'url' => 'fake-appname-12345.herokuapp.com',
'domain' => 'localhost',
'prefix' => 'your wiki prefix',

'url' => 'fake-appname-12345.herokuapp.com',
'domain' => 'fake-appname-12345.herokuapp.com',
'prefix' => 'https',

'url' => 'https://fake-appname-12345.herokuapp.com',
'domain' => 'fake-appname-12345.herokuapp.com',
'prefix' => 'https',

Can someone elaborate on what these values are? And this page provides instructions for setting Parsoid up on Heroku, why would the Parsoid "domain" ever be 'localhost'?

186.216.146.141 (talkcontribs)

I have the exact same problem with my wiki.

Creating a page is ok, though.

41.105.195.178 (talkcontribs)

the same problem , I am so so so tired with it for 3 months :/

201.14.131.70 (talkcontribs)

I'm tired about this same problem too :(

95.136.225.130 (talkcontribs)

Same for me...

John Harry Lau (talkcontribs)

Maybe need to install RESTBase

John Harry Lau (talkcontribs)