Hello,

Most of you who attended the PLUG yesterday may be aware that Mark (from 
More-Solutions) went to great lengths to resolve several issues I had both with 
my work-station and my projects.

The major problem I had (and it is definitely worth mentioning) is that I am 
running a LAMP server with ISPConfig, Virtual Hosts & Joomla web-sites. On one 
particular web-site, having successfully installed Joomla and several 
components, I tried to embed the Gallery2 component into my Joomla site without 
luck. It kept failing when I tried to run a wizard to integrate Gallery2 using 
the Gallery 2 bridge. Below is how Mark solved the problem (for the information 
of anyone who tries to do the same).

Mark looked at the code in the file www.example.com/gallery/embed.php (or 
whichever directory your embed.php file is in). After a lot of poking around, 
he discovered that the process used by the 'wizard' performs a 'security check' 
to ensure that the embeded gallery2 application is on the same server as your 
Joomla installation.

When 'embed.php' calls for the security check, because of your configuration it 
reports/returns values for both the IP addresses of both your external IP 
address and your virtual IP address which are actually different so the 
'security check' fails  & returns the error message that I am (and probably you 
may be) receiving.

The Solution

He edited the ../gallery2/embed.php file as follows.

Near the end of this file is the line below which appears in bold : -
        $remotehost = !empty($remotehost) ? gethostbyname($remotehost) : '';
          $localhost = GalleryUtilities::getServerVar('HTTP_HOST');
         $localhost = !empty($localhost) ? gethostbyname($localhost) : 
'127.0.0.1';
           if ((!empty($remotehost) && $remotehost == $localhost)) 
                  if (defined('GALLERY_CONFIG_DIR')) {
                 /* GALLERY_CONFIG_DIR is multisite-aware */
                   header('X-G2-EMBED-PATH: ' . GALLERY_CONFIG_DIR . 
'/embed.php');
                } else {
                   /* Fallback if G2 isn't installed yet */
                     header('X-G2-EMBED-PATH: ' . __FILE__ );
                  }
          }
          }
        }
        ?>

Change it to : -
        if (TRUE || (!empty($remotehost) && $remotehost == $localhost)) {

Then run the 'wizard'. It will successfully go to 'Stage 2'. Complete the 
'wizard' then change the ../gallery2/embed.php file back to it's original  
state.

The other plugins should now also work.

I hope this helps.


There are times when we owe it to ourselves and to the ones around us to share 
what we know and feel. And there are times when we simply have nothing to 
offer, and best serve everyone by saying nothing. Perhaps the wisdom comes in 
being able to recognize the difference. Peace, Eron

_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro

Reply via email to