Difference between pages "Web-server-stack" and "Funtoo Linux Localization/pt-br"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
== Definir Idioma Padrão ==


== Pre-install considerations ==
No Funtoo, há dois arquivos de configuração responsáveis suas configurações de idioma: <code>/etc/locale.gen</code> e <code>/etc/env.d/00basic</code>. O primeiro arquivo contém somente en_US.UTF-8 locale habilitado. O ultimo é um arquivo padrão embarcado que vem a partir do stage3 e responsável pelo en_US.UTF-8 locale system-wide. não recomendado editar.
=== ssl ===
Os passos a seguir lhe guiarão através do processo de editar o idioma padrão do sistema (default system language), utilizando o francês canadense como um exemplo.
Ssl [http://en.wikipedia.org/wiki/Wildcard_certificate wild card certificates] can use the same certificate to cover several subdomain names. As in https://wiki.funtoo.org https://www.funtoo.org https://forums.funtoo.org can all use the same certificate.  https://funtoo.org would not be covered under the wildcard, so [[User:Threesixes|Threesixes]] ([[User talk:Threesixes|talk]]) suggests using http://domain.tld as a http navigation splash page directory. All that is required to setup a ca signed ssl certificate is an email on the server.  https://www.startssl.com offers free ssl ca certificates, though there are several other certificate [http://en.wikipedia.org/wiki/Certificate_authority#Providers providers]. Many web apps require you set your URL & will have problems if your URL is set to http://, rather than https://
Primeiro você terá que editar <code>/etc/locale.gen</code>:
<console>
# ##i##nano -w /etc/locale.gen
</console>
Especifique sua localidade preferida com o formato de caracter acompanhante (Você vai preferir principalmente UTF-8):
{{fancynote|É recomendado manter o en_US.UTF-8 locale pré-configurado com um fallback.}}
{{file|name=/etc/locale.gen|body=
en_US.UTF-8 UTF-8
fr_CA.UTF-8 UTF-8
}}
Para determinar uma localidade apropriada para o seu sistema, você deve dar uma olha em <code>/usr/share/i18n/SUPPORTED</code> para a lista padrão de combinações suportadas ou verifique o diretório <code>/usr/share/i18n/locales/</code> para uma lista de valores válidos.
{{fancywarning|Lhe é altamente aconcelhado usar ''ao menos uma'' localidade UTF-8 desde que algumas aplicações possam exigi-la.}}


=== sockets vs tcp stack ===
Agora, essas localidades precisam ser geradas:
Sockets have less overhead but can not be shared across jails, or to other machinesTcp stack has more overhead but is far more flexible.
<console>
# ##i##locale-gen
##g##*##!g## Generating 2 locales (this might take a while) with 1 jobs
*  (1/2) Generating en_US.UTF-8 ... [ ok ]
  *  (2/2) Generating fr_CA.UTF-8 ... [ ok ]
##g##*##!g## Generation complete
</console>


=== Email Servers ===
Uma vez feito, você pode aplicar suas configurações de localidade do system (locale settings system-wide). Primeiro exiba todas as opções disponíveis:
* {{Package|mail-mta/postfix}}  <-- suggested
<console>
* {{Package|mail-mta/ssmtp}}
$ ##i##eselect locale list
* {{Package|mail-mta/exim}}
##b####g##Available targets for the LANG variable:
* {{Package|mail-mta/sendmail}}
  ##b##[1]##!b##  C
* {{Package|mail-mta/nullmailer}}
  ##b##[2]##!b##  POSIX
  ##b##[3]##!b##  fr_CA.utf8
  ##b##[4]##!b##  en_US.utf8 ##bl##*
  ##b##[ ]##!b##  (free form)
</console>
O asterisco azul indica a localidade atual padrão do sistema. Você pode agora alterá-lo de acordo com o que desejar:
<console>
# ##i##eselect locale set 3
Setting LANG to fr_CA.utf8 ...
Run ". /etc/profile" to update the variable in your shell.
</console>
Alternativamente, você pode definir a localidade padrão manualmente. Esse arquivo deve primeiro ser criado com o seu editor preferido:
{{file|name=/etc/env.d/02locale|body=LANG="fr_CA.utf8"}}
Você pode verificar suas ações utilizando:
<console>
$ ##i##eselect locale show
##b####g##LANG variable in profile:
  ##b##fr_CA.utf8
</console>


=== FTP Servers ===
Para um efeito imediato é necessário recarregar o ambiente:
It is common practice to use FTP servers to host files for downloading.
<console>
# ##i##env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...
</console>
Parabéns! Você definiu com sucesso seu idioma padrão no Funtoo.


* {{Package|net-ftp/vsftpd}} <-- suggested
== Configurações do Portage ==
* {{Package|net-ftp/proftpd}}
* {{Package|net-ftp/pure-ftpd}}
* {{Package|net-ftp/qshare}}


== Webserver ==
Portage utiliza uma variável especial <code>LINGUAS</code> que define quais localizações/traduções são instaladas por padrão. Por padrão, <code>LINGUAS</code> em unset, a qual resultará em ''todas'' localizações disponíveis sendo instaladas pelo Portage.
Web servers come in several varieties. The most common stack is known as LAMP which stands for linux apache mysql php.  [[User:Threesixes|Threesixes]] ([[User talk:Threesixes|talk]]) suggests setting up the web server stack by selecting the database first, then scripting language second, and web server 3rd.


=== Databases ===
É possível personalizar as configurações de <code>LINGUAS</code> ao configurá-la em <code>/etc/make.conf</code>:
* {{Package|dev-db/mysql}}


mariadb is a drop in replacement for mysql
<console>
* {{Package|dev-db/mariadb}} <-- suggested
# ##i##LINGUAS="en_US zh_CN"
</console>


percona is a drop in replacement for mysql
The <code>LINGUAS</code> variable should use spaces between each localization name.
* {{Package|dev-db/percona-server}}


* {{Package|dev-db/postgresql-server}}
== Read Your Language ==
* {{Package|dev-db/sqlite}}


=== Languages ===
A newly installed Funtoo Linux does not able to read all the languages. You want to read the stuff, say, in Mozilla Firefox. You need to install fonts - A good sign that you have not installed the proper fonts is that the following characters appear as boxes with numbers inside: 日本語フォント
* {{Package|dev-lang/php}} <-- suggested
* {{Package|dev-lang/perl}}
* {{Package|dev-lang/python}}


=== Web Servers ===
Check if you have your language installed (Chinese) by using the <tt>fc-list</tt> command from the <tt>media-libs/fontconfig</tt> ebuild:
* {{Package|www-servers/apache}}
* {{Package|www-servers/cherokee}}
* {{Package|www-servers/nginx}} <-- suggested
* {{Package|www-servers/tengine}}
* {{Package|www-servers/lighttpd}}


<console>
# ##i##fc-list :lang=zh
</console>


=== SSL Termination, Reverse Proxies, & load balancing ===
If you are lucky, the right font will be installed, and your apps will also be able to use Chinese as the default language. But in case you not have the right font installed in this way, you need to install them manually.
Reverse proxies are useful, some cache static data, and shuck out cached pages rather than hitting the web server. Some pass requests to backend nodes high availability clustering your website, some web servers have this functionality built in.


* {{Package|www-servers/nginx}}
For Japanese:
* {{package|net-misc/stunnel}}
* {{package|www-servers/pound}} <-- suggested for ssl termination & load balancing
* {{Package|www-servers/varnish}} <-- suggested for caching to reduce power consumption & reduce the need of constantly rebuilding pages
* {{Package|net-proxy/squid}}


== Post install ==
<console>
There are several considerations to take into account with a web server install, such as setting up an email server, setting up a firewall, firewalling web applications, and dynamically firewalling attackers.
# ##i##emerge media-fonts/kochi-substitute
</console>


=== Firewalls ===
For Chinese:
* {{Package|net-firewall/nftables}}
<console>
* {{Package|net-firewall/iptables}} <-- suggested
# ##i##emerge media-fonts/arphicfonts
* {{Package|net-firewall/firewalld}}
</console>
* {{Package|net-firewall/ufw}}


=== Dynamic Firewalling ===
For Korean:
* {{Package|app-admin/sshguard}} <-- suggested
* {{Package|net-analyzer/fail2ban}}


=== Webapp Firewalls ===
<console>
# ##i##emerge media-fonts/baekmuk-fonts
</console>
== Keymap ==


Apache has an option for webapplication firewalling.  as far as [[User:Threesixes|Threesixes]] ([[User talk:Threesixes|talk]]) can tell this passes login errors & excessive site fuzzing to logs for fail2ban/sshguard to deal with.
Funtoo Linux defaults to a US English keyboard. If you are using another type of keyboard, edit <tt>/etc/conf.d/keymaps</tt> and set keymap to your keyboard model. For example, cf for French Canadian keyboard, fr for French Azerty.
https://github.com/nbs-system/naxsi is a web app firewall for nginx.


=== Benchmarking ===
<console>
It's a good idea to benchmark your system, server, & websites.  There are several tools to assist you in doing this.
# ##i##nano -w /etc/conf.d/keymaps
</console>
== Input Method ==


* http://toolbar.netcraft.com/site_report?url=undefined#last_reboot
ibus is an Intelligent Input Bus for Linux.
* http://gtmetrix.com/
 
* http://www.showslow.com/
<console>
* http://yslow.org/
# ##i##emerge -av ibus
* http://getfirebug.com/
</console>
* {{Package|app-admin/apache-tools}}
 
* {{Package|app-benchmarks/sysbench}}
You also need to install language table for ibus (Chinese)
* {{Package|app-benchmarks/phoronix-test-suite}}
 
* {{Package|app-benchmarks/iozone}}
<console>
* {{Package|app-benchmarks/piozone}}
# ##i##emerge -av ibus-table-chinese
* {{Package|app-benchmarks/siege}}
</console>
* {{Package|app-benchmarks/ramspeed}}
 
* {{Package|app-benchmarks/jmeter}}
[[Category:Install|Localization]]

Revision as of 21:43, February 5, 2015

Definir Idioma Padrão

No Funtoo, há dois arquivos de configuração responsáveis suas configurações de idioma: /etc/locale.gen e /etc/env.d/00basic. O primeiro arquivo contém somente en_US.UTF-8 locale habilitado. O ultimo é um arquivo padrão embarcado que vem a partir do stage3 e responsável pelo en_US.UTF-8 locale system-wide. não recomendado editar. Os passos a seguir lhe guiarão através do processo de editar o idioma padrão do sistema (default system language), utilizando o francês canadense como um exemplo. Primeiro você terá que editar /etc/locale.gen:

root # nano -w /etc/locale.gen

Especifique sua localidade preferida com o formato de caracter acompanhante (Você vai preferir principalmente UTF-8):

   Note

É recomendado manter o en_US.UTF-8 locale pré-configurado com um fallback.

   /etc/locale.gen
en_US.UTF-8 UTF-8
fr_CA.UTF-8 UTF-8

Para determinar uma localidade apropriada para o seu sistema, você deve dar uma olha em /usr/share/i18n/SUPPORTED para a lista padrão de combinações suportadas ou verifique o diretório /usr/share/i18n/locales/ para uma lista de valores válidos.

   Warning

Lhe é altamente aconcelhado usar ao menos uma localidade UTF-8 desde que algumas aplicações possam exigi-la.

Agora, essas localidades precisam ser geradas:

root # locale-gen
 * Generating 2 locales (this might take a while) with 1 jobs
 *  (1/2) Generating en_US.UTF-8 ... [ ok ]
 *  (2/2) Generating fr_CA.UTF-8 ... [ ok ]
 * Generation complete

Uma vez feito, você pode aplicar suas configurações de localidade do system (locale settings system-wide). Primeiro exiba todas as opções disponíveis:

user $ eselect locale list
root ##b##Available targets for the LANG variable:
  [1]   C
  [2]   POSIX
  [3]   fr_CA.utf8
  [4]   en_US.utf8 *
  [ ]   (free form)

O asterisco azul indica a localidade atual padrão do sistema. Você pode agora alterá-lo de acordo com o que desejar:

root # eselect locale set 3
Setting LANG to fr_CA.utf8 ...
Run ". /etc/profile" to update the variable in your shell.

Alternativamente, você pode definir a localidade padrão manualmente. Esse arquivo deve primeiro ser criado com o seu editor preferido:

   /etc/env.d/02locale
LANG="fr_CA.utf8"

Você pode verificar suas ações utilizando:

user $ eselect locale show
root ##b##LANG variable in profile:
  fr_CA.utf8

Para um efeito imediato é necessário recarregar o ambiente:

root # env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...

Parabéns! Você definiu com sucesso seu idioma padrão no Funtoo.

Configurações do Portage

Portage utiliza uma variável especial LINGUAS que define quais localizações/traduções são instaladas por padrão. Por padrão, LINGUAS em unset, a qual resultará em todas localizações disponíveis sendo instaladas pelo Portage.

É possível personalizar as configurações de LINGUAS ao configurá-la em /etc/make.conf:

root # LINGUAS="en_US zh_CN"

The LINGUAS variable should use spaces between each localization name.

Read Your Language

A newly installed Funtoo Linux does not able to read all the languages. You want to read the stuff, say, in Mozilla Firefox. You need to install fonts - A good sign that you have not installed the proper fonts is that the following characters appear as boxes with numbers inside: 日本語フォント

Check if you have your language installed (Chinese) by using the fc-list command from the media-libs/fontconfig ebuild:

root # fc-list :lang=zh

If you are lucky, the right font will be installed, and your apps will also be able to use Chinese as the default language. But in case you not have the right font installed in this way, you need to install them manually.

For Japanese:

root # emerge media-fonts/kochi-substitute

For Chinese:

root # emerge media-fonts/arphicfonts

For Korean:

root # emerge media-fonts/baekmuk-fonts

Keymap

Funtoo Linux defaults to a US English keyboard. If you are using another type of keyboard, edit /etc/conf.d/keymaps and set keymap to your keyboard model. For example, cf for French Canadian keyboard, fr for French Azerty.

root # nano -w /etc/conf.d/keymaps

Input Method

ibus is an Intelligent Input Bus for Linux.

root # emerge -av ibus

You also need to install language table for ibus (Chinese)

root # emerge -av ibus-table-chinese