pictures are red x's
spitfireguy
Joined: 2002-12-31
Posts: 20 |
Posted: Tue, 2002-12-31 01:25 |
I know it has to be the URL to my albums folder, but try as I may, I can't get the images to be seen. I run my webserver here in my house. Website link to the photo gallery is http://www.foo.com/gallery (foo of course is not the real name.) None the less, my configuration is as follows: Apache Web server on Linux RedHat 8, (hosted at home) I'm a recent Linux convert as my win2000 box toasted me for the last time... I'm a Linux newbie. I have a 'stealth' redirect of http://www.foo.com to my static IP address assigned by my cable company to the IP address xxx.xxx.xxx.xxx:9999 which hits my router and is NAT'd to my internal IP at port 80. SO... on page 2 of the configuration, I am indicating my gallery URL as http://www.foo.com/gallery and my albums url as http://www.foo.com/albums. Both the gallery folder and the albums folders lie in the website root of /var/www/html/ On my server, I can type http://localhost/gallery and see EVERYTHING perfectly. I see the colored background, the albums, the individual pics, the slideshow runs perfectly, so I'm sure that this can be an easy fix. Currently, from outside my network, all you see is the text, a white page background, and empty boxes with red x's for pics. Also, from my desk to the server (internal route using http://192.168.xxx.xxx/gallery) I see the same thing as external viewers. Basically, it works fantastic from my server :grin: but no where else. :???: Any assistance would help. p.s. I've searched the FAQ's, have done multiple keyword searches, etc, but can't find the answer. Mike |
|
Posts: 20
Still can't get this to work.. any help would be appreciated....????
Posts: 7994
So http://www.foo.com/albums is a valid URL from the outside world? If it is, then Gallery will work from the outside. But it sounds like it must not be, otherwise it'd be working.
It'd be easier to understand if you could provide the actual addresses, but the general rule of thumb is that all Gallery does is create URLs. If it creates a URL that the browser can't get to, you get the broken image dialog.
Posts: 20
http://www.spitfireguy.com/gallery I just did some 'stuff' to my httpd.conf file, so I'm not sure what you'll see right now. If nothing has changed with gallery, you'll get a white page, (not the slate gray background) with text and links, but no pics.
Thanks...
Posts: 7994
Ok, this is your problem. Gallery is generating URLs like this:
http://www.spitfireguy.com/albums/group/6spits01.highlight.jpg
And if you click that link, it'll look fine. But your stealth redirect is really
putting up a frame. Click the above page and view the source to see exactly
what it's doing. That works just fine for navigation, but it won't work as the
source for an <img> tag.
In short, this type of redirect won't work for Gallery (and for a bunch of other stuff).
If you changed your URLs to:
http://204.26.90.105:9999/gallery
http://204.26.90.105:9999/albums
It'd work, but then you'd see the IP addresses in your browser window (which I'm assuming
you don't want to see).
Why not just have http://www.spitfireguy.com point to 204.26.90.105 and have your firewall pass through port 80? Wouldn't that amount to the same?
Posts: 20
First and foremost... THANKS for attempting to assist me. I do appreciate it.
My cable company blocks all ports 2400 and below, so I have to have the the incoming port at the router redirect from 9999 to 80. It's a mess I can't avoid.
I believe I've tried the IP address fix you suggest above before, (age is getting the better of me) ... but I'll make the change now and check it from work tomorrow.. unless you can take a peek now and let me know?
Mike :smile:
Posts: 7994
Yep, it works. And since it's all inside the outer frame from the stealth redirect, the URL always looks like "www.spitfireguy.com/gallery". Looks like a workable solution to me!
Posts: 20
Fantastic...!!! I can't wait to get to work tomorrow and SEE what it looks like from the outside. (Did I just say, 'can't wait to get to work?')
Thank you VERY much.
Mike
Posts: 20
bharat:
One additional challenge for you, please.
Your suggestions above have given me a working gallery and I am grateful for your assitance to this point.
NEW problem: Now that I have the gallery configured so outside my firewall/router it works for the world, inside the firewall, I can't access the gallery any longer to add galleries, photos, etc. I've searched this board and found a working solution that is 90% there, it goes like this: (from another post on this board)
>>>>>>>>>>>>>
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.
>>>>>>>>>>>>>>>>
I entered the info above in my init.php using these variables:
For this example, let's make the following assumptions:
1. "hostname" is the internal name of the server I USED 192.168.100.100
2. "1.1.1.1" is the internal IP address of the server I USED 192.168.100.100
3. "www.site.com" is the external address of the server I USED 204.26.90.105:9999
Works like a charm, except now internally I'm back to red x's for pictures and still can't (it appears) upload photos.
Based on information already given/provided in previous notes, any suggestions?
Mike
Posts: 20
FALSE ALARM... using the code provided above worked perfectly, I just needed to add /gallery to complete the path.. works like a charm!
This is a very cool gallery. My hat's off to the people responsible and many thanks to all.
Posts: 20
One additional caveat, in the event this helps someone else.
By making the config changes to init.php files documented earlier, it did allow me to see the gallery perfectly, and all functions were working, i.e: adding photos, creating new albums, etc. HOWEVER, after emailing a friend to have him check it out, (I'm looking from inside the firewall, and can't see the site from outside the firewall) he returned a note to say that the error: 'page cannot be displayed' occured.
SO, it appears I will now have TWO copies of init.php to work with. One I will load that has the added code included when I need to upload pictures etc, and then return to the original init.php when I want the page to become active again. Unless somebody can help me with a better solution?
Posts: 7994
Heh, that post looks familiar.
With that code patch, it should work properly both inside and outside of your firewall. I'm not entirely sure why it doesn't. Hmm. Well, I could probably fix this pretty quickly for you if I can get direct shell access to your box (see the Donation Based Support option). Otherwise, it'll take a while of going back and forth to figure out what's going wrong.
Posts: 17
Hi,
can I interupt with a question?
I also use a router, natted to my web-server (standard LAMP setup, redhat 7.3)
I also have issues with internal viewing and loading (same red x and no background colour), but, when I attempted to modify my php.ini, everything came to a grinding halt! no PHP at all, with a "can't read the php.ini file"
I cut and pasted the code, but, are those hard returns in the pasted code? in other words, did it fail because php wasn't expecting a new line?
my Gallery works fine from outside, http://www.hampstead.com.au/gallery/
Any thoughts appreciated!
Regards, Paul
Posts: 7994
pauld,
What did you paste in your php.ini? The above instructions don't involve changing that file (unless I'm misisng something). You're supposed to put those lines in your init.php.
What did you put in your init.php?
Posts: 17
pauld replies;
I am always saying to people "read the instructions"
Did I? no.....
Sorry to all, I'll try modifying the correct file this time.
Consider me suitably embarrassed....
Regards, Paul
Posts: 20
The Donation Based Support may be in my future, and yours as well it appears. Anyway, I'm a newbie to Linux, PHP, etc, and need some more time to 'think' about this myself and see if I can figure it all out.
Thanks.
Mike
Posts: 17
Me again,
even after reading carefully, I can't get this to work. But, in all fairness, I'm not using any fancy redirection services.
My system is a fixed IP with my second domain name using port 8000 so I can see it internally (otherwise, I just see the primary domain name);
10.0.0.3:8000/gallery/
externally, this would just be;
http://www.hampstead.com.au/gallery/ (this is the secondary domain)
any thoughts or helpful tips appreciated?
Regards,
Paul :roll:
Posts: 20
pauld:
I'm still working on this issue. I've made a ca-zillion changes to my init.php file and my router as well. I've even dabbled with my httpd.conf file in apache. Still no luck for me. The best I can do is a fully functional site on the outside of the router/firewall, and a white background, all the links, and no pictures on the internal side.
I just can't figure it out....
Mike
Posts: 17
Hi Spitfireguy,
Yep, I'm with you on this, I thought I cheat a little, and go via an external viewing site, to see if that made a difference, but of course, it still references images using the external address, so, that was a waste of time.
I'm wondering if version 2 might fix this? (we could be "bleeding edge" testers)!
I don't think anyone on these forums can help us on this, which is weird, we can't be the only two people in the world with routers!
Regards, Paul
Posts: 20
I'm willing to bet that bharat could solve this if I paid the $20 donation. However, I loaded Linux on my wevserver because 1. I was tired of my win2000 server causing me nothing but grief, and 2. I wanted to learn Linux. So, I loaded it and the incentive of getting my website back online was enough to keep me up late at night attempting to 'figure it out.' Which, by the way, is the reason I don't send in the $20, because I want to LEARN the fix for this, (or at least impliment it myself) so I can still call it 'my box.'
None the less, I'm still poking around with some ideas, and I agree, we can't be the only ones hosting our own website behind a router? I've never been 'cutting edge' and I surely don't want to start now! :grin:
Posts: 7994
One option that should resolve this problem for you guys is to use server-relative URLs instead of the complete URL.
So for example, if your Gallery is located at:
http://www.yourdomain.com/mysite/gallery [external]
http://10.0.0.1/mysite/gallery [internal]
You can change your configuration to just use:
/mysite/gallery
do the same kind of transformation for your albums URL. That *should* work in all cases. It's the way that the Gallery configuration used to be, but I had an incredibly hard time explaining what a "server-relative" URL was to folks and decided to give up and use the complete URL instead.
Posts: 20
If done through the configuration wizard, it won't allow you to save the changes.
So, into init.php I go, but I'm not sure where to make that change manually?
Mike
Posts: 20
BINGO... that did it!! I couldn't make the change using the wizard, however I went in and edited the config.php file, changed the URL's to /gallery and /albums.. and I just rec'd email from a friend outside the router that all is well... check me out: http://www.spitfireguy.com/gallery
Thanks all and especially bharat... you da man.
Mike
Posts: 9
Howdy all
I am having a similar problem re my pictures. I have made the changes to my config.php file (ie change the paths to /album and /gallery) but my pictures are still coming up in red crosses). The album cover is ok and it works on my internal lan but external is a problem. I ran the debug test and the page number did keep increasing so i don't know what else to try.
Here the details of the server:
Give us your Gallery/webserver information to get a faster answer.
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful): boli.pointclark.net/gallery
Gallery version: 1.3.1
Apache version: 1.3.27-2
PHP version (don't just say PHP 4, please): 4.1.2
Operating system: RedHat 7.3
Web browser/version (if applicable): IE
If you need an account please let me know
Ta
P2000
PS - The change fixed the authentication problem.
Posts: 17
Well, to borrow Spitfireguy's quote;
"BINGO, that did it"!
Works perfectly, inside and out.
(I could really kick myself, I've used server relative paths in other packages, It was the partial load of Gallery that confused me)
THANKS Bharat,
Regards, Paul
(Don't have a simple answer for the next query on this problem, except to check you included the "/" )
Posts: 9
pauld
checked the "/" and that is there - any other ideas ? all help is appreciated as i'm about to rip out my hair.... :cry:
Posts: 3474
psycho2000:
Please post an image to your Gallery! (broken or not)
Otherwise, we can't figure out what's going on.
Thanks!
-Beckett (
)
Posts: 9
@ Beckett....
Please try now. I have removed the login restriction. Any help will help.
TA
P2000
Posts: 3474
Hi. I see the problem, though I'm confused.
The highlight image on the first page has the correct url:
"/albums/Christmas-2002/...."
But the subsequent images inside, which are red x's, have:
"http://gateway.boli/albums/Christmas-2002/...." which is wrong.
Can you post the relevant bits of your config.php so we can see?
$gallery->app->photoAlbumURL = "/albums";
$gallery->app->albumDirURL = "/gallery";
This is what you *should* have. If this is correct, then it's possible that PHP is caching things incorrectly. If you can restart Apache, try that.
-Beckett (
)
Posts: 9
beckett
what happen was i made the gallery b4 changing the in the config.php to match your suggestion.
How do i change the images or should i delete the album and start again?
p2000
Posts: 9
beckett
I have created another album and hopefully this should work.
Please let me know if this works
Here is the config.php
if (!$gallery) {
$gallery = new stdClass();
}
if (!$gallery->app) {
$gallery->app = new stdClass();
}
/* Version */
$gallery->app->config_version = 30;
/* Features */
$gallery->app->feature["zip"] = 0; // (missing <i>zipinfo</i> -- it's optional, missing <i>unzip</i> -- it's optional)
$gallery->app->feature["rewrite"] = 1;
$gallery->app->feature["mirror"] = 1;
/* Constants */
$gallery->app->galleryTitle = "Boli's Photos";
$gallery->app->pnmDir = "/usr/bin";
$gallery->app->highlight_size = "200";
// optional <i>zipinfo</i> missing
// optional <i>unzip</i> missing
$gallery->app->use_exif = "/usr/bin/jhead";
$gallery->app->movieThumbnail = "/var/www/html/gallery/images/movie.thumb.jpg";
$gallery->app->albumDir = "/var/www/html/albums";
$gallery->app->tmpDir = "/tmp";
$gallery->app->photoAlbumURL = "/gallery";
$gallery->app->albumDirURL = "/albums";
$gallery->app->mirrorSites = "http://gateway.boli/gallery
http://gateway.boli/albums";
$gallery->app->showAlbumTree = "yes";
$gallery->app->cacheExif = "no";
$gallery->app->jpegImageQuality = "95";
$gallery->app->timeLimit = "30";
$gallery->app->debug = "no";
$gallery->app->use_flock = "no";
$gallery->app->expectedExecStatus = "0";
$gallery->app->sessionVar = "gallery_session";
$gallery->app->userDir = "/var/www/html/albums/.users";
$gallery->app->pnmtojpeg = "pnmtojpeg";
/* Defaults */
$gallery->app->default["bordercolor"] = "black";
$gallery->app->default["border"] = "1";
$gallery->app->default["font"] = "arial";
$gallery->app->default["cols"] = "3";
$gallery->app->default["rows"] = "3";
$gallery->app->default["thumb_size"] = "100";
$gallery->app->default["resize_size"] = "640";
$gallery->app->default["fit_to_window"] = "no";
$gallery->app->default["use_fullOnly"] = "no";
$gallery->app->default["print_photos"] = "none";
$gallery->app->default["returnto"] = "yes";
$gallery->app->default["showOwners"] = "no";
$gallery->app->default["albumsPerPage"] = "5";
$gallery->app->default["showSearchEngine"] = "no";
$gallery->app->default["useOriginalFileNames"] = "yes";
$gallery->app->default["display_clicks"] = "yes";
$gallery->app->default["public_comments"] = "no";
?>
Cheers
p2000
Posts: 9
greets all......
Fixed the problem - found out that the mirror address was causing the problem.
Thanks to everybody especially Beckett !!
Cheers
p2000
Posts: 3474
Ahh the mirror! That explains the mysterious "http://gateway.boli/"! :smile:
Good catch!
Best of luck with your new gallery,
-Beckett (
)
Posts: 9
@Beckett
ta! now to learn more and to be able to help out everybody else.... :smile:
Cheers
P2000
Posts: 20
One last wrinkle in my problem. This has become a rather lengthy thread with similar problems/solutions. I'm grateful to beckett and in my case, bharat for the great answers and insightful responses.
I've made the changes in my config.php file to what bharat calls, relative server paths? and that made my gallery viewable both internally and externally. That was a HUGE step forward for me. Now, I can upload pics and check them from my desk, rather than wait a day and check them from work... (remember, all internet usage is for BUSINESS PURPOSES only)
My only problem that remains, which isn't much, is this error:
Warning: Cannot add header information - headers already sent by (output started at /var/www/html/gallery/init.php:225) in /var/www/html/gallery/do_command.php on line 76
This occurs when I login as admin, and then click 'logout.' In this case, it just shuts my browser down, no harm, no foul. All my work was done anyway.
Also:
Warning: Cannot add header information - headers already sent by (output started at /var/www/html/gallery/init.php:225) in /var/www/html/gallery/do_command.php on line 136
The above occurs when attempting to create a new album. This isn't much of a problem either as my browser is shut down by the error, and when I restart the browser, and logon as admin, the new, but empty gallery is there waiting for me to edit and add photos.
Any ideas on that guys?
Mike
Posts: 92
Will this option still work if my gallery is used as a PN module?
Thanks,
Rick
Posts: 7994
See the part in bold above? You added something to init.php on line 225 that printed something out when it shouldn't have. Undo those changes and it should work again.
Posts: 7994
It should. I haven't tested it recently, though.
Posts: 92
It does work.
Posts: 20
Thanks for pointing me in the right direction. Funny thing was, the code for my init.php ended at line 223... 224 and 225 were empty lines, no code. I deleted those lines, init.php ends on line 223 with the last line of code ?> and now it works perfectly!!
Fantastic! I now have a fully functional Gallery both inside and outside my router. I'm not sure how to summarize all of the posts in this thread, but the main change was to adjust the /gallery and /album paths in init.php to server relative paths, rather than URL's... with that completed, I have a gallery that I'm VERY proud of, due entirely to your terrific product as well as your generous technical support.
MANY thanks.
Mike
Posts: 31
That was because of weird invisible characters probably. ie. Windows or Macintosh style line breaks instead of unix ones. Or another weird invisible character that looks like a bullet. No clue what it was. Delete and all is well.
~Bob
Posts: 1
Thank you all for this information. I just thought the problem over for an hour or so before doing what I should have done in the first place, searching the forum.
I'm going to try the solution out.
el_bob
Posts: 2
Hi all,
I've found this thread to be extremely helpful in solving my firewall/router problems. However, none of these fixes (the addition to init.php, or the changes to config.php) worked for me. I found that the only way to fix the issue was to add the changes to config.php (relative addresses) and to change the line in httpd.conf from
UseCanonicalName On
to
UseCanonicalName Off
i'm using Apache 1.3.27
hope this helps someone!