Setting up mp-wp

mp-wp has recently been genesised, and if you're reading this, then it's approximately working. This article doesn't touch how mp-wp works, but simply linearizes my back-and-forth experience setting up the site.

1: Gentoo Setup

  1. Get yourself a Gentoo box to host the website. If you have no intention using Gentoo, then much of this guide will still help, but there's no warranty (as usual, sadly).
  2. Set up your hostname by editing /etc/conf.d/hostname:
    hostname="blog"
  3. Add your hostname to /etc/hosts to make apache happy:
    127.0.0.1 blog
  4. Create a user and a directory for the site:
    useradd wpuser
    mkdir -p /www/blog
    chown -R wpuser:wpuser /www/blog

2: Flags, Masks, and Emerging

  1. Establish the following USE flags:
    www-servers/apache apache2_modules_access_compat
    dev-lang/php apache2 mysql
  2. Establish the following package mask:
    >dev-lang/php-5.6.34-r1
  3. Now emerge the software:
    $ emerge --ask apache php mysql

3: Apache

  1. Put the global server name in /etc/apache2/vhosts.d/default_vhost.include to shut Apache up:
    ...
    ServerName blog.esthlos.com
    ...
  2. While in /etc/apache2/vhosts.d/default_vhost.include, set the DocumentRoot and Directory of the website:
    ...
    DocumentRoot "/www/blog"
    
    # This should be changed to whatever you set DocumentRoot to.
    
    ...
  3. Enable PHP support in Apache in /etc/conf.d/apache2:
    APACHE2_OPTS="... -D PHP ..."

4: MySQL

Here we follow the Gentoo wiki guide.

  1. Set the root password and initialize the database:
    emerge --config =dev-db/mysql-[version]
  2. Start MySQL:
    rc-service mysql start
  3. (Optional) Make MySQL start on boot:
    rc-update add mysql default
  4. Create a SQL database, following the wordpress guide:
    $ mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 5340 to server version: 3.23.54
    
    Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
    
    mysql> CREATE DATABASE wp;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> GRANT ALL PRIVILEGES ON wp.* TO "wpuser"@"localhost"
        -> IDENTIFIED BY "password";
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> EXIT
    Bye
    $

5: mp-wp

  1. Obtain the genesis of mp-wp, along with hanbot's key, and press the thing into its parts.
  2. Move the pressed contents (not the directory itself)
    into the directory you created for the site, then change permissions:
    $ mv mp-wp/* /www/blog
    chown -R wpuser:wpuser /www/blog
  3. There are three ~.htaccess~ files:
    1. Configure .htaccess to allow from IPs you wish to administrate from:
      ...
      
      Order deny,allow
      Deny from all
      Allow from ...
      
      ...
    2. Configure wp-admin/.htaccess similarly to the above, but for the entire directory:
      Order deny,allow
      Deny from all
      Allow from ...
      
    3. Configure wp-includes/js/.htaccess

    to allow all, so that users can access mp-wp's Javascript (I believe this is correct: check with your local representative).

  4. Fill in your wp-config.php like so:
    ...
    /** The name of the database for WordPress */
    define('DB_NAME', 'wp');
    
    /** MySQL database username */
    define('DB_USER', 'wpuser');
    
    /** MySQL database password */
    define('DB_PASSWORD', '');
    
    /** MySQL hostname */
    define('DB_HOST', 'blog');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    ...

Bonus Round: MathJax

  1. Get a copy.
  2. Place the copy in //wp-includes/mj
  3. Give Apache read permissions on the directory.
  4. Place the following in the element in you theme's header.php:
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
          extensions: ["tex2jax.js"],
              jax: ["input/TeX","output/HTML-CSS"],
    	      tex2jax: {inlineMath: [["$","$"],["\(","\)"]]}
    	        });
    		</script>
    <script type="text/javascript" src="/wp-includes/mj/MathJax.js?config=TeX-AMS_HTML"></script>
    

Leave a Reply