Archive:Deprecated chapter hosting notes

From FreeCulture.org
Jump to: navigation, search

note: in the instructions below, '~' will only be the correct path if you're logged in as freecult

Step 1: Creating the chapter's web space

  • mkdir -pv ~/chapter-hosting/$subdomain/files

Step 2: Enable the chapter's web space in Apache

  • Become root, then
    • cd /etc/apache2/conf.d/
    • export subdomain=SUBDOMAIN_YOU_ARE_CREATING
    • cp 200-umich.conf 200-$subdomain.conf
    • sed -i s/umich/$subdomain/g 200-$subdomain.conf
    • git add 200-$subdomain.conf
    • git commit 200-$subdomain.conf -m "Created web space for $subdomain"
    • /etc/init.d/apache2 reload
  • Go to http://$subdomain.freeculture.org/. It will say "Curious. There seems to be an error" until you set up Lyceum for this subdomain, or configure a redirect in the Semantic MediaWiki entry for this chapter.

Adding a wiki

Wiki step 1: Put the files in the right place

Go to the right directory:

  • cd /home/freecult/chapter-hosting/$college

Now copy our MediaWiki setup in:

  • sudo git clone /home/freecult/chapter-hosting/wiki-skeleton/mediawiki/ wiki

Wiki step 2: Put content in the database

Now create the database you will use:

  • python /home/freecult/software/fco-svn/mediawiki-cloning/clone.py /home/freecult/chapter-hosting/wiki-skeleton/mediawiki/LocalSettings.php

Take note of the username and password it prints. Now, open up LocalSettings.php with an editor:

  • cd /home/freecult/chapter-hosting/$college/wiki/
  • sudo nano -w LocalSettings.php
    • Update LocalSettings.php to have the right DB config info
      • $WGDBname , $WGDBuser , $WGDBpassword
    • Update LocalSettings.php to have the right Wiki name at $WgSitename
    • update: $wgLogo = "http://wiki.freeculture.org/wiki-logo.png";

Now, run the UPGRADE_ALL_WIKIS.sh script. (This makes sure that the new wiki, as well as all the old wikis, have all the maintenance scripts run that they need.)

  • cd /home/freecult/chapter-hosting
  • ./UPGRADE_ALL_WIKIS.sh
    • note: this script uses $HOME, so it will only work if you're logged in as freecult. it might be a good idea to hard-code this to just use /home/freecult . -Parker

Ta-da! http://$college.freeculture.org/wiki/ should work now.

TODO: info on creating admin user accounts for the chapter rep. Which user database does the wiki use/copy? For now, it looks like my account works for some reason, so i'll have the rep make a username, and i'll make them admin. -Parker

Wiki step 3: Customization for the chapter

  1. When you go to edit the Main_Page, you will see links to these templates: Chapter_name, Chapter_subdomain, School_name, School_url. Fill those in properly
  • use this url syntax: '.../wiki/template:$template_name'
  1. Create a username for the chapter's lead member and promote him to Bureaucrats.
  2. Whew, that's all!

Lyceum (WordPress farm)

  1. Log in as admin at freeculture.org/lyceum
  2. go to the new user registration page
    1. IMPORTANT: you will need to be logged OUT of lyceum in order to see the right registration page
    2. otherwise, the blog will be tied to _your_ lyceum account.
  3. enter the desired username for the administrative account on the new blog
  4. enter the new blog's subdomain (under "blog address")

then:

  1. from the terminal, ssh to freeculture.org
  2. Become root
    • cd /etc/apache2/conf.d/
    • Look at 200-$college.conf - make sure the "DocumentRoot /home/freecult/subdomains/" line is commented-out, and make sure "DocumentRoot /home/freecult/chapter-hosting/lyceum_test/src/lyceum/" is enabled.
    • run /etc/init.d/apache2 reload

now the blog is live. have a representative from the chapter create an account on lyceum, and give them admin powers for their new blog. do this by going to the $college.freeculture.org/wp-admin . click on users. search for the username that they created. tick it and give them admin permissions.

Moving an existing wiki to the farm

Prepare DB

  • First get a SQL dump
    • As per this warning, use --default-character-set=latin1 for really old wikis.
  • Then create a new DB for shared wordpress hosting
  • Then use the mysql CLI to import the dump
  • Then delete the SQL dump!

Prepare MW

  • move AdminSettings.sample into AdminSettings.php
  • Edit LocalSettings.php to be similar to the old one, but with the current DB
    • NOTE: If you did --default-character-set=latin1 for the mysqldump, you will want to set $wgDBmysql5=false in LocalSettings.php.
  • Comment-out the define("MW_INSTALL_PATH") at the top
  • Set IP to ~/chapter-hosting/$chapter/wiki/
  • cp -a ~/software/mediawiki/maintenance .
  • php maintenance/update.php maintenance/refreshLinks.php

Good! If it said it worked, then:

  • rm -rf maintenance
  • mv AdminSettings.php AdminSettings.example
  • edit LocalSettings.php and re-enable the define("MW_INSTALL_PATH")
  • Copy their old logo into ~/chapter-hosting/$chapter/files/fcWikiLogo.png
  • Remove the "#" before the $wgLogo setting in LocalSettings.php

Prepare Apache

  • Do the usual Apache preparation as per chapter hosting in general.