Difference between pages "Package:Apache" and "Emerge/pt-br"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
(Removed table of USE flags, as this is going to be added by an update Daniel is working on.)
 
 
Line 1: Line 1:
{{Ebuild
== Principiando com o emerge ==
|Summary=The Apache Web Server
Emerge é o front-end para o gerenciador de Portage do funtoo. Com o emerge é fácil instalar, atualizar ou remover pacotes.
|CatPkg=www-servers/apache
|Maintainer=polynomial-c@gentoo.org
|Homepage=http://httpd.apache.org/
}}
Apache is a powerful web server which serves html/css/cgi/pl out of the box, and can serve other languages/frameworks via extensions.


The [http://httpd.apache.org/ Apache Homepage] says this of Apache:
=== Atualizar a Base de Dados de Pacote ===
'''Sincronize base de dados de pacote local. Isso atualizará sua arvore Portage local com a ultima versão do Funtoo ebuilds.'''
<console>
###i## emerge --sync
</console>


<blockquote>
=== Buscar pacotes ===
The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
'''Busca pacotes por nome.'''
</blockquote>
<console>
###i## emerge -s firefox
###i## emerge --search firefox
</console>


== Install ==
'''Busca pacotes pode descrição.'''
=== Configure USE Flags ===
<console>
If you want to enable any of the above use flags, create a file called <tt>/etc/portage/package.use/apache</tt> and add the options that you want to enable to it. For example:
###i## emerge -S web browser
{{file|name=/etc/portage/package.use/apache|desc= |body=
###i## emerge --searchdesc web browser
www-servers/apache ssl threads
</console>
}}


=== Emerge ===
=== Install packages ===
After you have configured the USE flags that you want to build Apache with, emerge it:
'''Instalar pacote.'''
<console>###i## emerge apache</console>
<console>
###i## emerge firefox
</console>


== Configuration ==
'''Instalar múltiplos pacotes.'''
=== System ===
<console>
Many packages have apache2 use flags. These use flags are often required for an application to be supported by Apache. Setting a system wide apache2 use flag is a good idea.
###i## emerge firefox thunderbird
</console>


{{file|name=/etc/portage/make.conf|desc=set system wide apache2 useflag|body=
'''Instalar pacotes. Pedir por confirmação antes de realizar quaisquer alterações. Exibe saída em verbose.'''
USE="...,apache2,..."
<console>
}}
###i## emerge -av firefox
###i## emerge --ask firefox
</console>


=== Package ===
=== Remove packages ===
Apache's configuration files are broken up and located in several spots.
'''Remove package.'''
*<code>/etc/conf.d/apache2</code>
<console>
*<code>/etc/apache2/httpd.conf</code>
###i## emerge -C firefox
*<code>/etc/apache2/modules.d/*</code>
###i## emerge --unmerge firefox
*<code>/etc/apache2/vhosts.d/*</code>
</console>


<code>conf.d</code> controls the init script, adding things to it such as -D SECURITY & -D PHP5 will enable web application fire-walling & the php scripting language.
'''Remove package. Ask for confirmation before performing any changes.'''
<console>
###i## emerge -aC firefox
</console>


<code>httpd.conf</code> controls how the server behaves, at the bottom of the file it has directives to include configuration files ending in .conf in <code>/etc/apache2/modules.d</code> and <code>/etc/apache2/vhosts.d</code>
'''Remove orphaned packages. Ask for confirmation before performing any changes.'''
<console>
###i## emerge -a --depclean
</console>


== Service ==
=== Update packages ===
'''Update all packages.'''
<console>
###i## emerge -uDN @world
</console>


To start apache immediately:
'''Update all packages. Ask for confirmation before performing any changes. Show verbose output.'''
<console>
<console>
###i## rc-service apache2 start
###i## emerge -uavDN @world
</console>
</console>


To start apache upon boot:
'''When upgrading to a new version of perl, it is necessary to also run <code>perl-cleaner</code> afterwards:'''
<console>
<console>
###i## rc-update add apache2
###i## emerge -auvDN @world
###i## perl-cleaner --all
</console>
</console>


== mod_rewrite ==
{{Note|This requirement of running <code>perl-cleaner</code> will eventually go away, once all perl-related ebuilds are updated to EAPI 5. EAPI 5 is a version of the Ebuild specification that supports smart updating of perl-related bits.}}
=== What is <code>mod_rewrite</code>? ===
The [http://httpd.apache.org/docs/current/mod/mod_rewrite.html Apache documentation] describes <code>mod_rewrite</code> as:
 
<blockquote>
The mod_rewrite module uses a rule-based rewriting engine, based on a PCRE regular-expression parser, to rewrite requested URLs on the fly. By default, mod_rewrite maps a URL to a filesystem path. However, it can also be used to redirect one URL to another URL, or to invoke an internal proxy fetch.
</blockquote>
 
=== Setting it up ===
mod_rewrite has a reputation of being difficult to set up.  mod_rewrite requires following symlinks & Order allow,deny (apache 2.2) or Require all granted (apache 2.4) is set.  To test functionality of mod_rewrite we will need to make a few files.
 
{{fancynote|If you want to test this for web applications such as mediawiki adjust the path to <code>/var/www/localhost/htdocs/mediawiki/.htaccess</code>}}
 
{{file|name=/var/www/localhost/htdocs/.htaccess|desc=enable the rewrite engine|body=
RewriteEngine on
RewriteRule ^test.html$ rewrite.html
}}
 
{{file|name=/var/www/localhost/htdocs/test.html|desc=set system wide apache2 useflag|body=
rewrite is not working
}}
 
{{file|name=/var/www/localhost/htdocs/rewrite.html|desc=set system wide apache2 useflag|body=
rewrite is working
}}
 
Then point your browser to http://127.0.0.1/test.html. You should see that the text from rewrite.html has been loaded.
 
{{EbuildFooter}}

Revision as of 16:52, February 7, 2015

Principiando com o emerge

Emerge é o front-end para o gerenciador de Portage do funtoo. Com o emerge é fácil instalar, atualizar ou remover pacotes.

Atualizar a Base de Dados de Pacote

Sincronize base de dados de pacote local. Isso atualizará sua arvore Portage local com a ultima versão do Funtoo ebuilds.

root # emerge --sync

Buscar pacotes

Busca pacotes por nome.

root # emerge -s firefox
root # emerge --search firefox

Busca pacotes pode descrição.

root # emerge -S web browser
root # emerge --searchdesc web browser

Install packages

Instalar pacote.

root # emerge firefox

Instalar múltiplos pacotes.

root # emerge firefox thunderbird

Instalar pacotes. Pedir por confirmação antes de realizar quaisquer alterações. Exibe saída em verbose.

root # emerge -av firefox
root # emerge --ask firefox

Remove packages

Remove package.

root # emerge -C firefox
root # emerge --unmerge firefox

Remove package. Ask for confirmation before performing any changes.

root # emerge -aC firefox

Remove orphaned packages. Ask for confirmation before performing any changes.

root # emerge -a --depclean

Update packages

Update all packages.

root # emerge -uDN @world

Update all packages. Ask for confirmation before performing any changes. Show verbose output.

root # emerge -uavDN @world

When upgrading to a new version of perl, it is necessary to also run perl-cleaner afterwards:

root # emerge -auvDN @world
root # perl-cleaner --all
   Note

This requirement of running perl-cleaner will eventually go away, once all perl-related ebuilds are updated to EAPI 5. EAPI 5 is a version of the Ebuild specification that supports smart updating of perl-related bits.