Why has my WPMU installation started trying to serve a subdomain site from the wrong directory, and

I was called out of the country for a few weeks after the Independence Day holiday and deferred further development on a subdomain site that had been working just fine. Technically, I was still working out how to make membership work for the site, but was in no hurry. Sometime in the interim, the subdomain site http://sub.domain.com/ has stopped serving correctly, resulting in that lovely "Index of...cgi-bin/" page and no connection to the wp-login (404 error). http://www.domain.com/ serves correctly, the database driving the Multisite installation appears to have all relevant tables, wildcard subdomains haven't changed, and http://test.domain.com/ forwards to http://domain.com/wp-signup.php?new=test as expected.

But, very specifically, the Apache error log shows for the 21st of Jul (and later) - entries like:
[Sun Jul 21 21:38:14 2013] [error] [client 98.*.*.*] attempt to invoke directory as script: /home/subuser6/public_html/cgi-bin/, referer: http://sub.domain.com/
[Sun Jul 21 21:38:21 2013] [error] [client 98.*.*.*] File does not exist: /home/subuser6/public_html/login

My WordPress Multisite [subdomain] installation is in the following directory:
/home/admin/public_html

Any thoughts on how or where I can go to begin to put this right?

  • Devin

    Thank you for the welcome back. I should have mentioned that I had network-disabled all plugins, including Domain mapping, with no change in the page service.

    The wp-config.php file appears just fine. A portion from after the definitions is provided below for reference.

    Additionally, from what I can see, the .htaccess may also be fine. As a troubleshooting step, I commented out the "IfModule mod_rewrite.c" statement with no change with the site's behavior.

    Given the above, I keep suspecting that somehow an update or some other management on the host 'routed' the subdomain to the subdomain's owner's (subuser6) public_html directory. The VPS uses WHM and CPanel but I cannot find a corresponding setting or 'override' that may have caused the behavior.

    Thank you for your continued assistance and information.

    Devin.

    /* Multisite */
    define('WP_ALLOW_MULTISITE', true);
    
    /* Multisite written after initial installation of MultiSite. */
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'motleisolutions.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /* WordPress MU Domain Mapping network plugin. */
    define( 'SUNRISE', 'on' );
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    .htaccess:

    # To set your custom php.ini, add the following line to this file:
    # suphp_configpath /home/yourusername/path/to/php.ini
    
    # BEGIN WordPress
    #<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    #</IfModule>
    
    # END WordPress
  • Devin

    On another note, I logged onto the cPanel as subuser6 and looked at the error logs to note the following (dated in reverse order, but sequenced as appearing within the logfile itself and apparently demonstrating that 'something' happened on the 21st of July):

    [Sun Jul 21 21:38:21 2013] [error] [client 98.*.*.*] File does not exist: /home/subuser6/public_html/login
    [Sun Jul 21 21:38:14 2013] [error] [client 98.*.*.*.] attempt to invoke directory as script: /home/subuser6/public_html/cgi-bin/, referer: http://sub.domain.com/
    [Sat Jul 06 22:20:58 2013] [error] [client 98.*.*.*] File does not exist: /home/subuser6/public_html/apple-touch-icon.png

  • Devin

    By the bye, a bit more investigation and searching encouraged me to peek into the Apache httpd.conf file which revealed three relevant VirtualHost entries (amongst others) each with their own DO NOT EDIT. AUTOMATICALLY GENERATED. comment:

    <VirtualHost 192.*.*.*:80>
    ServerName sub.domain.com
    ServerAlias http://www.sub.domain.com
    DocumentRoot /home/subuser6/public_html
    ...
    </VirtualHost>

    <VirtualHost 192.*.*.*:80>
    ServerName domain.com
    ServerAlias http://www.domain.com
    DocumentRoot /home/admin/public_html
    ...
    </VirtualHost>

    <VirtualHost 192.*.*.*:80>
    ServerName *.domain.com
    ServerAlias *.domain.com
    DocumentRoot /home/admin/public_html
    ...
    </VirtualHost>

    It's my belief that since the user 'subuser6' is mapped to the domain 'sub.domain.com' something within cPanel/WHM is writing the first VirtualHost entry that overrides the wildcard entry and prevents Domain Mapping since traffic is directed to a different DocumentRoot. I don't know whether this completely invalidates any of my original business rules regarding how users could sign up for hosting within my WPMU. But I look forward to finding out whether changing the domain of subuser6 to sub6.domain.com causes the problem to disappear.

  • Devin

    After changing subuser6's account settings to the domain subuser6.domain.com instead of sub.domain.com, this morning the website responds as it used to, no longer unreachable. Again, I'm still concerned about how member management will work in the future if I decide to begin selling space to users, but for now, I still have to figure out how to create a searchable member's directory for the site.

  • PC

    Hey Devin,

    Greetings and thanks for posting back and sorry for the delay in getting back to you.

    Glad you got the first part sorted out.

    but for now, I still have to figure out how to create a searchable member's directory for the site.

    For blogs you can use : https://premium.wpmudev.org/project/blogs-directory/
    For members you can use : https://premium.wpmudev.org/project/members-directory/

    I hope that helps. Please feel free to ask if you have more questions on the same.

    Cheers
    PC
    Sales &Support

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.