The MU forums have moved to WordPress.org

Bug: Specifying port messes up rewrite (16 posts)

  1. akbigdog
    Member
    Posted 18 years ago #

    I apologize if this is a duplicate post, but I couldn't find anything else in the WPMU forums having to do with ports.

    When a port is specified with the HTTP request, the RewriteRules get confused (even if the port specified is :80, the Apache default). For example, http://example.com:16080/joesblog will not work unless the domain value in wp_blogs is "example.com:16080".

    WordPress should not care what port the Web site is running on. Either the RewriteRules or the database query that checks for a blog's existence needs to be rewritten to accomodate using specific ports.

  2. akbigdog
    Member
    Posted 18 years ago #

    Has any effort been made to address this?

  3. jaseone
    Inactive
    Posted 18 years ago #

    Are you sure it is the rewrite rules? A cursory look at the rules doesn't seem to reveal any problems with them in that regard.

    Who would seriously want to run WPMU on a non standard port anyway? The only time that is usually done is when someone wants to host something over their home internet connection and hosting WPMU over such a connection doesn't sound like a good idea to me anyway.

  4. akbigdog
    Member
    Posted 18 years ago #

    No, I'm not sure it's the rewrite rules.

    I want to run an installation of WPMU on a non-standard port so that I can access my testing server at work from home. Port 80 is already occupied by another device, so I got pushed to a different port. I can access all the other Web sites on the server just fine, but it's just the WPMU site that gives an error.

    In a production environment, I wouldn't use an obscure port.

    But isn't 16080 the port used for VirtualHosts? That's a port other than 80... I don't know whether it can be considered 'non-standard'.

  5. rramaiah
    Member
    Posted 17 years ago #

    I'm having this same problem. Apache is running on 8080. I think I tracked down the problem. This line in wpmu-settings.php:

    $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'");

    doesn't properly account for the port. The port is specified in the database, but not in the $domain variable. This causes problems here in wp-signup.php:

    if( $current_blog->domain != $current_site->domain ) {
    header( "Location: http://" . $current_site->domain . $current_site->path . "wp-signup.php" );
    die();
    }

    wp-signup.php starts redirecting to itself and freaking out. Please let me know if there's a quick-fix for this. I doubt it so I think I'm just gonna setup Apache on 80.

  6. almt
    Member
    Posted 17 years ago #

    The problem is in wpmu-settings.php, near the top. It strips out the port:
    $domain = preg_replace('/:.*$/', '', $domain); // Strip ports

    If I comment it out, I can at least see the login pages. However, I'm unable to login to my admin pages. There is some other stuff that is not working.

  7. zappoman
    Member
    Posted 17 years ago #

    Hey Folks... I just blew the last 3 days fighting this exact same problem. I eventually found out that it's a known bug and the WordpressMU team doesn't currently plan on fixing it.

    See my thread on the exact same problem here...

    http://mu.wordpress.org/forums/topic.php?id=3064

  8. drmike
    Member
    Posted 17 years ago #

    Donncha has stated that he won't modify WPMu for different ports:

    http://trac.mu.wordpress.org/changeset/834

    http://trac.mu.wordpress.org/ticket/189

  9. zappoman
    Member
    Posted 17 years ago #

    The cool Dr. Mike, I get it... I just figured that I would cross-post so that others who came upon this thread would know the resolution.

  10. almt
    Member
    Posted 17 years ago #

    Thanks. That stinks though, I don't have the option to use port 80 right now. Fixing that one line got me further, but not complete enough. Any ideas what else needs to be fixed?

  11. lunabyte
    Member
    Posted 17 years ago #

    My only thought on this, is why? It's a url, right? What exactly is it causing to happen with :8080 (or whatever) tacked onto the url.

    Now I'm curious.

  12. almt
    Member
    Posted 17 years ago #

    With a :8080 port, it won't let me login with my admin account. Even though I can see it authenticated my password, I get redirected back to the login page. I thought it might be a cookie problem but that doesn't appear to be the case. Could be a configuration problem, I'm still looking.

  13. lunabyte
    Member
    Posted 17 years ago #

    It must screw something up somewhere, or it wouldn't have been protected against in the code. I don't know what, but something somewhere for sure. Donncha just doesn't code things or code against things to bask in the misery of a selected few.

    Then again, maybe they do, and this whole WP and MU is a world wide domination plot to get one big laugh out of the lemmings jumping off the cliff. :D

    /humor

  14. zappoman
    Member
    Posted 17 years ago #

    #ifdef IDLE_SPECULATION

    I haven't read through the code yet, but after messing around with a ton of mod_rewrite attempts on IIS with about a dozen different open source mod_rewrite tools, and finally giving up and switching to apache, and then running into this port problem, and now getting wpMU to work properly on Win/Apache/port:80... I have a few battle scars... and I think I have a theory why there is currently a dependency on port 80...

    My hunch is that MU is a pretty clean layer over top of standard WP, and it leverages the fact that with VirtualHosts and mod_rewrite, you can essentially layer just a little bit of user config magic over the same web site and get it to act correctly. I've only been playing with WP for a couple weeks, so I am definitely not an expert... but I've seen a ton of code in my day, and so far I'm pretty impressed with the elegance of the system.

    The kink appears to be that ports happen to add that extra layer of goofiness to both virtual hosts and mod_rewrite... after all the port part of the URI is kinda a third big toe anyway. (You really need big toes, they help you do a lot of things, and a third one is not such a bad idea, except when you want to buy shoes... they can be hard to fit.)

    Anyway, Donncha has volunteered to let me take a crack at fixing this if I really want to, so he can work on more important features... and maybe I'll take him up on that. But it won't be for a while until after I mess around with some of the other cool features of the WP/MU/bbP universe.

    Thanks.

    #endif // uh, yeah... to much C/C++ in my past

  15. lunabyte
    Member
    Posted 17 years ago #

    That doesn't sound out of the question. I haven't had a real "need" to run on a port other than 80, so I haven't had to dig in that area.

    To be honest, I probably won't for a while. At least for the foreseeable future.

    If you dig into it, and figure it out, sum it up if you get a few minutes (and remember by then).

  16. andrea_r
    Moderator
    Posted 17 years ago #

    zappoman, I think you are darn close. In fact, you are starting to sound like my hubby, Mr. Andrea .... er, I mean Ron. Except for the toe part. That's just creepy. :)

About this Topic

  • Started 18 years ago by akbigdog
  • Latest reply from andrea_r