The MU forums have moved to WordPress.org

How I got Wordpress MU + Domain Mapping to work (3 posts)

  1. shapipo
    Member
    Posted 12 years ago #

    Since no other tutorials really helped me understand simply how to get those 2 to work together, and create a network of blogs from one installation and being able to admin them from one place, I decided to write this mini tutorial.

    READ WORD BY WORD, IT'S NOT MUCH (ENGLISH 2ND LANGUAGE FOR ME SO... SORRY)

    So I have a bunch of domains i want to create a blog for each 1.
    A Dedicated machine running Debian Lenny.
    on the machine: Latest PHP, MYSQL, APACHE2

    OK so install wordpress MU as recommended by other tutorials.
    (lets use mu for reference)

    Create a MYSQL database named mu.
    Create a MYSQL user called mu with all privileges and set a password for this user as well.

    on my server i put all websites in /var/
    so i cd /var
    download wordpress MU
    unzip or tar -zxvf wordpress (way to extract .tar.gz files on linux)
    change the extracted folder name to your desired name (lets use mu for example)
    Now you need to set folder permissions to 777
    with linux you just type chmod 777 /var/mu
    then chmod 777 /var/mu/wp-content

    I created an apache webserver with my main-domain.com as Server Name, and the Document Root is /var/mu/
    Restart Apache

    Go to your domain DNS settings Panel, not sure where you host your domain, I use Godaddy cause changes take effect really fast.

    So in A Records
    @ points to your server's ip
    in CNAME
    have www point to @

    now after all this is done and effects had been taken.

    go your http://main-domain.com

    you might be requested to change some file permission, if you not you will get to a page when you need to choose between subdomain and folders.
    Choose Folders
    Enter the mysql information you created before.
    click install or continue.

    should take about 30 seconds, then you will be provided with an ADMIN password, click on the login Button, and log in.

    now on your root directory, go to /var/mu/wp-content/mu-plugins/ and download the domain mapping plugin, you can google it to find it (EZ).

    Extract it, now cd to the plugin folder, copy the file sunrise.php to /var/mu/wp-content/sunrise.php , copy the file domain_mapping.php to /var/mu/wp-content/mu-plugins/domain_mapping.php
    now edit your /var/mu/wp-config.php file, Search for sunrise, when you find it, Delete the slash forwards before the "define" word to uncomment it and activate the plugin.

    this is how it should look

    // uncomment this to enable WP_CONTENT_DIR/sunrise.php support
    define( 'SUNRISE', 'on' );

    ________________________________

    So now domain mapping plugin is activated, login again to your main domain admin panel, go to blogs and create a new one, lets say blog1
    so now blog1 would be http://main-domain.com/blog1/

    log in to blog1 admin panel, now go to Tools >> Domain Mapping >
    and enter your 2nd-domain.com as a domain, then set it as primary domain.

    set DNS on your 2nd domain exactly how you set it on the first domain, A Record @ points to server ip, and CNAME www points to @.

    Create another apache web server, set /var/mu/ as document root, set
    2nd-domain.com as server name, and you can also add http://www.2nd-domain.com. to the Alternate virtual server names.

    Restart apache, now when go to your 2nd domain you should land in the blog1 homepage!!!

    This is probably not the most proper way, maybe for those who run their own servers and operation like me, Unfortunately it took me 4 days to get to this point where it's working and I can create many blogs with each separate domain name.

    Hope this helps to someone, if not then... idk, kthxbye.

  2. shapipo
    Member
    Posted 12 years ago #

    WOW MY ENGLISH IS BAD

  3. mercime
    Member
    Posted 12 years ago #

About this Topic