Servidor web · 2 min read · Oct 25, 2025

La Configuración Perfecta - Debian Etch (Debian 4.0) - Página 6

13 Apache/PHP5

Ahora instalamos Apache:

apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert

A continuación, instalamos PHP5:

apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Se te hará la siguiente pregunta:

¿Continuar instalando libc-client sin soporte para Maildir? <– Sí

A continuación, editamos /etc/apache2/mods-available/dir.conf:

vi /etc/apache2/mods-available/dir.conf

y cambiamos la línea DirectoryIndex:

| DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml |

Edita /etc/apache2/ports.conf y añade Listen 443:

vi /etc/apache2/ports.conf

| Listen 80 Listen 443 |

Ahora tenemos que habilitar algunos módulos de Apache (SSL, rewrite, suexec e include):

a2enmod ssl
a2enmod rewrite
a2enmod suexec
a2enmod include

Recarga la configuración de Apache:

/etc/init.d/apache2 force-reload

13.1 Deshabilitar PHP Globalmente

(Si no planeas instalar ISPConfig en este servidor, ¡por favor salta esta sección!)

En ISPConfig configurarás PHP por sitio web, es decir, puedes especificar qué sitio web puede ejecutar scripts PHP y cuál no. Esto solo puede funcionar si PHP está deshabilitado globalmente porque de lo contrario todos los sitios web podrían ejecutar scripts PHP, sin importar lo que especifiques en ISPConfig.

Para deshabilitar PHP globalmente, editamos /etc/mime.types y comentamos las líneas application/x-httpd-php:

vi /etc/mime.types

| [...] #application/x-httpd-php phtml pht php #application/x-httpd-php-source phps #application/x-httpd-php3 php3 #application/x-httpd-php3-preprocessed php3p #application/x-httpd-php4 php4 [...] |

Edita /etc/apache2/mods-enabled/php5.conf y comenta las siguientes líneas:

vi /etc/apache2/mods-enabled/php5.conf

| # AddType application/x-httpd-php .php .phtml .php3 # AddType application/x-httpd-php-source .phps |

Luego reinicia Apache:

/etc/init.d/apache2 restart

14 Proftpd

Para instalar Proftpd, ejecuta

apt-get install proftpd ucf

Se te hará una pregunta:

¿Ejecutar proftpd desde inetd o de forma independiente? <– independiente

Luego abre /etc/proftpd/proftpd.conf y cambia UseIPv6 de on a off; de lo contrario, recibirás una advertencia como esta cuando inicies Proftpd:

  • IPv6 getaddrinfo ‘server1.example.com’ error: Nombre o servicio no conocido
vi /etc/proftpd/proftpd.conf

| [...] UseIPv6 off [...] |

Por razones de seguridad, también puedes añadir las siguientes líneas a /etc/proftpd/proftpd.conf (gracias a Reinaldo Carvalho; más información se puede encontrar aquí: http://proftpd.org/localsite/Userguide/linked/userguide.html):

vi /etc/proftpd/proftpd.conf

| [...] DefaultRoot ~ IdentLookups off ServerIdent on "FTP Server ready." [...] |

ISPConfig espera que la configuración esté en /etc/proftpd.conf en lugar de /etc/proftpd/proftpd.conf, por lo tanto, creamos un enlace simbólico (puedes omitir este comando si no deseas instalar ISPConfig):

ln -s /etc/proftpd/proftpd.conf /etc/proftpd.conf

Luego reinicia Proftpd:

/etc/init.d/proftpd restart
Share: X/Twitter LinkedIn

Recibe nuevas publicaciones en tu bandeja de entrada.

No spam. Cancela la suscripción en cualquier momento.