Commons:Monuments database/Setup/In labs

From Wikimedia Commons, the free media repository
Jump to: navigation, search

Instructions on setting it up in lab (generalizable to other environments too)

  1. Created instance, Ubuntu 12.04
  2. Setup LAMP via `tasksel`
  3. check out PyWikipedia from Trunk ( - needs to be packaged up later.
  4. Setup mysql config for the bot at
  5. run pywikipedia/
    1. Generate
    2. Pick wikipedia
    3. Pick en
    4. Bot's user name (wlm-mobile-bot)
    5. Small variant
    6. add db_username, db_password and db_hostname to the file manually.
    7. is generated, is copyable and reusable.
  6. run pywikipedia/ to check if login is setup properly
  7. Check out
  8. Setup a mysql user and database, and make sure the user has access to the database.
  9. set config from 8 in erfgoedbot/ (database and host info)
  10. run to generate sql statements in sql/. See FIXME down. Must manually replace toolserver hostname in a few sql statements with appropriate db hostname.
  11. set PYTHONPATH to include path to the pywikipedia source.
  12. install the python-mysqldb package
  13. Run to start the update process.
  14. Run sql/fill_table_monuments_all.sql to aggregate all the different monument data into one.
  15. Checkout into ~/public_html/api, symlink it to /var/www/api
  16. Checkout into ~/ToolserverI18N.
  17. Create ~/, overriding whatever needs changing from api/includes/Defaults.php: $dbServer, $dbUser, $dbDatabase, $dbPassword, $dbMiserMode, $tsI18nDir.
  18. Setup cron to run once a day, with something along the lines of