The MU forums have moved to WordPress.org

SOLVED: Login Problem and multiple domains (41 posts)

  1. cafespain
    Member
    Posted 11 years ago #

    Well, I finally built up the guts to upgrade to the latest nightly build and so far it's gone ok.

    So with my new found bravery, I decided to attempt hosting multiple domains with varying success.

    I have the blog http://blog.clearskys.net currently working and being hosted by the cafespain.com wpmu system. The front end seems to function ok, and I can post to the blog with Performancing and Qumana with no problems at all.

    HOWEVER: and this is the biggie, I can't login to the administration system as either the user or the admin user. All the other sites work ok (but they are all xyz.cafespain.com) so I think it's something to do with the login cookies.

    Has anyone already solved this or know the rough location I should be looking to check if it is a cookie problem? Any advice would save me a lot of time hunting around php file.

    Many thanks in advance
    Barry

  2. cafespain
    Member
    Posted 11 years ago #

    As if by magic...
    A moment of inspiration sent me heading to the database.
    I added a new site to the wp_site table with the main domain clearskys.net in it and then changed the site id in the wp_blogs table for the relevant blog to the new sites id.

    Voila, access to the admin pages.

  3. cafespain
    Member
    Posted 11 years ago #

    Oh and don't forget to duplicate the records in the wp_sitemeta table for the new site or you won't have access to any themes (oops).

  4. andrewbillits
    Member
    Posted 11 years ago #

    So basically, running multiple sites off of one wpmu install is now possible?

  5. cafespain
    Member
    Posted 11 years ago #

    I haven't tried completely distinct WPMU sites (each offering blogs of their own) as I've been playing with blogs for existing domains with their own sites.
    The steps I take for the two I've setup so far are:

    1. edit the Domain server for the domainname you are interested in and add a CNAME record for something like blog.domainname.com which points to your WPMU installation.
    eg. I added the CNAME blog.clearskys.net to the clearskys.net DNS settings and set it to point to cafespain.com

    2. Create a blog in your WPMU installation - it doesn't matter what you call it for now - use the existing admin system to create it.

    3. Add a record in wp_site with the the domain of the new blog. eg. in this case clearskys.net and set the path to /

    4. Duplicate the wp_sitemeta entries for your new site (insert into wp_sitemeta (site_id, meta_key, meta_value) SELECT x, meta_key, meta_value FROM wp_sitemeta WHERE site_id = 1 (change x to the id of the new site record created at step 3.

    5. Modify the record for the blog you created in wp_blogs and change the domain to the CNAME you created in step 1 (in this case blog.clearskys.net) and change the site_id to the id of the site record in step 3.

    6. Modify all the records in wp_xx_options (where xx is the record number of your blog in step 5) that have the domain path, so that it is the same as that set in step 5 (blog.clearskys.net).

    7. Wait a bit for the DNS changes to propagate and access the website at blog.clearskys.net, voila one wordpress blog, with it's own domain running off an installation of WPMU at a different one.

    It should only take a short step to have a http://www.domainname.com to work just as easily.

    Hope those steps help someone, i've been working on it all afternoon.

  6. mrjcleaver
    Member
    Posted 11 years ago #

    Did you repoint the blogs.dir so attachments for each domain are kept separate?

  7. cafespain
    Member
    Posted 11 years ago #

    No, at present everything else has been kept as standard.
    Uploads go the the directory in blogs.dir for the specific blog regardless of the domain the blog is using (as all are technically still cafespain.com blogs).

  8. pumpkinslayer
    Member
    Posted 11 years ago #

    Fantastic, thanks for sharing that cafespain.

    An administrators dream for those running multiple installs of wordpress.

  9. bambam4479
    Member
    Posted 11 years ago #

    Hey Cafespain,

    Thank you so much for the *hint* on how to get this working. I tried wrapping my head around this for a long time and never found a working solution. One thing I'm finding is that I'm not able to login to the new site once its being hosted in the MU db. Just wondering if you've run into the same problem

  10. cafespain
    Member
    Posted 11 years ago #

    Had the same login problem, It was fixed quite easily by adding the main domain as a site to wp_site - see the second post by me above.

  11. MazZziKa
    Member
    Posted 11 years ago #

    i want members when register at mydomain.com they can choose for the domain mydomain.ocm . mydomain1.com ,mydomain2.com .. so the blog link will be
    mydomain.com/blog/blogname
    or (not and )
    mydomain1.com/blog/blogname
    or (not and )
    mydomain2.com/blog/blogname
    ... it is like giving a hosting blog service for your friends domains and give the ability to ur friends members to have a blog on ur wpmu installation but with thier domain
    .. sorry for my bad english ..

  12. stutley
    Member
    Posted 11 years ago #

    Wauw! Thanks, cafespain! You just saved a lot of us a bunch of time and headaches! :)

  13. MazZziKa
    Member
    Posted 11 years ago #

    is this modification for what i want ..?? need help plz

  14. agenturblog
    Member
    Posted 11 years ago #

    Sounds pretty smart.

    My ideal world would look like this:

    Allowing users to create new blogs on my MU installation. During this process they should be able to enter a subdomain and choose from a dropdown between one of lets say 20 possible domains, like blogs1.com, blogs2.com etc.

    So the user has complete freedom to select his combination of subdomain and MU domain.

    Any idea how this could be accomplished?

    Thank you guys!!

  15. poing
    Member
    Posted 11 years ago #

    cafespain:

    Thank you for sharing your solution - I did something similar (plus adding an Alias in the webserver), and it appears to work, I just have one concern and wanted to find out if you are experiencing the same:

    If I now go the SiteAdmin on the main WordPress MU domain, I do not see the blog any more - most likely since this menu is tied to the main site URL. Does it show in your SiteAdmin menu?

    I am using the MU 1.0 release.

    Thanks,
    /Frank

  16. cafespain
    Member
    Posted 11 years ago #

    Hi
    I noticed that too, and thought I'd messed up big time.
    It makes sense, however, that if you login as an admin of, say, cafespain.com you will see x.cafespain.com websites and not y.fredsdomain.com websites.

    So, I made a "Master" blog on each domain I added (just a blog i control and won't feel bad logging into). If you then login at your master blog with your original admin username and password, you will get the Siteadmin menu in the admin section and you can then administer all the blogs under that domain (fredsdomain.com) but not those of the others (cafespain.com) - It's a bit of a hassle to have to keep loging in and out at each domain, but still easier than 20+ wordpress installs.

    Hope that made sense....

  17. poing
    Member
    Posted 11 years ago #

    cafespain: That's what I figured - it makes perfect sense, even though it complicates things a litte.

    Well, in any case, maitaining one code base is much better vs. maintaining several. And re: having to login multiple times, I was actually able to use one account on all of the blogs (and if you check the "remember me" box during login, you remain logged in).

    I am using this to migrate several blogs (each with their own domain) to a joint server. I basically set each blog domain up as a subdomain first, then change the name of the subdomain everywhere and add the additional site. It appears to be working so far.

    Thanks for the help,
    /Frank

  18. johnol
    Member
    Posted 10 years ago #

    Cafespain, thank you for beginning the work on this. I've followed your steps but am not experiencing the same magic as I've seen for your sites. You've done it - so I know it is possible - but I'm wondering if there's something else I'm missing. For example which are you using: the "directory" (ie http://www.blogsite.com/myblog) method for Wordpress or the "subdomain" (ie myblog.blogsite.com) method? Your help is appreciated. -J

  19. johnol
    Member
    Posted 10 years ago #

    Cafespain, your steps are exactly as they should be! I discovered an .htaccess file I had placed into my domain MONTHS ago that I had forgotten which was interfering with the process. Once I fixed that, the whole thing worked beautifully! You are a genius! Thanks again for this!

  20. stratoextra
    Member
    Posted 10 years ago #

    Thanks Cafespain!
    I spent hours on this one...
    Sadly - for me - that's not very convenient -- I have to administrate about 20 Wordpress-Blogs (each on different domains, same machine) and wanted to switch to WPMU to make life easier. But if I have to use one admin-backend for each blog, I can leave it as-is.

    What do you think, am I just too excentric or is this an issue?

  21. danielfrey
    Member
    Posted 10 years ago #

    cafespain - this worked like a charm! I've been looking for a solution like this for a few weeks.

    Did you, or anyone else who implemented this have any issues with permalinks no longer working as expected? With no permalink format set, everything's ok. I want to use the /%postname%/ format, but I get a 404 error, "The requested URL /wordpressmu/index.php was not found on this server.". I get the same error with any other permalink format... maybe a .htaccess problem?

    Any thoughts?

  22. djfrey
    Member
    Posted 10 years ago #

    Ended up fixing this - if you create a new site, and the main blog for that site is in a subdirectory named "blog", you have to set the subdirectory of the site to / instead of /blog/. Otherwise you end up with permalinks formed like "http://mysite.com/blog/blog/permalink-name". This was probably in the directions and I just overlooked it.

    Also, you don't need to change the blog site ID in the wp_blogs table if your blogs exist on the same server. As long as a site exists with the correct doman and path information, the blog will work correctly, with the extra added bonus of being visible in the main blog admin menu. The only thing that may not work is the "backend" link, you might have to access that the way described above.

  23. aspentreemedia
    Member
    Posted 10 years ago #

    Thanks cafespain, I'm about 95% good to go with my mu set up with multiple domains. I'm having a problem with pages though. The only page that works is the default about page, any new pages that I add seemed to be formatted correctly, http://blog.domain.com/new-page/, but when I click on any of them it takes me to the signup form.

    I can go to the pages in question by using ?page_id=6.

    I'm using Windows 2003 Server, Apache 2, PHP5, MySQL5, mu 1.0

    Thanks for any insights anybody might have.

  24. guysteels
    Member
    Posted 10 years ago #

    Hi everyone,

    I have been playing around with the solution of cafeinespan and it all works fine. I have now 1 MU package running which serves several blogs on several domains e.g. blog.domain1.com, support.domain2.be, ...

    What I haven't been able to do however is using several top-level domains (e.g. http://www.domainname.com) in that same MU package. The setup works fine ... Instead of updating the DB with a custom subdomain (blog.domain.com) I updated it with the top level domain with the www included (www.domain.com). The setup works fine, you can view the blog, add posts and pages. What does not work however is the editing pages/posts. Modifications dont show up.

    Dunno if anyone tried this before or has a solution. Just posting this here as a reference. I currently solved it by transferring my old blogs which were hosted on a toplevel domain to the MU package, and adding a redirect from the top level domain to a subdomain.

    Guy

  25. ryanfitzer
    Member
    Posted 10 years ago #

    I'm also trying to do this with top level domains. Basically, I want to be able to have every new blog created run on a unique top level domain. Any ideas?

  26. lunabyte
    Member
    Posted 10 years ago #

    Point the DNS to the right place, meaning where you're hosted.

    Add to the virtual host for that site in the apache config file:
    ServerAlias *.yourdomain.tld
    ServerAlias *.yourdomain2.tld

    and so on, and so forth.

    Add each one into the wp_sites table, and then update the site_id for the blog you want to be on domain 1, to match the site_id for that domain.

    Simple. Effective. Works like a champ.

  27. ryanfitzer
    Member
    Posted 10 years ago #

    Thanks for the help! I'm going to give this a whirl. Little by little I'm wrapping my head around it.

  28. ryanfitzer
    Member
    Posted 10 years ago #

    My shared host (1and1.com) doesn't allow access to "httpd.conf". Does this mean there is no hope?

  29. ryanfitzer
    Member
    Posted 10 years ago #

    I did all the other steps you outlined. My new domain is pointing to my base wpmu install "originaldomain.com/wpmu/". I added the new domain to my wp_site table and it gave a id of "4". I then went into the wp_blogs and changed the blog's site_id to "4" from "1". Navigated to "newdomain.com/" and got the "No WPMU site defined on this host." page. Is this caused by the fact that I can't edit my "httpd.conf" file?

  30. lunabyte
    Member
    Posted 10 years ago #

    Yes, but you can have your host add it for you.

    Some allow you to "park" a domain from your control panel, which essentially does the same thing.

About this Topic

  • Started 11 years ago by cafespain
  • Latest reply from Cyrian