www.sitename/gallery instead of hostname/gallery
skaffen
Joined: 2002-09-06
Posts: 6 |
Posted: Fri, 2002-09-06 14:53 |
OK, got gallery working, but there's one problem: Our campus network has private IP When I set it up and I access the site under: it automatically gets rewritten in the browser as http://hostname/gallery when I access it from inside the campus. From outside the campus it fails to connect since hostname cannot be accessed. I set up the albums with the site-option it works, so from outside the network I can www.sitename/gallery/albumname but not the frontpage www.sitename/gallery Any help appreciated, Andreas |
|
Posts: 487
Thats odd, do you have the mod_rewrite stuff enabled?
If so, try disable it in the gallery/.htaccess file and see if the problem
still occurs. Also, double check config.php to make sure the urls are
specified properly there. If all of those check out okay, then it sounds
like it may be a problem with the webserver configuration itself.
Posts: 120
What is the exact error when you access www.sitename/gallery ???
Can you please provide the diagnostics.php page also.
Posts: 7994
The problem is that Gallery (for a variety of technical reasons) needs the full URL to your Gallery. But, you actually have two URLs, one for inside your private network and one for outside. There is no one url that works correctly in both cases, right?
The solution is to modify init.php. Configure your Gallery to use the external URL (www.fullservername.com/gallery) and then we'll tweak the code to have it
"fix" the url if you're using it internally. It may take us a couple of iterations to get this exactly correct.
For this example, let's make the following assumptions:
1. "hostname" is the internal name of the server
2. "1.1.1.1" is the internal IP address of the server
3. "www.site.com" is the external address of the server
Edit init.php and right above the "set_magic_quotes_runtime" block, add the following code:
if (stristr($HTTP_SERVER_VARS['SERVER_ADDR'], '1.1.1.1')) {
$gallery->app->photoAlbumURL =
eregi_replace('www.site.com', 'hostname',
$gallery->app->photoAlbumURL);
$gallery->app->albumDirURL =
eregi_replace('www.site.com', 'hostname',
$gallery->app->albumDirURL);
}
This basically says "if we got to the server on the internal address, pretend that we entered the internal hostname in the config wizard". Good luck.
Posts: 6
Problem solved, see below.
No, not really, the www.sitename works from the internal network but those URLs are changed in the browser to the hostname after accessing them.
URLs to albums were correct (since I gave them in the config file) but not to the starting page.
I now know the problem, we recently got a different setup with the firewall (which is not administerd by me but by the comp center) to not only let connections through but to also act as a proxy. Before that the IP-adress/hostname worked from everywhere. Took me two hours of fiddling with redirects and links last night (thank god I finally got my DSL flatrate so that I could play at this from home :wink: ) before it finally hit me:
In my httpd.conf I had given the ServerName as the hostname in my VirtualHost section which always worked and never caused problems with any other page after the change of firewall configuration.
This is the first case it did, so after setting the ServerName to www.sitename things are working perfectly! Yeah! Now I have to talk the boss into forking out some money for a faster server since the aging P160 is ok for serving pages but a tad bit slow at resizing the pics. Since he just got a digital camera, this might just work out! :wink:
Thank you for all the help,
Andreas