TurnKey Linux Virtual Appliance Library

Problem when enabling network/multisite on Wordpress 3.0 appliance

Greetings to all.

First of all i want to congradulate you for the fantastic work.

There seems to be a strange redirection problem when enabling the network feature in the Wordpress appliance. Network is needed to be able to use the multisite feature.

Let's take it step by step.


I booted a fresh Wordpress appliance and gave it the LAN IP 192.168.10.232.
You can see it works just fine until this step.

Also the login redirection works just fine

Under Settings->General i see the Wordpress address and Site address as folows:

 

Using this
http://codex.wordpress.org/Create_A_Network
as a guideline, i added in wp_config.php the following.


define ('WP_ALLOW_MULTISITE', true);

At this point my wp_config.php was like this:

<?php
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', '620ab1d6ce38fca0d6ade6e847ea4627');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

define('AUTH_KEY', '47e2f590f4c14d20cce3b7bea447031cfd2c0a42cda452254506492d2f28b34e');
define('AUTH_KEY', '47e2f590f4c14d20cce3b7bea447031cfd2c0a42cda452254506492d2f28b34e');
define('LOGGED_IN_KEY', '9fe94b4ad1a655308aca618e98fdc4496926c7dd5976174c35ab50810f53e626');
define('NONCE_KEY', '8d84b40c24280d56392240c701c3bc5b0e01258bab39c80736d379aced1a9ab7');

$table_prefix  = 'wp_';

define ('WP_ALLOW_MULTISITE', true);
define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']);

// WordPress Localized Language, defaults to English.
define ('WPLANG', '');

if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');

require_once(ABSPATH . 'wp-settings.php');

As a result the Network option appeared under Tools


 

There is a warning on top that says

Because your install is in a directory, the sites in your WordPress network must use sub-directories.
Warning! The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.

After i pressed the "Install" button i get a screen about the changes i must make in order to finish the Network installation

So i created the blogs.dir folder

Added the provided lines to wp_config.php, so it became something like this:


<?php
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', '620ab1d6ce38fca0d6ade6e847ea4627');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

define('AUTH_KEY', '47e2f590f4c14d20cce3b7bea447031cfd2c0a42cda452254506492d2f28b34e');
define('AUTH_KEY', '47e2f590f4c14d20cce3b7bea447031cfd2c0a42cda452254506492d2f28b34e');
define('LOGGED_IN_KEY', '9fe94b4ad1a655308aca618e98fdc4496926c7dd5976174c35ab50810f53e626');
define('NONCE_KEY', '8d84b40c24280d56392240c701c3bc5b0e01258bab39c80736d379aced1a9ab7');
define( 'SECURE_AUTH_KEY', '^!]`-[T8nsP,o9k+D7;?/*dH:@,FFrBQ5-[9-@yAou`#=_|EEQN]{tF:d(,m#+^T' );
define( 'AUTH_SALT', 'h4b*FqVN37XMe=hkgyLt2=2abz7_BaHfk>_8+IDpH=m?&ff3!UC]kfFUbe=G&ZW-' );
define( 'SECURE_AUTH_SALT', '}cn-)!_!E?OVr(erZU0[V`F45L8 pTdxY|[h/0lI!J#QCg+):^|CBMLLQ{jJGh:H' );
define( 'LOGGED_IN_SALT', 'rr^S|yNOaS24wCa-~}=_7W/>+h/5U}_ {2_<U?%XaReu_.1{FAP@Y{+ro3x{&F+^' );
define( 'NONCE_SALT', '%jM`9-Fh@q[{6uk!+GC(?Cw>Ho~gf|myX!@Y(A^E5mvk2C`<>Yg)lm5KG,MPmx;H' );

$table_prefix  = 'wp_';

define ('WP_ALLOW_MULTISITE', true);
define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', '192.168.10.232' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

// WordPress Localized Language, defaults to English.
define ('WPLANG', '');

if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');

require_once(ABSPATH . 'wp-settings.php');

and used the provided code to create a .htaccess file under /var/www/wordpress in the appliance

After making the changes the problem appears.

The fronpage and the login page are stripped out of graphics.See below

Entering the username and password on the login page i get redirected to: http://127.0.0.1/wp-login.php


 

Also when i try to enter http://192.168.10.232/wp-admin i get redirected to: (again to 127.0.0.1 )

Of cource any access to the admin panel was not possible.
After some hours i did the following and made some progress.Using phpmyAdmin i have changed in the Wordpress database, in the wp_options table the siteurl field from

http://127.0.0.1  to

http://192.168.10.232

and managed to login to admin panel

But that's not a complete solution.Even after i entered the admin panel i get redirections to 127.0.0.1.See below (visit is highlighted with the mouse)

 

 

I don't know how to fix this. If i restore the initial wp_config.php, remove the .htaccess file from /var/www/wordpress and restore the initail value in the siteurl filed in the database,the site works like normal again, with no multi-site feature.

Do you have any idea how can i  get the multisite feature to work?

 

Excuse my bad english.
Best Regards.

Alexandros.

P.S. I don't now if that rings a bell to someone, but when i tried to enter PhpMyAdmin i accidently didn't use https but http

Of course i got an error page saying that i must use https and i got a "correct" https link. That link as well pointed to https://127.0.0.1:12322 and not https://192.168.10.232:12322

Basil Kurian's picture

Just do this

Install a fresh WP appliance ( or rollback all changes ) and edit the wp-config.php file and add these directives in the 'define' section

define('WP_HOME',$SERVER_NAME);
define('WP_SITEURL',$SERVER_NAME);

With that setting the site can be accessed by any IP configured in that box


Unfortunately it doesn't work

Thank you for your comment.

Unfortunately it doesn't seem to work.

I get the exact same result.


Best Regards.
Alexandros.

P.S. I think that .htaccess file in /var/www/wordpress is ignored for some reason...


Basil Kurian's picture

I tried installing wordpress

I tried installing wordpress in a Virtualbox instance, then changed the ip of the machine , then the wordpress didn't work . When I add those directives to the wp-config.php file , it worked . Please try once more on a fresh wordpress installation.


After a fresh installation

Hello again.

I have installed a fresh copy and did the changes.
Unfortunately it didn't work.
Maybe because my IP stays the same and doesn't change.Only the multi-site feature is enabled.

The good thing is that i managed to sort it out ;)

In the Wordpress database, besides the siteurl field in the wp_options table, that i had to change from http://127.0.0.1  to http://192.168.10.232 i also changed the home field in the same table from http://127.0.0.1  to http://192.168.10.232.
(it was in the second page of the table values via phpmyadmin and i haven't seen it)

Thanx again for your time ;)

Alexandros.


THANKS!!!

Just what I was searching for! Made my day! I guess the network install goes smoother with an actual domin name instead of just the IP!?

Having same issue

I'm having the exact same issue with the 11.0 appliance. Trying to follow these directions now to see if this will work.

Solved, thanks to above information

I've never worked in phpmyadmin before. So the above looked daunting - a few additional details:

go to the phpmyadmin screen, in this example at:

https://192.168.0.232:12322

Log in with the password you set on creation.

Across the top there will be tabs, the first says "databases" (then "sql" "status" "variables"...) Click on databases.

There are probably 4 databases listed there, the last one is wordpress - click on it.

Find wp_options in this list, about 1/2 way down the page. Click only the first box after the name. If you hover over it, it should say "browse."

Find the siteurl key, and click the pen to the left of it to edit and set to YOUR IP address. Then scroll down on the page to find the line that starts [show] [30] row(s)... and go to page 2.

Here you will find the home key to change as well.

There is no save or commit. The changes are instant. In another window try hitting your blog again - it should now be working.

Legend...wait for it...dary!

Thanks for the detailsed steps. I needed wordpress to have show the external URL and could not for the life of me find out where to change it. Thanks for the help.

Not quite solved...

While this worked, once I went back and edited DNS to include the proper name I found that each of the sites I had created now wanted to point back to the IP address - so back through the above steps again to point to the proper name.

Word of advice - edit your DNS and put in your host name (even if using subdirs) BEFORE you even start with installing the appliance. You can go back and fix it up after the fact, but it was kind of a pain. THAT likely would have avoided this entire scenario in the first place.

Same problem

Hi I've followed the suggestions in this thread and still can't get multisite / Network mode to work properly.  Is anyone running multisite successfully on TLK 11.1 Worpress 3.0.5?

I am... now that I've found

I am... now that I've found the answer to the http://127.0.0.1 error.

But I did it by merging my wp-config file from a previous installation that came from wordpress.org.

The TLK deployment does not include the line "/* That's all, stop editing! Happy blogging. */

So make sure that your edits to wp-config are before which the file would have if it were downloaded from wordpress.org. so make sure that all of your added lines dealing with the multisite business come before this line:

/** Absolute path to the WordPress directory. */

Oh well, what the hell...

Jeremy's picture

Sounds like this could be a bug with TKL Wordpress then?

If so, it wouldn't hurt to log a bug if you can be bothered.

Done! Thanks for the

Done! Thanks for the suggestion.

Oh well, what the hell...

Jeremy's picture

Nice work

Thanks :)

Can I Pay Turnkey for Support?

Hi,

I'm wondering if Liraz & Turnkey offers Paid Tech Support to help with determining if an issue has occurred with my configuration of Multisite/Network Wordpress 3.0 or if there might be an issue with the ISO?

I'm willing to pay for support direct to Turnkey.

Ray

Jeremy's picture

AFAIK they still offer paid support

There was a webpage here on this site but I can't find it now (since Liraz upgraded the site). Maybe private message Liraz or Alon. Adrian (Moya) may also be able to help, you could message him too.

Similar problem...

Hi, I also had some of these problems, and have others additionally, just a word of advice for those that the CSS disapears and/or get 127.0.0.1 errors. Add the lines to be added BELOW the require_once(ABSPATH . 'wp-settings.php'); line.

Worked for me, seems some lines need to be read before the multisite lines.

 

The installation procedure seems to work for me as it should, but when I log out and in again, I just dont get the "super admin" menu choice? I will try again, using my ipadress instead of dns-name, might solve the problem?

 

Thanks and hope my info helps someone...

 

/Kristian

Kristian i think adding the

Kristian i think adding the lines below the  the require_once(ABSPATH . 'wp-settings.php'); line is not correct.
Looking at the wp_config.sample from wordpress 3.05 i saw the following.

</* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
 
In wordpress documentation, it mentions
 
2. Add the extra lines your WordPress installation generates into your wp-config.php file.

 

 

 

These lines are dynamically generated for you based on your configuration.
Edit the wp-config.php file while you are logged in to your sites admin panel.
Paste the generated lines immediately above /* That's all, stop editing! Happy blogging. */.

 

 

 

So i am guessing that the lines should go above

if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

Got it...

Ok, thanks, 

 

I guess I got confused since the 

 

</* That's all, stop editing! Happy blogging. */

line is missing from the turnkeylinux installation of WP... Still havent fixed this, so I'll find a sample to look at and work with that.

 

Thanks for your input!

/Kristian

Solved for me aswell...

Just wanted to share that it is solved for me aswell, having to change the IP-addresses in the database but also placing the extra lines int the wp-config.php in the right place solved the problem.

Thanks all who helped!

/Kristian

"Solved" too

Hi,

After a pair of hours struggling with this problem, finally though to come here... thank you all for sharing this "solution".

BTW, doing a search on 127.0.0.1 on the whole DB, found and corrected 3 other occurences in the wp_posts table for the 3 default pages.

It's always "refreshing" to be remembered why big boys keep telling you to have a working clean DNS before anything on your network... now I know what I have to setup next :-) (Let's check if there's a TKL appliance for that...)

Bests


Having the same problems...

Thinking that Turnkey urgently need to push out a new version of the Wordpress appliance that has networking already enabled.  If the issues above don't get you, the problem with the install being over a month old and hence directory-level networking being disabled will!

Will let you know how I get on...

Jeremy's picture

How about you produce a patch?

If you can provide a TKLPatch I am more than willing to patch the ISO and upload it to the TKL Community project. Otherwise we'll need to wait on the core devs. TBH it'll probably be months away if we wait for them, they have so so much on their todo lists.

I hate OpenSource

This is the reason OpenSource will never fly

1 problem a zillion solutions which NONE works . . . disgusting

I have been trying to solve this exact problem NOTHING SOLVED MY PROBLEM

Jeremy's picture

Can't please all the people...

You're always free to not use it! Or considering it's open source, you can fix it, or pay someone to fix it for you share the solution and still probably be better off financially!

Speaking of money, what is the problem? Not getting your money's worth?

Sorry for my sarcasm but what I think is disgusting is when people get a gift and bitch about how it doesn't do what they want it to do the way they want it to. Your parents must have hated Christmas time...

I would argue that open source already does fly... Perhaps not for you by the sounds, but considering a significant majority of the world's web servers run Linux and/or other open source software suggets that your problems have nothing to do with uninhibative software licences...

To continue with the theme; in my experience things not working the way you might want them to is not just the domain of open source... I'm kept pretty busy fixing Windows computers... (when they don't work the way they're 'meant' to).

Alon Swartz's picture

Wordpress multisite howto

Seeing that enabling and configuring wordpress multisite support has tripped up quite a lot of people, I created a step by step howto in the documentation section: Wordpress multisite support (aka. Network Sites).

Alon, that's excellent. 

Alon, that's excellent.  Lemme ask you a question.

In yout tutirial, you say; "Important: If you decide sub-domains, then SITE would be http://example.com . If you decide sub-directories, then SITE would be http://www.example.com ."

 

That's interesting because I have one multisite that does use directories and it's been problematic to set up. Can you explain why using "www" would make a difference? Or link me to information about that? It's a suggestion that I've never seen before. I"m about to try it. :)

Alon Swartz's picture

In my testing...

In my testing, using http://www.example.com with sub-domains gives a lot of issues, and doesn't actually make sense, as a sub-domain on that would be http://site1.www.example.com.

As for sub-directories, I assume that a naken domain (http://example.com) would work, and I suppose it depends on what your use case is. If you're having issues though, it might be that your database needs updating (see the howto).

Gotcha, all is clear

Gotcha, all is clear now.

 

And OH YEAH updating the database is crucial!

In my case, someone loaded wordpress on my virtual server before they turned it over to me, and well before i assigned a Cname to it. So the home url resolved to 127.0.0.1 in the database for days and days before I remembered that there are two places where the url is recorded in the database. heh. Although all of my virtual subdomains worked just fine-- I could not access the primaryblog from the backend or the backend from the primary blog.

 

But this is a different host and a different problem...

127.0.0.1

Then all you have to do is change all the hard coded references to 127.0.0.1 in the source and plugin files. (Use a text search and replace utility) Then as you are on localhost change the apache, phpmyadmin, and mysql references to 127.0.0.1 remembering that some need a localhost reference but not necessirily a 127.0.0.1. ( Trial And Error) Use a text editor like Notepad++ do not use the google plus inbuilt editor plugin it takes over your site header., And inputs meta tags and scripts to its site within your header.  So use notepad++ open the found file with the reference, change the reference to your localhost ip. and for reference " those whose wrdpress is slow change localhost to 127.0.0.1- ignore all this IPV6 issue threads for the moment, just change all references to a browser point of 127.0.0.1 or localhost.  Remembering if you do this that php my admin references must stay at localhost. 

This should speed up your page... 

 

Then remove all depreciated calls in the plugins and files. 

Then remove the ccs and html errors from the files or improve them to suit the current template.

Whatever is shown on your front page be it google or Wordpress must be able to primarily have a dark and light theme.

 

If you get the fundamentals correct light and dark theming is then only a matter of simple CSS or simple scripting for template php changes.

Then introduce a localhost W3C checker so you may be able to copy the failing script into Notepad++ or your fave editor and click read in firefox google etc. to see the changes made by correcting your html via the html checker on W3C.

But you seem to forget one amazing point 127.0.0.1 is a great way to redirect people back to their own version of your script.

As a Wordpress Localhost designer I guarantee you can make it do some wonderfull things.

Here is a silly idea  type in c:\ in your browser bar!

If you get a directory structure then I would suggest you insert a html file as a control.

No luck...

I have followed the above directions with no luck. In place of http://example.com, am I supposed to be using my "external" IP address, that is, "http://192.168.0.10x"? 

Joeseph, that's how I've done

Joeseph, that's how I've done it. I have a Cname now, butit the IPn still works just fine.

Wordpress multi site is not Working

Wordpress multi site is not Working.... when ever i am open to sub domain(http:subdomain.domain.com)it redirect to website-unavailable.com Help Me Please

Alexnts and Daniel Gross'

Alexnts and Daniel Gross' solutions worked for me. Thanks!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)