• Resolved sdoss

    (@sdoss)


    I’m hoping to get some confirmation here that I am understanding what I’m reading re multi-site installation, and how/why it works, as well as ending with a couple of questions I’m still unclear on.

    Multi-site allows you to create/host more than one site in a single instance of WordPress. That’s easy.

    Multi-site can make use of ‘sub-domains’ or ‘sub-directories’. Also easy.

    If using a ‘sub-domain’ method:
    WordPress MUST be installed in the document-root directory, and Apache configured with a domain name pointing to WordPress
    Sites created in WordPress must also be mapped in WordPress to the desired domain (via a WordPress plug-in)
    DNS record of the desired domain points to the host server; Apache on the host server is configured to point to the WordPress domain, and WordPress, on recognizing the original domain request, points to the appropriate site.

    Am I right so far?

    If using a ‘sub-directory’ method:
    WordPress COULD be installed in a sub-directory of document-root, and Apache configured to point to this sub-directory
    Sites created in WordPress do NOT need mapping
    DNS record of desired domain points to the host server; Apache on the host server is configured to point to WordPress domain/site

    Now the question is, am I anywhere close??

    I’ve installed WordPress in a sub-directory of document-root, and activated the multi-site option as per the instructions posted here. (installed on a debian server, with apache and php 5.2.5) Because WordPress is in a sub-directory, my only option was to use sub-directories for my sites. My desire is to use WordPress to develop and serve the web pages without an obvious ‘redirection’ in the url. If someone goes to https://www.site1.com, I’d like the url to consistently read https://www.site1.com/page…

    So here’s the real question: If I want site 1 to be accessed via https://www.site1.com, and site 2 to be accessed via https://www.site2.com, and not have the url display a redirect, do I use sub-domain? Or can I use sub-directory? And if I can use either, can you point me to the documentation that tells me that? And how? And why?

    Apologies if the above sounds ignorant, but my eyeballs are bleeding after spending a week of searching/reading all I can find on multi-sites ??

Viewing 15 replies - 1 through 15 (of 47 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Apache’s configuration doesn’t change except in if you want to set up wildcard subdomains.

    The rest of the time, it’s just like it is for any website ??

    My desire is to use WordPress to develop and serve the web pages without an obvious ‘redirection’ in the url. If someone goes to https://www.site1.com, I’d like the url to consistently read https://www.site1.com/page

    Then you need to move WordPress up a level so it’s not in a subdirectory. You can KEEP subfolders as your set up, and use this plugin to map domains: https://www.ads-software.com/extend/plugins/wordpress-mu-domain-mapping/

    But no. You cannot map domains when WP is installed in a subfolder, unless you want everything to be sitename.com/foldername/

    And just to clarify:

    not sure why you included doamin mapping int here but it does not matter if the site is set up with subdomains or subfolders. You can map those subsites either way.

    And domain mapping is not required for subdomains at all.

    But if ultimately you;re going to map domains, you absolutely must put it in the root of the folder. After that, like I said above, subdomains or subfolder setup does not matter.

    But no. You cannot map domains when WP is installed in a subfolder, unless you want everything to be sitename.com/foldername/

    Actually, the domain mapping plugin will not let you map domains if the install itself is in a folder. ??

    Thread Starter sdoss

    (@sdoss)

    OK, so…if I want to keep the url ‘sacred’, then the domain must be mapped to the site in WordPress. And WordPress must be in document-root.

    If I choose to leave it where it is (in a directory under document-root), then I have to live with the url reflecting the re-direction.

    Ok, so to make sure I understand the whole url/mapping thang….

    IF I keep sub-directories and IF I map domains:

    https://www.site1.com has a dns record pointing to myserver.
    Apache on myserver is configured to go to WordPress when receiving a request for https://www.site1.com
    WordPress recognizes that https://www.site1.com is mapped to WordPress/site1 and somehow serves pages from this site.

    If I don’t map domains, and keep subdirectories, then the visible url would change from https://www.site1.com to https://www.mywordpress.com/site1

    Correct?

    And, btw,

    Actually, the domain mapping plugin will not let you map domains if the install itself is in a folder. ??

    If you’ve changed wp-config.php to set sunrise=on, and wordpress is in a directory, you can’t even get to the admin page…instead, there’s a lovely warning about virtual servers

    Thanks so much for your quick responses.

    If you’ve changed wp-config.php to set sunrise=on, and wordpress is in a directory, you can’t even get to the admin page…instead, there’s a lovely warning about virtual servers

    Yes, that’s what I was referring to. “It won’t let you map domains”.

    If I don’t map domains, and keep subdirectories, then the visible url would change from https://www.site1.com to https://www.mywordpress.com/site1

    Correct?

    Correct, but you will not be using the domain mapping plugin to do this. Cuz like we just went over – it will not let you.

    Make your life easier – put it in the root. Or even if it was on a throwaway domain in that subfolder (an add-on domain). It’s the fact that the home URL has a foldername in it that is the issue.

    Thread Starter sdoss

    (@sdoss)

    Got the go-ahead to move my wordpress installation up to the document root.

    First question: I’ve copied (not moved) my original installation and all sub-directories thereof up to where they need to be.

    I’ve changed the .htaccess file to start in root (RewriteBase /)

    I’ve changed wp-config.php to start in root ($base = ‘/”) and changed the current-site path (the main site in the network) to also start in root (define ( ‘PATH_CURRENT_SITE’, ‘/’ );

    I didn’t see anything in wp-settings.php that should change, nor in index.php

    wp-config still points to multisite turned on

    Apache config for https://www.mywordpress.com was changed to point to root

    So, I must be missing something, as I can attempt via a browser https://www.mywordpress.com/wp-admin, and I get the Apache default (It works!).
    Same as when I try /wp-login.php.

    I’m thinking something in my old network setup is still pointing to the original; i.e., my main site path points to the subdirectory where I had originally installed WordPress. I believe this has to now change to have a path of just ‘/’, and my other defined sites’ paths need to change as well.

    Any guidance will be greatly appreciated…..

    You don;t change anything in core files.

    you completely missed all the references in the database.

    Simply changing it in the config file, which works dandy on one site, completely fails in multisite, as the url is saved in multiple places.

    Thread Starter sdoss

    (@sdoss)

    Got that. As I hang my head in shame, am going to re-do the move. Maybe this time, if I follow instructions appropriately, it’ll work.

    There’s a reason for instructions, right ?? Will post back as soon as it’s up.

    Thanks for your patience.

    Thread Starter sdoss

    (@sdoss)

    Ok. Went back to step 1. Removed everything I copied into root; went back to original install. Per step 2 in ‘Moving WordPress’ documentation (codex.www.ads-software.com/Moving_WordPress) logged into wp-admin, went to Administration>Settings>General panel.

    I can see no box for WordPress address (URI).
    I can see no box for Blog address (URI).

    Any suggestions?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yeah. That doesn’t work in MultiSite. I’ve just updated the moving doc to have a Multisite entry.

    Multisite is far more complicated to move, as the database itself has multiple references to the server name as well as the folder locations.

    The best way to move Multisite is to move the files, edit the .htaccess (if the folder name containing Multisite changed), and then manually edit the database. Search for all instances of your domain name, and change them as needed. This step cannot yet be easily automated. If you’re moving Multisite from one folder to another, you will need to make sure you edit the wp_blogs entries to change the folder name correctly.

    It’s incomplete, but it’s a start.

    Thread Starter sdoss

    (@sdoss)

    Holy cow.

    So the only thing I missed on my first attempt is the database changes??

    The best way to move Multisite is to move the files, edit the .htaccess (if the folder name containing Multisite changed), and then manually edit the database.

    Is the .htaccess file the ONLY external file that needs to change? Or do I edit the wp-config.php file as noted above?

    Thread Starter sdoss

    (@sdoss)

    Ok. I’ve recopied all files/directories etc once again to my document-root directory. The .htaccess file was changed as I noted above. I went through each and every entry in the database, removing references to the sub-directory where I previously installed wordpress. I think I got them all, but have someone currently double checking that.

    I can hit my Admin screen by typing in <server ip>/wp-login.php. In the Admin, I can still see the two sites I’ve created (using the sub-directory process in the network) when I open the Sites option from the Super admin menu.

    I can get to the dashboard for the main site, but cannot view any of the pages.
    Back on the admin page, under ‘Sites’, when I mouse over the additional site name, I can ‘edit’ the site. But, I cannot get to the ‘backend’ or ‘visit’. I get the ‘page not found’.

    So, given that I’ve changed the .htaccess file correctly, and gotten all files/directories copied, and gotten all references in the database changed to be appropriate, what else can I look for?

    I’m gonna get this, eventually. Thanks in advance for any suggestions you may have.

    Now we’re getting somewhere. ??

    All that is left is making sure apache is reading that htaccess file, because your issues show that it is not.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Is the .htaccess file the ONLY external file that needs to change? Or do I edit the wp-config.php file as noted above?

    You mean this part?

    I’ve changed wp-config.php to start in root ($base = ‘/”) and changed the current-site path (the main site in the network) to also start in root (define ( ‘PATH_CURRENT_SITE’, ‘/’ );

    Yeah, if you moved the base that should change.

    Also maybe define('PATH_CURRENT_SITE', '/' );

    Thread Starter sdoss

    (@sdoss)

    Now we’re getting somewhere. ??

    Ok…..After ensuring that I’ve got Allow Override All in my Apache’s virtual host for *, I’ve got my dashboards back, and my page(s) in my subdirectory site….and I can see the pages in my main site ?? ?? ??

    Making progress here.

    Apache, on my server, is configured with the default virtual server, a virtual host designated as ‘*’, multiple virtual hosts for non-WordPress websites, and a virtual host for WordPress.

    The non-WordPress sites are in sub-directories of the document-root directory.

    WordPress is in the document-root directory.

    My problem is, the default server has the following directive

    RedirectMatch ^/$ /apache2-default/

    that I believe I’m hitting when I attempt to access my WordPress via the virtual host url: I get the Apache directory structure of /apache2-default :/

    So, I remove the redirectmatch directive from *, go to the browser, type in https://www.mywordpresssite.com, and get the home page of my main site. I type in https://www.mywordpresssite.com/wp-admin, and get the home page of my main site. I type in https://www.mywordpresssite.com/wp-login.php, and get the home page of my main site.

    I believe my problem is one of two things…either, my Apache configuration for my virtual host of https://www.mywordpresssite.com is jacked, or, I have a problem with the apache default server and wordpress operating out of the same document-root.

    Any suggestions?

    btw, in spite of the frustration, I’m having a blast with this ??

    Your config is jacked, becasue the the default host can be served out of the same doc-root as WP. (I use this myself).

    ??

    At the very least, we’re good for telling you what it’s not. ??

Viewing 15 replies - 1 through 15 (of 47 total)
  • The topic ‘Trying to simplify/understand multi-site’ is closed to new replies.