Trouble configuring Multisite plugin on Apache Port 80

Hi,
I am trying to setup a local LAN test server running OSX El Capitan running Server5.1.7 with the WPMUdev-MultiSite plugin:

I managed to changed the wp_config.php to include the line "define_wp_multisite" and reloaded the WP dashboard.
I changed the MAMP apache port to 80.
Try to restart MAMP server but apache is not starting.
I check the local running process and found a list of httpd process on port 80 and follow a series of terminal command "launchctl -w unload" to remove the apache httpd.
Now I check the local running process and its clean of any port 80 process.

But when I try to start MAMP, the apache on port 80 will not start. Only the MySQL started.

Please help on how to enable port 80 running apache for MAMP as this is critical to the running of the Multisite, which is my main purpose of using your solution.

Regards,
Chee

  • Adam Czajczyk

    Hello Chee,

    I hope you're well today and thank you for your question!

    I don't use Mac unfortunately but many of my colleagues here do so I'll consult them if necessary and I'm sure we'll get it working eventually.

    There's however one detail that caught my attention in you post. As you you say you managed to put

    define_wp_multisite

    into the "wp-config.php" file.

    The line should be

    define('MULTISITE',true);

    Any error inside "wp-content.php" file may cause WP to break and in case of local installs it may result in PHP or even Apache not starting. That's at least my experience with different local servers on Windows. I'm not sure if this was just a mistake in the post or if there's wrong line in "wp-config.php" file but please double-check it and let me know.

    If this is not the case, I'll consult my "Mac-using" colleagues here.

    Best regards,
    Adam

  • KC

    Hi,
    I have captured the lsof list on port 80, I think this is blocking the MAMP apache from using port 80;

    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    httpd 408 root 5u IPv6 0x6e2ad090757d0fb 0t0 TCP *:http (LISTEN)
    httpd 412 _www 5u IPv6 0x6e2ad090757d0fb 0t0 TCP *:http (LISTEN)
    httpd 413 _www 5u IPv6 0x6e2ad090757d0fb 0t0 TCP *:http (LISTEN)
    httpd 414 _www 5u IPv6 0x6e2ad090757d0fb 0t0 TCP *:http (LISTEN)
    httpd 415 _www 5u IPv6 0x6e2ad090757d0fb 0t0 TCP *:http (LISTEN)
    httpd 416 _www 5u IPv6 0x6e2ad090757d0fb 0t0 TCP *:http (LISTEN)

    I really need to run your Multisite, please help.

    Regards,
    Chee

  • Dimitris

    Hey there KC,

    hope you're doing good today and don't mind skipping in! :slight_smile:

    I checked the wp_config.php and its correct. I also try to start Apache with port other than port 80 (tried 8080, 8888 etc) and it will start up fine. It just don't work when its port 80.

    That's a bit strange. It seems that there is another instance which conflicts this port (this could be the native Apache instance).
    In my clean install, I was able to use port 80 without any errors though (despite that MAMP informs me to better not use port 80).

    Feel free to try any solutions provided in the following links to test if you can surpass this.
    http://www.abhinavsood.com/working-apache-port-80-localhost-in-mamp-or-mamp-pro/
    http://stackoverflow.com/questions/30415201/apache-needs-port-80-mamp
    https://teamtreehouse.com/community/port-80-not-working-on-mamp
    https://teamtreehouse.com/community/changed-port-to-80-after-installing-mamp-however-the-apache-server-doesnt-start

    There's also a blog post from our own blog on "How to Develop WordPress Locally with MAMP". You may want to re-examine the steps you made to set this up. :wink:

    Hope that helps,
    Dimitris

  • KC

    Hi Dimitris,
    Ok, I have managed to solved the port 80 issue.
    Now, I have got to the stage where in the the WPMUdev dashboard is asking me to edit the wp-config.php and .htaccess files with some specific content shown on the dashboard.
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', '192.168.1.3:80');
    define('PATH_CURRENT_SITE', '/wordpress/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    --------------------
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    -----------------------
    I followed the details, edit and reload.
    But not the apache will not start and the MAMP went into crash.

    I edited the restored the 2 setting files, and edit just the wp-config, the MAMP started with Apache then I edit the .htaccess using the Codex.Wordpress multisite info with the following and MAMP started but this time, Wordpress site and WP-admin are not found error 500.
    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)$ wp/$1 [L]
    RewriteRule . index.php [L]
    -----------------
    Please help.
    Regards,
    Chee

  • Adam Czajczyk

    Hello Chee!

    The settings to enable Multilsite are currently in the "wp-config.php" file, is that correct?

    The .htaccess that you used (the one that makes Apache start but triggers 500 error) is a standard .htaccess for a sub-domain WordPress install while you are using a sub-folder install according to "wp-config.php". Furthermore, WordPress is installed inside the "/wordpress" folder so this line:

    RewriteBase /

    should be

    RewriteBase /wordpress/

    The .htaccess that WordPress suggested should be valid. It should go like this:

    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    I would give it another try that way. If this still doesn't work it's possible that the "mod_rewrite" module of Apache needs to be enabled or re-configured. Please check server's error log to see if there are any warnings/errors that may seem related to this. Please also check these posts:

    http://stackoverflow.com/a/21411933/3408384

    http://stackoverflow.com/a/7670598/3408384

    Best regards,
    Adam

  • KC

    Hi Adam,

    Thank you for the config file suggestion.
    I followed the steps and also the stackover flow notes on Directory allow all.

    The MAMP apache and mysql started normal.
    I got to the MAMP welcome splash screen.
    I got to my local host (also working on my direct ip addr) showing ... wordpress hyperlink.

    But when i click on the wordpress hyperlink, it just show a blank page now. No error. Just blank.

    Please help.

    Regards,
    Chee

  • Dimitris

    Greetings KC,

    hope you're doing good! :slight_smile:

    I got to my local host (also working on my direct ip addr) showing ... wordpress hyperlink.
    But when i click on the wordpress hyperlink, it just show a blank page now. No error. Just blank.

    Could you enable WP_DEBUG to see if this comes from WP or not?
    Simply go to wp-config.php file, find a line like
    define('WP_DEBUG',false);
    and change it to true
    define('WP_DEBUG',true);

    As I'm trying to replicate this in my end, are you using any extra hosts?
    Or are you using the 'localhost'? So, you're trying to reach http://localhost/wordpress/?
    And if so, in which document root?

    I'm telling you so, because I usually create a dummy host with every setup, like the single.dev in the screenshot, and it's located in ~/Sites/single.dev folder. Never created me problems though...

    Warm regards,
    Dimitris

  • KC

    Hi,
    I managed to clear the $table_prefix issue.
    But now I got another error as follow:
    -------------------------------------------
    Warning: mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/htdocs/wordpress/wp-includes/wp-db.php on line 1519

    Warning: mysqli_real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/htdocs/wordpress/wp-includes/wp-db.php on line 1519

    Error establishing a database connection
    Error establishing a database connection
    -------------------------------------------
    The php log shows this in the last reload round;
    [24-Aug-2016 15:35:00 UTC] PHP Warning: mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/htdocs/wordpress/wp-includes/wp-db.php on line 1519
    [24-Aug-2016 15:35:00 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/htdocs/wordpress/wp-includes/wp-db.php on line 1519
    [24-Aug-2016 15:35:01 UTC] PHP Warning: mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/htdocs/wordpress/wp-includes/wp-db.php on line 1519
    [24-Aug-2016 15:35:01 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Applications/MAMP/htdocs/wordpress/wp-includes/wp-db.php on line 1519
    ---------------------------------------
    I tried checking that line 1519 but its just pointing to the server variable.
    Please help.
    Chee

  • Dimitris

    Hello KC,

    Error Establishing Database Connection

    It seems that there's some misconfiguration in wp-config.php file considering MySQL settings.
    Please review these settings (the values in here are just from a test site of mine).

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'wp-test');
    /** MySQL database username */
    define('DB_USER', 'root');
    /** MySQL database password */
    define('DB_PASSWORD', 'password');
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8mb4');
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');

    You MAMP installation should already have a 'root' user, you can change his password here.

    The 'DB_NAME' should be the name of a database already created in which root user has access.

    There's also a very detailed article by Jenni on "How to Fix “Error Establishing Database Connection” for WordPress". :wink:

    Warm regards,
    Dimitris

  • KC

    Hi Dimitris,

    Thank you for the guide. I noticed that you assign 'wp-test' for the database name. But in my case I have created it as 'Wordpress' which has worked as normal in the single site setup.

    On another angle, I come across another installer called 'Ampps' which has multisite bundled together. Do you know if using this Ampps installed base will work well with WPMUdev plugin? Especially the Domain-mapping?

    Regards,
    Chee

  • KC

    Hi Dimitris,

    Good news, I got the Multisite working !!!
    Thanks for the help.

    Now another issue, when I try to Activate the WPMUdev Dashboard plugin, and after I enter my usr/pass, it show me this:

    This domain has previously been registered with WPMU DEV by the user William(w*****m@yeack.com). To use the dashboard plugin on this domain, you can either login with the original account (and upgrade it if necessary), or upgrade your trial to a full WPMU DEV membership.
    ---------------------------
    I am using a local IP of 192.168.1.3 which i think many of other users may have used during their initial testing setup. Now without loading my site to a real IP live server, how can I active the WPMUdev Dashboard?

    Regards,
    Chee

  • Adam Czajczyk

    Hello Chee!

    I'm glad you made this work finally and I'm happy that you will be able to make use of our themes/plugins.

    As for an error that you are getting. There's indeed a limitation on domains that can be registered with an account. It's not related to the trial period/IP usage but rather to that the same domain cannot be registered with multiple user accounts. See here please:

    https://premium.wpmudev.org/manuals/using-wpmu-dev/how-free-trials-work/

    In case of "localhost" domain or - to put it in a more "general" way - a local install that's either reported to our system as a "localhost" or by an IP that's already been used (which is common in case of local installs) the solution is to move your install in to a folder of a unique name.

    Instead of "localhost" it could be for example "localhost/mybrandnewwordpresssite". Of course use any folder name you wish but please avoid any obvious names such as "mysite", "wordpress", "dev" or similar which obviously may also be already registered.

    This will solve the issue.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.