Instalar Apache httpd

De BandaAncha.st
Saltar a: navegación, buscar

Objetivos[editar]

Compilar Apache httpd junto con mod_fcgi.

  • con optimizaciones para mejorar el rendimiento del binario
  • modulos compilados estáticamente
  • solo los modulos que se vayan a utilizar
  • con mod_fcgi compilado estáticamente

Compile-Time Configuration Issues[editar]

Añadimos

CFLAGS="-DDYNAMIC_MODULE_LIMIT=0"

If you have no intention of using dynamically loaded modules (you probably don't if you're reading this and tuning your server for every last ounce of performance) then you should add -DDYNAMIC_MODULE_LIMIT=0 when building your server. This will save RAM that's allocated only for supporting dynamically loaded modules.

--enable-nonportable-atomics

By default, APR uses mutex-based atomics on Linux. If you configure with --enable-nonportable-atomics, however, APR generates code that uses a 486 opcode for fast hardware compare-and-swap. This will result in more efficient atomic operations, but the resulting executable will run only on 486 and later chips (and not on 386).

Enlaces[editar]

Pasos previos[editar]

Me ha sido necesario:

yum install autoconf # para ./buildconf
yum install libtools # compilador C
yum install zlib.devel # utilizado por mod_deflate

Proceso[editar]

# bajo lo necesario
wget http://apache.rediris.es/httpd/httpd-2.2.4.tar.gz
wget http://kent.dl.sourceforge.net/sourceforge/mod-fcgid/mod_fcgid.2.1.tar.gz
# descomprimo
tar -xzvf httpd-2.2.17.tar.gz
tar -zxvf mod_fcgid.2.3.6.tar.gz
# copio el directorio de mod_fcgid sobre el de apache para compilarlo estáticamente
cp -R mod_fcgid.2.3.6 httpd-2.2.17
# configuramos fuentes
cd httpd-2.2.17
./buildconf

Sin soporte para módulos:

CFLAGS="-DDYNAMIC_MODULE_LIMIT=0" \
./configure \
	--enable-nonportable-atomics \
	--with-mpm=worker \
	--disable-actions \
	--disable-alias \
	--disable-asis \
	--disable-authn_default \
	--disable-authz_default \
	--disable-authz_groupfile \
	--disable-authz_host \
	--disable-autoindex \
	--disable-env \
	--disable-filter \
	--disable-imagemap \
	--disable-include \
	--disable-negotiation \
	--disable-setenvif \
	--disable-so \
	--disable-status \
	--disable-userdir \
	--enable-deflate \
	--enable-expires \
	--enable-fcgid \
	--enable-headers \
	--enable-rewrite \
	--enable-ssl
# compilamos
make
# instalamos
make install

Con soporte para módulos:

./configure \
	--enable-nonportable-atomics \
	--with-mpm=worker \
	--disable-actions \
	--disable-alias \
	--disable-asis \
	--disable-authn_default \
	--disable-authz_default \
	--disable-authz_groupfile \
	--disable-authz_host \
	--disable-autoindex \
	--disable-env \
	--disable-filter \
	--disable-imagemap \
	--disable-include \
	--disable-negotiation \
	--disable-setenvif \
	--disable-status \
	--disable-userdir \
	--enable-deflate \
	--enable-expires \
	--enable-fcgid \
	--enable-headers \
	--enable-rewrite \
	--enable-ssl

curl-devel.x86_64

 LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.1/ext/apache2/mod_passenger.so
  PassengerRoot /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.1
  PassengerRuby /usr/local/ruby/bin/ruby


  <VirtualHost *:80>
     ServerName www.yourhost.com
     DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
     <Directory /somewhere/public>
        AllowOverride all              # <-- relax Apache security settings
        Options -MultiViews            # <-- MultiViews must be turned off
     </Directory>
  </VirtualHost>

Configuración[editar]