Вы находитесь на странице: 1из 4

InstalacinApache,PHPconFreeTDSparaconexionesaSybase15

Versiones
Lasversionesutilizadasparaestaguason:
ElementaryFreya
Apache2.2.4
PHP5.2.3
Freetds0.64
ProcesodeInstalacin
DespusdeinstalarelSistemaOperativoElementaryOS,ejecutarlassiguientesinstrucciones
enlalineadecomandooterminal:
sudoaptgetupdate
sudoaptgetupgrade
InstalarelgestordepaquetesSynaptic
sudoaptgetinstallsynaptic
InstalarlossiguientespaquetesdesdeelGestordePaquetesSynaptic
gcc
libaio
libstdc
opensshserver
Instalarlassiglibrerasdesdelalineadecomandoscomousuarioprivilegiado:
aptgetinstalllibpngdev
aptgetinstalllibxml2dev
aptgetinstallg++
aptgetinstallopenssllibssldev
1. BajamoslosfuentesdeApachedelapginahttp://httpd.apache.org/ylocolocamosenel
directorio/usr/local/src
2. Desempaquetamosydescomprimimoselarchivohttpd2.2.4.tar.gz
$ tar -zxvf httpd-2.2.4.tar.gz

3. NosdirigimosaldirectoriodelosfuentesycreamoselMakefile
$ cd httpd-2.2.4
$ ./configure --prefix=/usr/local/apache \
--enable-so
\
--enable-cgi
\
--enable-info
\
--enable-rewrite
\
--enable-speling
\
--enable-usertrack
\
--enable-deflate \
--enable-mime-magic

4. CompilamosenbasealMakefilecreado
$ make

5. InstalamosApachecomoroot
# make install

6. BajamoslosfuentesdeFreeTDSdelapginahttp://www.freetds.org/ylocolocamosenel
directorio/usr/local/src
7. Desempaquetamosydescomprimimoselarchivofreetdsstable.tgz
$ tar -zxvf freetds-stable.tgz

8. NosdirigimosaldirectoriodelosfuentesycreamoselMakefile
$ cd freetds-0.64
$ ./configure --prefix=/usr/local/freetds

9. CompilamosenbasealMakefilecreado
$ make

10. InstalamosFreeTDScomoroot
# make install

11. BajamoslosfuentesdePHPdelapginahttp://www.php.net/downloads.phpylocolocamosen
eldirectorio/usr/local/src
12. Desempaquetamosydescomprimimoselarchivophp5.2.3.tar.gz
$ tar -zxvf php-5.2.3.tar.gz

13. NosdirigimosaldirectoriodelosfuentesycreamoselMakefile

$ cd php-5.2.3
$ ./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php/lib \
--with-zlib \
--with-png-dir=/usr/lib/i386-linux-gnu \
--with-jpeg-dir=/usr/lib/i386-linux-gnu \
--with-sybase-ct=/usr/local/freetds \
--enable-dbase
patch -p0 <php.patch
patch -p0 <ssl.patch

14. CompilamosenbasealMakefilecreado
$ make

15. Opcionalmentesepudehacereltest
$ make test

16. InstalamosPHPcomoroot
# make install

17. Verificamosqueexistaelarchivo/usr/local/apache/modules/libphp5.so,sinoesas,copiarde
lasiguentemanera:
# cp -p libs/libphp5.so /usr/local/apache/modules

18. Copiarelarchivophp.ini

# cp -p php.ini-recommended /usr/local/apache/php/lib/php.ini

19. Agregamoslassiguientedirectivasalarchivo/usr/local/apache/conf/http.conf(Puedenya
existir,siesas,soloverificar)
# PHP 5.x
LoadModule php5_module
modules/libphp5.so
AddHandler php5-script php
# Se agrega index.php al DirectoryIndex
DirectoryIndex index.html index.php
AddType application/x-httpd-php php
# PHP Syntax Coloring
AddType application/x-httpd-php-source phps

20. Probamosnuestrainstalacin,iniciandoapachecomoroot:
# /usr/local/apache/bin/apachectl start

21. Nosdirigimosaunnavegador,yenlabarradedireccionestecleamoslocalhost

22. Probamosnuestraconfiguracindephp,creandounscripteneldirectorio
/usr/local/apache/htdocsconnombrephpinfo.php.
<?php
phpinfo();
?>

23. InicioautomticodeApache
1. Copiamoselarchivodeinicioaldirectorio/etc/init.d
# cp /usr/local/apache/bin/apachectl /etc/init.d

2. Editamos/etc/init.d/apachectl,insertandolasdoslneasennegritas
#!/bin/sh
#
# chkconfig: - 85 15
# description: Apache is a Web server used to serve HTML files and CGI.
#
# Copyright 2000-2005 The Apache Software Foundation or its licensors,
as
# applicable.
. . .
# Apache control script designed to allow an easy command line
interface
# to controlling Apache. Written by Marc Slemko, 1997/08/23
. . .

3. Habilitamoselinicioautomticodelserviciodeapachecon:
# /sbin/chkconfig --add apachectl

Nota:chkconfigfuncionaconFedora,Mandrake,SUSE,RedHat(lainstruccin
equivalenteparaDebian,Ubuntuydistribucionesderivadasdeesta,es:updaterc.d
apachectldefaults)
24. Reiniciamosnuestroequipo,apachedebeiniciarautomticamente.
25. Procedemosacopiarlacarpetadelsistema(SII)enlasiguienteruta/usr/local/apache/htdocs/
conlasiguienteinstruccin
# cp sistema /usr/local/apache/htdocs/

26. Modificamoselarchivoconfig.inc.phpparaindicarlanuevarutahaciaeldirectorioraizdel
sistema
$CFG->rootDir= "/usr/local/apache/htdocs/sistema";

Nota:Noolvidarhacerloscambiosenelphp.iniquesemencionaronenelManualdeInstalacin
del SII (instalacion_SII.doc), la ruta en la que se encuentra este archivo es
/usr/local/apache/php/lib/php.ini
AlgunasObservacionesmas:
ObtenerlamemoriautilizadaporelSistemaOperativo
free -m
cat /proc/meminfo

Memoriaconsumidaporcadaconexiondeapache

ps -ylC apache2 --sort:rss | awk '{SUM += $8; I += 1} END {print SUM/I/1024}'

Memoriaconsumidaporlosdemasprocesos
ps -N -ylC apache2 --sort:rss | awk '{SUM += $8} END {print SUM/1024}'

Aumentar en numero de conexiones al servidor apache, cambiando la configuracion del archivo


mpm_prefork_module
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 270
MaxClients 250
MaxRequestsPerChild 0
</IfModule>
/etc/init.d/apache2 restart

Desactivar el entorno grfico de nuestro servidor para que no consuma mucha memoria y quede
disponibleparamasconexionesapache
sudonano/etc/default/grub
dondediceGRUB_CMDLINE_LINUX_DEFAULT=quietsplash
reemplazamosoagregamostext:GRUB_CMDLINE_LINUX_DEFAULT=&quot;text&quot;
CTRL+Oparaguardar
CTRL+Xparasalir
luegosudoupdategrub
Modificarelhttpd.confparaquenocrezcanmuchoslosarchivoslogparaquesolamenteregistrelos
eventoscriticosdeapache
LogLevelcrit

Вам также может понравиться