WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] multiple Multisite installs on single IP? (28 posts)

  1. bdoreste
    Member
    Posted 4 years ago #

    Is anyone running multiple multisite installations running on a single IP address? I would like to set up several multisite installations, however, I only have one IP address at my disposal.

    The catch - I want to use Donncha's WordPress MU Domain Mapping plugin to map multiple domains per installation.

    I want to set up groups of installations, so that each group will have its own separate database and admin rights. Each install would have multiple domains mapped to it. If one installation needs to be taken off-line (or breaks), then the other installs will still function.

    any thoughts? is this possible?

    I am using 3.0 RC2; I have the following lines in my wp-config.php:

    define( 'WP_ALLOW_MULTISITE', true );
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'mysite1234example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    my apache config is here (with wildcard):

    <VirtualHost 192.168.0.0>
            ServerName mysite1234example.com
            ServerAlias www.mysite1234example.com
            ServerAlias *.mysite1234example.com
            DocumentRoot /storage/www/mysite1234example.com
            ServerAdmin webmaster@localhost
            LogLevel warn
            ErrorLog /storage/logs/mysite1234example.com/error_log
            CustomLog /storage/logs/mysite1234example.com/access_log combined
            ServerSignature Off
    
            <Directory />
                    Options FollowSymLinks
                    AllowOverride All
            </Directory>
            <Directory /storage/www/mysite1234example.com>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>
    </VirtualHost>

    and I have Matt’s line in for the wildcard DNS in my zone file here:

    ;wildcard dns and subdomain for wordpress multi site
    ;http://ma.tt/2003/10/wildcard-dns-and-sub-domains/
    *. mysite1234example.com. 14400 IN A 192.168.0.0
  2. kevin2i
    Member
    Posted 4 years ago #

    Yes, you can run multiple multi-site installs from a single IP. Actually, the IP addresses don't matter and <VirtualHost *:80> works fine. (Works for me using apache2 on fedora, now using amazon ec2 with ubuntu LTS)

    You can also catch subdomains before they hit wordpress if you have a specific directory that isn't a wordpress site. Use a separate VirtualHost listing before the wildcard listing.

    <VirtualHost *:80>
    ServerName notwp.mysite1234example.com
    DocumentRoot /storage/www/mysite1234example.com/notwp
    etc . . .

    <VirtualHost *:80>
    ServerName mysite1234example.com
    ServerAlias http://www.mysite1234example.com
    ServerAlias *.mysite1234example.com
    etc . . .

  3. kevin2i
    Member
    Posted 4 years ago #

    I should add, continue with additional listings:

    <VirtualHost *:80>
    ServerName example2.com
    ServerAlias http://www.example2.com
    ServerAlias *.example2.com
    DocumentRoot /storage/www/wpinstall2
    etc . . .

    <VirtualHost *:80>
    ServerName example3.com
    ServerAlias http://www.example3.com
    ServerAlias *.example3.com
    DocumentRoot /storage/www/anotherwpinstall
    etc . . .

  4. bdoreste
    Member
    Posted 4 years ago #

    ok, so ALL non-WP sites on the same IP in your apache config need to be listed in before the WP sites, right?

    how do you point the domains over to the IP in your DNS?

    for example:

    (Install 1 - IP 192.168.0.0)
    mainsite123.com; also hosts the following domains
    - domain123.com
    - domain456.com
    - domain789.com

    (Install 2 - IP 192.168.0.0)
    mainsite456.com; also hosts the following domains
    - domain987.com
    - domain654.com
    - domain321.com

    Obviously, you need to set up a DNS zone file for mainsite123.com and for mainsite456.com to point to IP 192.168.0.0

    How does domain123.com know to point to Install 1, and not Install 2, and vice versa, domain987.com know to point to Install 2 and not Install 1?

    Do you simply set an A-record to point each of the domains under the main domain to the proper IP, or do they each need their own specific zone file?

  5. bdoreste
    Member
    Posted 4 years ago #

    Okay, I was able to think about this some more... is this a legit Apache config for mixing multiple non-WP and WP installs on a single IP address?

    # non-WP Install
    <VirtualHost 192.168.0.0>
            ServerName foobar123.com
            ServerAlias www.foobar123.com
            ServerAlias *.foobar123.com
    
            DocumentRoot /storage/www/foobar123.com
            ServerAdmin webmaster@localhost
            LogLevel warn
            ErrorLog /storage/logs/foobar123.com/error_log
            CustomLog /storage/logs/foobar123.com/access_log combined
            ServerSignature Off
    
            <Directory />
                    Options FollowSymLinks
                    AllowOverride All
            </Directory>
            <Directory /storage/www/foobar123.com>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>
    </VirtualHost>
    
    # WP Install number 1
    <VirtualHost 192.168.0.0>
            ServerName mainsite123.com
            ServerAlias www.mainsite123.com
            ServerAlias *.mainsite123.com
    
            ServerAlias domain123.com
            ServerAlias www.domain123.com
            ServerAlias *.domain123.com
    
            ServerAlias domain456.com
            ServerAlias www.domain456.com
            ServerAlias *.domain456.com
    
            ServerAlias domain789.com
            ServerAlias www.domain789.com
            ServerAlias *.domain789.com
    
            DocumentRoot /storage/www/mainsite123.com
            ServerAdmin webmaster@localhost
            LogLevel warn
            ErrorLog /storage/logs/mainsite123.com/error_log
            CustomLog /storage/logs/mainsite123.com/access_log combined
            ServerSignature Off
    
            <Directory />
                    Options FollowSymLinks
                    AllowOverride All
            </Directory>
            <Directory /storage/www/mainsite123.com>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>
    </VirtualHost>
    
    # WP Install number 2
    <VirtualHost 192.168.0.0>
            ServerName mainsite456.com
            ServerAlias www.mainsite456.com
            ServerAlias *.mainsite456.com
    
            ServerAlias domain987.com
            ServerAlias www.domain987.com
            ServerAlias *.domain987.com
    
            ServerAlias domain654.com
            ServerAlias www.domain654.com
            ServerAlias *.domain654.com
    
            ServerAlias domain321.com
            ServerAlias www.domain321.com
            ServerAlias *.domain321.com
    
            DocumentRoot /storage/www/mainsite456.com
            ServerAdmin webmaster@localhost
            LogLevel warn
            ErrorLog /storage/logs/mainsite456.com/error_log
            CustomLog /storage/logs/mainsite456.com/access_log combined
            ServerSignature Off
    
            <Directory />
                    Options FollowSymLinks
                    AllowOverride All
            </Directory>
            <Directory /storage/www/mainsite456.com>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>
    </VirtualHost>
  6. The catch - I want to use Donncha's WordPress MU Domain Mapping plugin to map multiple domains per installation.

    Yeah, there's the catch. ;) IP addresses are dirt cheap, it'd make your job a LOT easier. Downside of what you've got: things will start slowing down the more domains you add.

    You've almost got it above. For each virtual host pointing to its own doc root, something like this:

    # WP Install number 2
    <VirtualHost 192.168.0.0>
            ServerName mainsite456.com
            ServerAlias http://www.mainsite456.com
            ServerAlias *.mainsite456.com,domain987.com, domain654.com, domain321.com
    
            DocumentRoot /storage/www/mainsite456.com
            ServerAdmin webmaster@localhost
            LogLevel warn
            ErrorLog /storage/logs/mainsite456.com/error_log
            CustomLog /storage/logs/mainsite456.com/access_log combined
            ServerSignature Off
    
            <Directory />
                    Options FollowSymLinks
                    AllowOverride All
            </Directory>
            <Directory /storage/www/mainsite456.com>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>
    </VirtualHost>

    You only need those extra wildcards if you're running multiple networks in one install. If you had an IP address for each install, you can put a wildcard in there, so ANY domain tossed at each IP will be caught by WP.

    I talked about this over the weekend at WordCamp Chicago. See slides here:
    http://www.slideshare.net/AndreaRennick/domain-mapping

    Specifically slides 19 thru 21.

  7. bdoreste
    Member
    Posted 4 years ago #

    [bows, as I received a reply from Andrea ;-)]

    Okay, so I only need the wildcard for the main site doc root, and not all of the other domains?

    I have set up two A-records in Godaddy DNS for the main site domain:

    @.mainsite456.com -> 192.168.0.0
    *.mainsite456.com -> 192.168.0.0

    where the second one is the wildcard (taking the place of what Matt has described at: http://ma.tt/2003/10/wildcard-dns-and-sub-domains/)

    I have followed Steps 1-3 on Otto's post at:
    http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/

    My hang-up at the moment is getting the "Tools > Domain Mapping" menu option to show up. As of now, my admin panel DOES NOT display it.

    I have already created a second blog, but I don't have a Tools > Domain Mapping menu to see it.

    what gives?

  8. bdoreste
    Member
    Posted 4 years ago #

    I should mention that I installed the trunk version of the domain mapping plugin for WP3.0 as Otto suggests, and not the version which is on the wordpress plugin download page.

  9. Make sure domain-mapping.php (the plugin file) is in the mu-plugins folder, NOT the usual plugins folder. If you don't have a mu-plugins folder, make one. :)

    You shoudl also see a domain mapping plugin under the Super Admin menu.

    Okay, so I only need the wildcard for the main site doc root, and not all of the other domains?

    Yes that's right, becasue you're not using subdomains on the domains of the mapped blogs.

  10. bdoreste
    Member
    Posted 4 years ago #

    yep, I created a /wp-content/mu-plugins/ folder, and put the domain-mapping.php in it. sunrise.php is in /wp-content/

    file permissions on the mu-plugins folder are drwxr-xr-x, and permissions on sunrise.php and domain-mapping.php are -rw-r--r--

    define( 'SUNRISE', 'on' );
    is listed immediately after the multisite code in wp-config.php

    under "Super Admin > Domain Mapping", I have selected the 2nd and 3rd options for "Permanent redirect (better for your blogger's pagerank)" and "User domain mapping page", but have left the 1st and 4th options for "Remote Login" and "Redirect administration pages to blog's original domain (remote login disabled if redirect disabled)" unchecked.

    I'll remove the wildcards on the mapped blog domains; thanks Andrea!

  11. bdoreste
    Member
    Posted 4 years ago #

    Otto was able to clue me onto what I was missing; I needed to log onto the wp-admin.php of the domain which I wanted to map, not the wp-admin.php of the main blog.

    Once I logged into the wp-admin.php of the blog I wanted to map, and then the “Tools > Domain Mapping” menu option was available to me. it wasn't intuitive to me that I needed to log out of the main site admin, and then log into the mapped blog admin.

    Okay, to recap: within the wp-admin page of the main blog, go to "Super Admin > Sites" and add a site. For example, if you want to add a mapped domain called "domain123.com", enter "domain123" under "Add Site > Site Address" (it will say "domain123.mainblog123.com")

    Then, log out of the main site admin, and log into domain123.mainblog123.com/wp-admin.php Once inside of the admin for the new blog, then go to “Tools > Domain Mapping” and set domain123.com as primary domain. That should do it!

    did I miss anything? check out the related thread on Otto’s blog;
    http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/

    It seems to be working, except that the Sociable plugin is puking some errors on the mapped domain blog... will try to pin that problem down next.

    thanks again!

  12. Yes, there's alos a menu under the Super Admin where you can map domains. It sounded from above that you were checking from the blog you wanted to map.

    I wrote about it a while ago here:
    http://wpwebhost.com/using-multiple-domains-with-wordpress-mu/

    It's pretty much exactly the same in 3.0.

  13. rahul286
    Member
    Posted 4 years ago #

    I am not getting this?

    Why there are 3 config options...

    define( 'WP_ALLOW_MULTISITE', true );
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );

    And there was also a
    define( 'VHOST', true );

    Which is now deprecated by - define( 'SUBDOMAIN_INSTALL', true );

    Any clues?

    Thanks,
    -Rahul

  14. define( 'WP_ALLOW_MULTISITE', true );

    This turns on the Network menu item.

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );

    the first line lets WP know we're running multiple sites.
    The second tell WP what kind of sites they are.

    And there was also a
    define( 'VHOST', true );

    Which is now deprecated by - define( 'SUBDOMAIN_INSTALL', true );

    The deprecated line is *only* if you were running MU. If you have a single WP install and then enabled the network, you will never get this line.

  15. rahul286
    Member
    Posted 4 years ago #

    Thanks Andrea. I am all clear now. :-)

    By the way, I read in few thread that domain mapping can be done without domain-mapping-plugin itself.
    Can you please point out to any good tutorial which also highlights pros n cons of using domain mapping without any plugin.?

  16. There isn't one that I know of. Not that highlights the pros & cons.

    I recommend using the plugin. It takes care of your logins & redirects, plus no manual database edits.

  17. rahul286
    Member
    Posted 4 years ago #

    @Andrea
    Thanks for the answer. :-)

    At the moment, I am using domain-mapping and its working fine so I better stay with it.

  18. James
    Member
    Posted 3 years ago #

    Maybe this belongs to a separate thread, if so, feel free to slap my hand...lightly if you please!

    I am also trying to set up multiple multi sites. The first one is in the root directory. Let's call it site.com. The next one is super.site.com in a subdirectory called super. The issue I ran into was that when I tried to activate the network it said that another network had been detected and the new network was not activated.

    Any ideas how to proceed?

  19. James, Are you using the same database?

  20. James
    Member
    Posted 3 years ago #

    No, they are separate installations on separate databases. Would it better or easier to do it differently?

  21. I'm not sure which is better, but if it's detecting a network, double-check the wp-config.php file on the SECOND site and make sure it's pointing to the right DB.

  22. jayc
    Member
    Posted 3 years ago #

    Have 2 multisite installations on one IP (DV):
    siteone
    sitetwo

    Everything worked fine until today when Media Temple enabled webstats on sitetwo (it was always active on siteone - the 'primary' site). Now sitetwo will not display subdomains but instead displays-

    'link broken' page with this url - http://siteone.com/wp-signup.php?new=subdomainname.sitetwo.com

    Can anyone help? MT can't.

    Thanks

  23. bdoreste
    Member
    Posted 3 years ago #

    ok, here we go again...

    I am trying to set up another multi-site install, but something isn't cooperating with me.

    Everytime I place the domain_mapping.php file into the mu-plugins folder, OR insert the following code in wp-config:

    define( 'WP_ALLOW_MULTISITE', true );
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    
    define( 'SUNRISE', 'on' );

    my main wordpress install times out and will not load any pages.

    what gives? I have followed the directions in my own post here, and on Otto's page at: http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/

  24. Where did you put sunrise.php?

    If you're not using the 3.1-RC2 build, I would suggest a new post in the MultiSite section, BTW :)

  25. bdoreste
    Member
    Posted 3 years ago #

    sunrise.php is in /wp-content/ :)

    I tried using both the 0.5.1 and 0.5.3 versions of the domain mapping plugin, but no dice.

    I should note that this install is being run on a domU virtual machine under Xen.

    I am using WP 3.0.4, but posted here since I originally started this thread back in June... if anyone has successfully set up domain mapping with 3.1-RC2 or 3.0.4 please let me know!

  26. bdoreste
    Member
    Posted 3 years ago #

    it looks like I was able to get it working! :)

    I forgot to add /blogs.dir/ and to enable the Network menu item ( Administration > Tools > Network ); step 4 at:
    http://codex.wordpress.org/Create_A_Network

    thanks again!!!

  27. bdoreste
    Member
    Posted 3 years ago #

    darnit... the "Domain Mapping" option is not showing up under Super Admin in the base install... what am I missing???

  28. Yeah, but you're not using the alpha anymore. A LOT of people get this working just fine :)

    Post here: http://wordpress.org/support/forum/multisite

    I'm closing this since the ORIGINAL issue was resolved, and while this is the same, we're on supported MultiSite 3.0.4 now :) It does make a difference (and more people will see it there).

Topic Closed

This topic has been closed to new replies.

About this Topic