Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image viewer not working under Ubuntu server 2

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Trying to run a page containing Lightbox image viewer 2.03a on a Ubuntu 10.04 server.

The test site is at www.specbilda.com, and the website will run correctly elsewhere using Windows XP as a test platform.

As Windows XP is not suitable for use as a web server, the first choice is Ubuntu 10.04 server.

Clicking on a thumbnail should load a larger version of the thumbnail image, and the user can navigate through the gallery by clicking on the left or right half of the image.

The website is generated by a Windows app and either uploaded via a LAN or FTP.

So why do the larger images not load correctly under Ubuntu 10.04 server?

TIA

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Are you running the page on Ubuntu server now?

I tried the link and it seems fine to me. I click an image, it pulls up a java application that loads a larger image and I can click on the left or right green arrows that appear to move between the images.
 
Noway2

Thanks for your reply.

Yes, the site is running - if you click on say the first thumbnail image, you should be able to see 6 images in the gallery.

I can't get beyond the third image before it stops loading.


FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Interesting. I am getting all six. The last one is a closeup of the steering wheel and has a caption of "Evenings or weekends call 07980 86xxxx". The loaded as fast as I could click on them too.
 
something is not right, I mean, it works for 3 pictures, then quits...

obviously it is working but dies thereafter, take a look at the logs (and running processes) to see if something decides to quit when you move from picture 3 to picture 4...

which browser are you using? maybe try another browser, such as FireFox or chromium...



Ben
"If it works don't fix it! If it doesn't use a sledgehammer..."
How to ask a question, when posting them to a professional forum.
Only ask questions with yes/no answers if you want "yes" or "no"
 
BadBigBen

Thanks for your reply.

For comparison, another test site is running on Windows XP.

I've tried all the major browsers and none see the site at correctly.

Are there any serverside requirements to enable Javascript that may be missing?

Where might the relevant logs be found?

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
On the Ubuntu server, the logs will be in /var/log/apache2. There will be error.log and access.log. I would also check to see if the browser is reporting errors. Using Firefox, you can pull it up under the tools/error console menu (I am using Linux - and under Windows most options seem to be under edit instead).

I also double checked, the URL that I am using (that works) says I have now tried it from my home and from work.

A couple of other things to check. In Firefox, if you right click on the images, you can select view page info and then there is a media tab. This might help debug why you are having problems with some pictures. Also, go to a site like w3c and have them verify your HTML and CSS. A lot of times a subtle error can cause strange loading problems and that site is really good at finding things that are near impossible for a person to notice.
 
Not sure as to the significance or relevance of the errors found by
w3c?

134 Value Error : display Parse Error :
142 Value Error : display Parse Error :
170 Value Error : display Parse Error :
186 Value Error : display Parse Error :
190 Value Error : display Parse Error :
198 Value Error : display Parse Error :
214 Value Error : display Parse Error :
218 Value Error : display Parse Error :
222 Value Error : display Parse Error :

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Seem to have found an answer. [smile]

The website was copied from the Windows XP server to the Ubuntu 10.04 server without any modification.

I've now run
Code:
sudo chmod 0777 /var/www
and now appears to work as expected, so it seems to be a simple permissions issue.

Many thanks to Noway2 and BigBadBen for your contributions

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Glad that you found the issue, and thanks for posting back with what fixed it for you...

PS: I did not have that problem, with SuSE 11.1 and FF, I was just stating that when it works for 3 pics and not the rest, that something is amiss... ;)

Ben
"If it works don't fix it! If it doesn't use a sledgehammer..."
How to ask a question, when posting them to a professional forum.
Only ask questions with yes/no answers if you want "yes" or "no"
 
I am pleased that you are getting this site to work. However, I really feel that I must caution you that setting the permissions to 0777 is a VERY (and I can't stress VERY enough) BAD idea!

The primary Linux permissions are broken into three octal groups (the three digits between 0 and 7) corresponding to 000 through 111 binary - representing read, write and excute for each of the three groups owner, group, and other. If you look carefully you will notice that setting the permissions to 777 allows others, ie, remote users and effectively anyone both WRITE and EXECUTE permissions on your folders. This is NOT something you want the public to have as your server will quickly become compromised.

Instead, you will likely want to have the web files owned either by root or by the apache user (typically apache or with only READ permissions set for others. Group may be adjusted as needed and for certain applications.
 
Noway2

Thanks for your advice - need to determine what permissions are actually needed for this scenario and, if necessay, will start a new thread to resolve any issues.

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
I was tired when I when I wrote last night. I should have mentioned when I said read and write for owner and read for everyone else that this corresponds to 644. You will also need execute permissions on your directories, which which is 755, or else you won't be able to work with them. Try this for a starting point.

This will allow the web server process and any other applications read access to the files, while keeping the content itself safe provided you don't get a root level compromise.

The other bits, e.g. the 0 in 0777 correspond to the more esoteric properties of setuid, setguid, and the sticky bit. When the setuid and setguid bits are set, the program is executed under the account that owns the file rather than the user who is executing it. Some system binaries for example, must run with root level privilege so they have the setuid bit set and are owned by root. Even when a user executes them, they run with root capability. When investigating a compromise, these are key flags to look for as the parasites like to put setuid copies of programs like shells in strange locations that may get overlooked.

I thought the sticky bit was obsolete, but it seems to be related to controlling who can perform certain operations on directories.
 

I best guessed it would need 0755, and have changed the permissions to this.

If the files are uploaded through a LAN to a local server, as opposed to FTP to a remote server, that corresponds to the default SAMBA permissions.

So once again, Noway2, many thanks for your help and sharing your knowledge.

No need now for a separate thread on permissions.

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top