User:Polishdeveloper/BetaCluster Restbase access on localhost

The easiest way to test Restbase services with your local vagrant/mediawiki instance you can point your apache2 configuration to use Wikimedia restbase server. With that approach you don't have to install restbase server locally. Apache will redirect all restbase calls to production server.

In order to do it please follow those steps:

How to point to beta cluster restbase
1. Install necessary apache2 modules sudo a2enmod ssl proxy proxy_http 2. Create a confuration rule for apache2 to proxy restbase: sudo touch /etc/apache2/site-confs/devwiki/40-restbase.con 3. Paste following config in your newly created 40-restbase.com file using your favourite editor SSLProxyEngine On ProxyPass /api/rest_v1/ https://en.wikipedia.beta.wmflabs.org/api/rest_v1/ 4. Restart apache2 service sudo service apache2 5. You local apache2 will point to production instance, you can test it visiting an example url: http://localhost:8080/api/rest_v1/page/summary/Planet

Those steps are valid for MediaWiki-Vagrant environment. It also applies to to local apache instan. When using a custom mediawiki installation you'll have to tell apache2 service to include configuration created in steps 2&3.

How to point to production restbase
If you want to point to production restbase instance in step 3 please change the beta cluster restbase url to **https://en.wikipedia.org/api/rest_v1/**