alexnts's picture

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

Forum: 

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

alexnts's picture

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...


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.

alexnts's picture

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.


Daniel Gross's picture

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

Daniel Gross's picture

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.

Daniel Gross's picture

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.

probablepossible's picture

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 Davis's picture

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

probablepossible's picture

Done! Thanks for the suggestion.

Oh well, what the hell...

Jeremy Davis's picture

Thanks :)

Jeremy Davis's picture

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.

alexnts's picture

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__) . '/');

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


Jeremy Davis's picture

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.

Jeremy Davis's picture

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

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 Swartz's picture

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).

Joseph Buchignani's picture

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"? 

Add new comment