Christophe Casalegno

PALI : The Perfect Automatic Lamp Installer

PALI (Perfect Automatic Lamp Installer) is a shell script that will automatically transform your Debian 8 or sur Debian 9 server to a full pre-optimised LAMP (Linux Apache Mysql Php) stack. Just install a debian 8 or 9 with ssh and you can do a a very fast installation of apache + php + mysql + memcached (with stored memcached php sessions), git, nodejs, webmin grunt and other interesting things like a pre-optimised mysqlserver or SSL Let’s Encrypt Certificate with an only one command line.

It is a really simple script, so you can modify it if you need to add others software. I’ll update it each time i can. Today the script can do different things like :

  • Install vim, iotop, mc, apache2, rsync, screen, duplicity…
  • Install php-fpm (curl, apcu, gd, intl, imagick, imap, mcrypt, memcache, pspell, recode, sqlite, tidy, xmlrpc, xsl, soap, calendar)
  • Install Mysql-server / MariaDB, Mysql-client / MariaDB-client and phpmyadmin
  • Install munin, postfix, git, pure-ftpd, Imagemagick and curl
  • Install Composer, NodeJs, Grunt, Drupal Console, Drush and webmin
  • Activate userdir, rewrite, expires, deflate, headers and ssl
  • Configure pure-ftpd (FTP & FTPS) to use unix users and chroot them
  • Create a first virtualhost (on the hostname address) with a phpinfo and a phptest
  • Pre-Optimized mysql configuration
  • Pre-Optimized apache & php-fpm configuration
  • You can change ssh port (22 by default)
  • You can change webmin port (10000 by default)
  • You can choose your NodeJS version 6, 7 or 8 (7 by default)
  • Make a “hot modification” of the hostname of the server
  • Configure php for using memcached for session storage
  • Automatically install and configure Let’s encrypt certificate
  • Install & configure Fail2ban, rkhunter & chkrootkit
  • Install & configure an iptables firewall with adapted rules
  • Choose you admin email contact
  • Setup root, mysql & user password and sent you them by email

IMPORTANT : if you choose the let’s encrypt option (-l 1), your dns record *must* match your server IP Address before PALI installation .
Stop to talk, now you just want to install your server ? Just download and launch the script. You can just modify email address and just launch the script but you can also use directly the options when you launch the script :

  • -a email@address -> Admin email address that will receive the credentials
  • -n -> specify a new hostname for your server
  • -s port_number -> specify a new port for ssh (22 by default)
  • -w port_number -> specify a new port for webmin (10000 by default)
  • -j nodeJS_version -> specify your nodeJS version 6, 7 or 8(7 by default)
  • -l 1 -> Put 1 here to install your SSL vhost with let’s encrypt
  • -h -> just if you want help to use the command


wget --no-check-certificate
wget --no-check-certificate
chmod +x palivx(8 or 9).sh
./palivx(8 or 9).sh -a admin@mydom.tld -n myserver.dom.tld -s 65022 -w 65000 -j 7 -l 1

Note you can also just modify email address in the script and launch it like this if you want to change nothing (default port, no Let’s Encrypt SSL Certificate, etc.) :


That’s all. Really ? yes, now you can test installation with :
http://yourserver/phpinfo.php (for http)
https://yourserver:yourwebminport (for webmin)
http://yourserver/munin (for munin)
ssh -l yourlogin yourserver -p ssh_port (for ssh)

You can directly download the script from this url :

Have fun !

Christophe Casalegno