Change language in Apache

4 posts / 0 new
Last post
#1 Sun, 06/16/2019 - 05:10
gsommaruga

Change language in Apache

By creating a site, the HTML page displays a set of incorrect characters.

For example, the accented letter "è" is transformed to "Ã".
I should therefore change the language configuration in Apache, in Italian in my case, but I didn't understand where in Webmin / Virtualmin I need to change these settings.

Also I didn't understand if in the "Default Server" I have to identify the language code for all non-standard extensions.
For example, I have a site with the extension ".online" and in defualt server I have inserted in the two empty fields:
it    .online
But creating the Virtual Server the characters are still wrong.

Thanks in advance for the help

Mon, 06/17/2019 - 09:11
andreychek

Howdy,

I'm unfortunately not too familiar with language settings in Apache, that's not something I've needed to tweak before.

Are you looking to change the default language for all websites though?

If so, one thing I might try is to edit "/etc/apache2/mods-enabled/mime.conf", and to look for the "DefaultLanguage" line that's commented out by default.

You can try uncommenting that, setting it to the language of your choice, and then restarting Apache.

After that, do your web pages show up as expected?

-Eric

Tue, 06/18/2019 - 02:24
gsommaruga

Thanks, Eric, for the reply.
No, changing that file does not change the result.

However, it makes sense to modify the files directly only if Webmin and Virtualmin do not manage that functionality.
This also to avoid confusion during the changes because in the future you will not remember what has been changed in Webmin / Virtualmin and what in the files.

I'm not too familiar with language settings in Apache and on the other hand I don't even know enough about Webmin / Virtualmin and the documentation doesn't help.

In "Webmin Configuration / Language and Locale" there is the option "Character set for HTML pages".
What (and when) should be indicated here?
If I enter the Italian set (ISO-8859-1) it still doesn't work.
Instead, then in Virtaulmin appears the warning message:

Detected that you are using non-unicode character set, which is not recommended. Strange  character might appear in text-editor mode and/or other encoding issues are going to happen.  
Change language in  Virtualmin Configuration to en.UTF-8 and make sure, that your browser also detected it correctly.

In Server / Apache Server / Languages there are these options that I modified in this way:
Character set for documents = ISO-8859-1
Default language for files = it
But even with these changes the html pages are displayed with the wrong character set.

Giorgio

Tue, 06/18/2019 - 12:44
andreychek

Howdy,

Webmin and Virtualmin are just editing those same files -- it's personal preference as to which you use.

You're welcome to make those changes from within Virtualmin, though we may need to review/troubleshoot the config manually a bit to sort out what the cause of that issue is.

What is the output of these commands:

find /etc/apache2 -type f | xargs grep -i AddDefaultCharset
find /etc/apache2 -type f | xargs grep -i DefaultLanguage
Topic locked