Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 19th May 2008, 10:44
cooljai cooljai is offline
Member
 
Join Date: May 2007
Location: /dev/random
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cooljai
Question How to change Default Charset in Apache ?

Hi,
I'm on CentOS 5 and like to change default charset of 'ISO-8859-1' to 'UTF-8' in my Apache 2.2 Server.
Added following line:
Code:
AddDefaultCharset UTF-8
Restart Apache and checked default server page, it says good UTF-8. But when running perl scripts:
Code:
http://serverip/cgi-bin/myscript.pl
Checking from browser (Firefox, View->Character Encoding) says charset is "Western ISO-8859-1" instead of expected UTF-8 .

Do I need to change any other setting in Apache in order to force UTF-8 for all contents? Kindly suggest.

Thanks
__________________
Jagbir
Registered Linux User #468658.
Reply With Quote
Sponsored Links
  #2  
Old 19th May 2008, 18:01
mccharlet mccharlet is offline
Senior Member
 
Join Date: Feb 2007
Posts: 262
Thanks: 65
Thanked 13 Times in 8 Posts
Default

This file for debian /etc/apache2/apache2.conf
__________________
Thanks
Cédric

Sorry for my english

Hosting : http://www.jheberge.ch
Reply With Quote
  #3  
Old 20th May 2008, 07:44
cooljai cooljai is offline
Member
 
Join Date: May 2007
Location: /dev/random
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cooljai
Default

Quote:
Originally Posted by mccharlet
This file for debian /etc/apache2/apache2.conf
Thanks for reply but as I already mentioned, I'm on CentOS 5

Just wanna hint, is there anything else, I need to update in Apache?
__________________
Jagbir
Registered Linux User #468658.
Reply With Quote
  #4  
Old 21st May 2008, 00:02
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Does the Perl script maybe set its own charset?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 21st May 2008, 08:49
cooljai cooljai is offline
Member
 
Join Date: May 2007
Location: /dev/random
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cooljai
Default

Quote:
Originally Posted by falko
Does the Perl script maybe set its own charset?
Might be, I have instructed programmers to have a look in it. Meanwhile, I just create a very simple perl script:
Code:
#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "Web Server running fine.";
and checked. Browser reports UTF-8.
Another annoying fact is that If I try to explore a directory:
Code:
http://serverip/cgi-bin/
Its showing 403 Forbidden and reporting chatset as "Western ISO-8859-1".

Do directories also have something to do with Charset?
__________________
Jagbir
Registered Linux User #468658.
Reply With Quote
  #6  
Old 21st May 2008, 14:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Quote:
Originally Posted by cooljai
Its showing 403 Forbidden and reporting chatset as "Western ISO-8859-1".
That page is coming from Apache.
Do you see any directives in your Apache configuration that are related to iso-8859-1?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 21st May 2008, 15:11
cooljai cooljai is offline
Member
 
Join Date: May 2007
Location: /dev/random
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cooljai
Default

Quote:
Originally Posted by falko
That page is coming from Apache.
Do you see any directives in your Apache configuration that are related to iso-8859-1?
Regarding Apache configurations, I didnt specified any other Charset in my httpd.conf. About the 403 page, I found it in /var/www/error/HTTP_FORBIDDEN.html.var and updated UTF-8 in it everywhere (including html file in include directory). Still, browser is showing "Western ISO-8859-1" charset..

any further clue?
__________________
Jagbir
Registered Linux User #468658.
Reply With Quote
  #8  
Old 22nd May 2008, 12:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
 
Default

Unfortunately not...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pop3 service alone is failed in "The Perfect Setup - Debian Sarge (3.1)" nandhu HOWTO-Related Questions 60 5th August 2008 16:15
Can't start apache Musty Server Operation 12 9th March 2008 14:58
Default Mail scan settings for new users timehost Installation/Configuration 3 26th October 2007 13:05
Exim MTA dazblade Server Operation 4 16th July 2007 19:42
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs pontifex HOWTO-Related Questions 2 26th October 2005 18:54


All times are GMT +2. The time now is 13:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.