LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 07-27-2009, 02:12 PM   #1
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Rep: Reputation: 0
Unhappy Strange problem with apache


Apologies if this is not in the right section of the forum, I figured it was a newb question and so would be ok here.

I've just configured a new server with Red Hat Enterprise 5 it's not our first linux machine and is running great except for one small detail, there is something missing in the apache config but I'm not sure where the problem is because both are running largely the same config as is installed by Red Hat.

I have 2 URLs both running off apache 2, one works:
http://demo.mybirth.tv/images/vidThu...%20%201.jpg
the other doesn't:
http://www.mybirth.tv/images/vidThum...%20%201.jpg

I've narrowed it down to the file names because as soon as I take out the it works. If that were just it then things wouldn't be a problem but these are user uploaded files and there are a lot of them so ideally I need to make the severs behave in the same way.

If someone could point me to the right place in my httpd.conf then I'd be most grateful.
 
Old 07-27-2009, 02:30 PM   #2
matsvw
Member
 
Registered: Jul 2007
Location: Oregon
Distribution: Gentoo/Fedora/SLES
Posts: 37

Rep: Reputation: 15
The file name in the link that fails is rendered in the URL as: 'Acupuncture £££ 1.jpg'

the one that works gets rendered as: 'Acupuncture 1.jpg'

To me this suggests that there is a difference in the way the servers' character sets are configured. At least that is the first thing I would look at.
 
Old 07-27-2009, 02:41 PM   #3
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Yeah that was my first thought too, I noticed that the old server had a whole load of additional AddCharset parameters in the httpd.conf so I copied those over and restarted apache but it didn't make any difference. I also tried putting them in the .vhost file for this site and, as a last resort in the .htaccess file. Nothing seemed to make any difference and I'm still getting 404 errors on the images
 
Old 07-28-2009, 05:26 AM   #4
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
After some more investigation I've definitely worked out what the problem is. The locale setting the server upon which the URL works has it's locale set as

[ewar@linux3 lib]$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

The one that does not work is:

[root@scotty vidThumbs]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

So the sign is not liked by the new one due to the locale.

Cool, now I know what the problem is does anyone know an easy way to change the locale on a Red Hat ES5 server? I need to change it from US.UTF-8 to GB.UTF-8?
 
Old 07-28-2009, 05:34 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,628

Rep: Reputation: Disabled
man locale should give you an idea how to change the settings.
 
Old 07-28-2009, 05:49 AM   #6
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I've tried that but the man pages are not massively helpful. All I see is what I've pasted below, it doesn't actually tell me very much but maybe I'm just being uber-dumb

DESCRIPTION
The locale program writes information about the current
locale environment, or all locales, to standard output.

When invoked without arguments, locale summarizes the
current locale environment for each locale category
defined by the LC_* environment variables.

-a, --all-locales

Write names of available locales.

-m, --charmaps

Write names of available charmaps.

Output Format:

-c, --category-name

Write names of selected categories.

-k, --keyword-name

Write names and values of selected keywords.

ENVIRONMENT VARIABLES
LC_CTYPE

Character classification and case conversion.

LC_COLLATE

Collation order.

LC_TIME

Date and time formats.

LC_NUMERIC

Non-monetary numeric formats.

LC_MONETARY

Monetary formats.

LC_MESSAGES

Formats of informative and diagnostic messages and
interactive responses.
 
Old 07-28-2009, 06:06 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,628

Rep: Reputation: Disabled
For eg:

to change all locales to en_GB.UTF-8

locale -a en_GB.UTF-8

or to change a particular catagory

locale -c <catagory-name> en_GB.UTF-8
 
Old 07-28-2009, 06:27 AM   #8
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for that, I tried this command

locale -a en_GB.UTF-8

but it simply printed a list of all the available locales and did not make any changes. I've been scouring the docs looking for the correct command but either I'm looking in the wrong place or I'm not seeing something that is staring me in the face
 
Old 07-28-2009, 06:33 AM   #9
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,628

Rep: Reputation: Disabled
alternatively you can export all the components individually to the value you want.
 
Old 07-28-2009, 06:43 AM   #10
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for your patience I tried:

[root@scotty vidThumbs]# locale -c LANG en_GB.UTF-8

To change the first of the components listed when one types locale I did not receive any output from my command but when I type locale the LANG=en_US.UTF-8 is still there, I would have expected it to change to en_GB.UTF-8

[root@scotty vidThumbs]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
 
Old 07-28-2009, 07:16 AM   #11
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
OK, so I managed to change it. I reloaded my console and now when I type locale I see:

LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=


Unfortunately the file names with in them are still generating 404 errors in apache

http://www.mybirth.tv/images/vidThum...2%A3%20%20.jpg
 
Old 07-28-2009, 08:23 AM   #12
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,628

Rep: Reputation: Disabled
It seems to be some other issue. I tried both the links in your first post and both of them somehow contain the pound sign.
You might again want to look into the configuration of the server and that the is actually there on the server and the location of the file is same as that is configured in apache.
 
Old 07-28-2009, 08:47 AM   #13
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
The files are definitely on the server and the paths are also correct. Images without in them work as you can see on this page, each item listing in the centre has an image attached to it but only some of them show up.

http://mybirth.tv/a-z.cfm?cat=169

The images in the main list area of the page that show have no in the filename, the ones that don't do have them. If you compare it with

http://demo.mybirth.tv/a-z.cfm?cat=169

All the images show on that page event though the file names are the same.

When I do ls -l in the relevant folder on the server there is also something strange happening, on the server that serves the file it's listed as

Acupuncture £££ 1.jpg

on the server which doesn't serve the file it's listed as

Acupuncture úúú 1.jpg

Neither of them is a symbol but they are different and definitely suggest a problem with the locale. Might a restart of the server be necessary? It's unusual for linux that it would need to be restarted but I could always try it.
 
Old 07-28-2009, 08:54 AM   #14
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,628

Rep: Reputation: Disabled
I dont think that changing locales need restarting of server.
I remember doing this on solaris machines and changes took place without restart. You might just want to take that step as well just not to regret later but I suspect it will solve your problem.
If you think that the pound sign is your problem, can you change the name for one file so that you can be just sure for that fact. Otherwise you will keep on finding solution for something that isnt your problem in first place.

Anyhow, those both links in the above post#13 are working for me.
 
Old 07-28-2009, 09:00 AM   #15
jumperb
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I tried changing the filename and it works, it works if I take the out it also works with spaces and other characters that might be expected to cause a problem. I will definitely try a restart and see how that goes. Thanks so much for your help so far, I will let you know how I get on.
 
  


Reply

Tags
apache2conf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
very strange apache permission problem txm123 Linux - Newbie 2 08-03-2007 09:48 PM
strange apache php problem lbharti Linux - Software 3 05-20-2005 11:39 AM
Strange apache trailing / problem - Slack-current, apache 1.3.33 vamp Linux - Networking 1 01-30-2005 08:28 PM
Strange Apache problem after upgrade to 2.6 kernel sal_paradise42 Linux - General 7 06-08-2004 05:56 PM
Strange PHP4/Apache/Opera problem corwax Linux - Software 2 09-23-2003 05:23 AM


All times are GMT -5. The time now is 05:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration