Server Setup · 3 min read · Jan 15, 2026
Il Server Perfetto - CentOS 5.5 x86_64 [ISPConfig 3] - Pagina 5
15 Installazione di Apache2 Con mod_php, mod_fcgi/PHP5, E suPHP
ISPConfig 3 ti consente di utilizzare mod_php, mod_fcgi/PHP5, cgi/PHP5 e suPHP su base per sito web.
mod_fcgid non è disponibile nei repository ufficiali di CentOS, ma c’è un pacchetto per CentOS 5.x nel repository di testing centos.karan.org. Abilitiamo il repository come segue:
cd /etc/yum.repos.d/
wget http://centos.karan.org/kbsingh-CentOS-Extras.repo
Successivamente apriamo /etc/yum.repos.d/kbsingh-CentOS-Extras.repo…
vi /etc/yum.repos.d/kbsingh-CentOS-Extras.repo… e impostiamo gpgcheck a 0 e enabled a 1 nella sezione [kbs-CentOS-Testing]:
| [...] [kbs-CentOS-Testing] name=CentOS.Karan.Org-EL$releasever - Testing gpgcheck=0 gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt enabled=1 baseurl=http://centos.karan.org/el$releasever/extras/testing/$basearch/RPMS/ |
Dopo possiamo installare Apache2 con mod_php5, mod_fcgid e PHP5:
yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-mbstring php-mcrypt php-mhash php-mssql php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php-cli httpd-develSuccessivamente apriamo /etc/php.ini…
vi /etc/php.ini… e cambiamo la segnalazione degli errori (in modo che le notifiche non vengano più mostrate) e aggiungiamo cgi.fix_pathinfo = 1 alla fine del file:
| [...] ;error_reporting = E_ALL error_reporting = E_ALL & ~E_NOTICE [...] cgi.fix_pathinfo = 1 |
Successivamente installiamo suPHP:
cd /tmp
wget http://suphp.org/download/suphp-0.7.1.tar.gz
tar xvfz suphp-0.7.1.tar.gz
cd suphp-0.7.1/
./configure –prefix=/usr –sysconfdir=/etc –with-apr=/usr/bin/apr-1-config –with-apxs=/usr/sbin/apxs –with-apache-user=apache –with-setid-mode=owner –with-php=/usr/bin/php-cgi –with-logfile=/var/log/httpd/suphp_log –enable-SUPHP_USE_USERGROUP=yes
make
make install
Poi aggiungiamo il modulo suPHP alla nostra configurazione di Apache…
vi /etc/httpd/conf.d/suphp.conf| LoadModule suphp_module modules/mod_suphp.so |
… e creiamo il file /etc/suphp.conf come segue:
vi /etc/suphp.conf| [global] ;Path to logfile logfile=/var/log/httpd/suphp.log ;Loglevel loglevel=info ;User Apache is running as webserver_user=apache ;Path all scripts have to be in docroot=/ ;Path to chroot() to before executing script ;chroot=/mychroot ; Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false ;Check wheter script is within DOCUMENT_ROOT check_vhost_docroot=true ;Send minor error messages to browser errors_to_browser=false ;PATH environment variable env_path=/bin:/usr/bin ;Umask to set, specify in octal notation umask=0077 ; Minimum UID min_uid=100 ; Minimum GID min_gid=100 [handlers] ;Handler for php-scripts x-httpd-suphp="php:/usr/bin/php-cgi" ;Handler for CGI-scripts x-suphp-cgi="execute:!self" |
Infine riavviamo Apache:
/etc/init.d/httpd restart16 Installa PureFTPd
PureFTPd può essere installato con il seguente comando:
yum install pure-ftpdPoi crea i collegamenti di avvio del sistema e avvia PureFTPd:
chkconfig –levels 235 pure-ftpd on
/etc/init.d/pure-ftpd start
17 Installa un Server DNS Chrooted (BIND9)
Per installare un BIND9 chrooted, facciamo così:
yum install bind-chrootPoi facciamo questo:
chmod 755 /var/named/
chmod 775 /var/named/chroot/
chmod 775 /var/named/chroot/var/
chmod 775 /var/named/chroot/var/named/
chmod 775 /var/named/chroot/var/run/
chmod 777 /var/named/chroot/var/run/named/
cd /var/named/chroot/var/named/
ln -s ../../ chroot
touch /var/named/chroot/var/named/named.local
cp /usr/share/doc/bind-9.3.6/sample/var/named/named.root /var/named/chroot/var/named/named.root
touch /var/named/chroot/etc/named.conf.local
vi /var/named/chroot/etc/named.conf
| // named.conf // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS server as a caching only nameserver (as a localhost DNS resolver only). // See /usr/share/doc/bind*/sample/ for example named configuration files. // options { listen-on port 53 { any; }; listen-on-v6 port 53 { any; }; directory "/var/named/chroot/var/named"; dump-file "/var/named/chroot/var/named/data/cache_dump.db"; statistics-file "/var/named/chroot/var/named/data/named_stats.txt"; memstatistics-file "/var/named/chroot/var/named/data/named_mem_stats.txt"; allow-query { any; }; recursion no; allow-recursion { none; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "." IN { type hint; file "named.root"; }; include "/var/named/chroot/var/named/named.local"; |
chkconfig –levels 235 named on
/etc/init.d/named start
BIND verrà eseguito in una prigione chroot sotto /var/named/chroot/var/named/. Userò ISPConfig per configurare BIND (zone, ecc.).
18 Installa Vlogger E Webalizer
Vlogger e webalizer possono essere installati come segue:
yum install webalizer perl-DateTime-Format-HTTP perl-DateTime-Format-Buildercd /tmp
wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz
tar xvfz vlogger-1.3.tar.gz
mv vlogger-1.3/vlogger /usr/sbin/
rm -rf vlogger*
19 Installa Jailkit
Jailkit è necessario solo se vuoi chrootare gli utenti SSH. Può essere installato come segue (importante: Jailkit deve essere installato prima di ISPConfig - non può essere installato dopo!):
cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.11.tar.gz
tar xvfz jailkit-2.11.tar.gz
cd jailkit-2.11
./configure
make
make install
cd ..
rm -rf jailkit-2.11*
20 Installa fail2ban
Questo è facoltativo ma raccomandato, perché il monitor di ISPConfig cerca di mostrare il log:
yum install fail2banchkconfig –levels 235 fail2ban on
/etc/init.d/fail2ban start
21 Installa rkhunter
rkhunter può essere installato come segue:
yum install rkhunterRicevi i nuovi post nella tua casella di posta.
Nessuno spam. Disiscriviti in qualsiasi momento.