Modified script to run optimally on 1-2GB RAM VPS
- Base software list:
makeg++iptablesdashsyslogdexim4vimnanomchtopiftopiotop - Added
secureto create a new ssh user, change ssh port and disable ssh root logins - Moved
install_iptablesintosecure
- v1.2.1+
- Configured with gzip
- Must have a site installed later as config does not include server params
- Does not assume nginx will definitely be used to serve PHP files
- v5.5+ without InnoDB,
- Configured with query caching
- v5.4+ with APC installed and configured
- Other packages installed:
php5-cliphp5-mysqlphp-apcphp5-devphp5-mcryptphp5-imagickphp5-commonphp5-suhosinphp5-curlphp5-intlphp-gettextphp-pear- PECL packages:
rarzipapcmongo - PECL extensions are added as additional
.iniin/etc/php/conf.d
- Creates a MySQL database and a user from the provided username
- Creates a
DOMAIN.confin/etc/php5/fpm/pool.d/ - Creates a
DOMAIN.confin/etc/nginx/sites-available/ - Attempts to prevent image file script execution exploits (e.g.
someimage.jpg/malicious.php) - Attempts to rewrite URL
/index.php?params (currently for FuelPHP)
Creates the following directories and files:
/var/www/DOMAIN/
listen.sock (automatically created for nginx to connect to php5-fpm)
/var/www/DOMAIN/public_html
index.php (MySQL database, username and password are in comments)
pinfo.php (phpinfo)
/var/www/DOMAIN/logs
$ wget --no-check-certificate https://raw.github.com/marsd/midendscript/master/setup-debian.sh
$ chmod 744 setup-debian.sh
$ ./setup-debian.sh system
$ ./setup-debian.sh mysql
$ ./setup-debian.sh mongodb
$ ./setup-debian.sh nginx
$ ./setup-debian.sh php
$ ./setup-debian.sh site <example.com> <MySQL username>
$ ./setup-debian.sh secure <12345> <New SSH user>
- Disconnect from your current SSH connection and reconnect using the new port and username.
- Use
suto switch to root user after logging in - MySQL root is given a new password which is located in
~root/.my.cnf. - MySQL user for each site is located in
/var/www/DOMAIN/public_html/index.phpfile, and should be removed after storing the password in a safe location. - Delete, move or password protect
/var/www/<DOMAIN>/public_html/pinfo.phpfile, which installed automatically on each new site installation.