Code Monkey home page Code Monkey logo

lowendscript's Introduction

Debian 6/7 VPS Script

Remove excess packages (apache2, sendmail, bind9, samba, nscd, etc) and install the basic components needed for a light-weight HTTP(S) web server:

  • dropbear (SSH)
  • iptables (firewall)
  • dash (replaces bash)
  • syslogd
  • MySQL (v5.5+ without Innodb, configured for lowend VPS)
  • PHP-FPM (v5.3+ with APC installed and configured)
  • exim4 (light mail server)
  • nginx (v1.2+ from dotdeb, configured for lowend VPS. Change worker_processes in nginx.conf according to number of CPUs)
  • vim, nano, mc, htop, iftop & iotop

Includes sample nginx config files for PHP sites. You can create a basic site shell (complete with nginx vhost) like this:

./setup-debian.sh site example.com

When running the iptables or dropbear install you must specify a SSH port. Remember, port 22 is the default. It's recommended that you change this from 22 just to save server load from attacks on that port.

Usage (in recommended order)

Warning! This script will overwrite previous configs during reinstallation.

wget --no-check-certificate https://raw.github.com/Xeoncross/lowendscript/master/setup-debian.sh 
chmod +x setup-debian.sh
./setup-debian.sh dotdeb # not required if using Ubuntu
./setup-debian.sh system
./setup-debian.sh dropbear [port]
./setup-debian.sh iptables [port]
./setup-debian.sh mysql
./setup-debian.sh nginx
./setup-debian.sh php
./setup-debian.sh exim4
./setup-debian.sh site [domain.tld]
./setup-debian.sh mysqluser [domain.tld]
./setup-debian.sh wordpress [domain.tld]
./setup-debian.sh 3proxy 3128
./setup-debian.sh 3proxyauth username password

Development

This repository uses tagged releases and all new additions need to be added to the development branch.

... and now time for some extras

Webmin
./setup-debian.sh webmin
vzfree

Supported only on OpenVZ only, vzfree reports correct memory usage

./setup-debian.sh vzfree
Classic Disk I/O and Network test

Run the classic Disk IO (dd) & Classic Network (cachefly) Test

./setup-debian.sh test
Neat python script to report memory usage per app

Neat python script to report memory usage per app

./setup-debian.sh ps_mem
sources.list updating (Ubuntu only)

Updates Ubuntu /etc/apt/sources.list to default based on whatever version you are running

./setup-debian.sh apt
Info on Operating System, version and Architecture
./setup-debian.sh info
SSH-Keys

Either you want to generate ssh-keys (id_rsa) or a custom key for something (rsync etc) Note: argument is optional, if its left out, it will write "id_rsa" key

./setup-debian.sh sshkey [optional argument_1]
Extras

Fixing locale on some OpenVZ Ubuntu templates

./setup-debian.sh locale

Configure or reconfigure MOTD

./setup-debian.sh motd

After installation

  • MySQL root is given a new password which is located in ~root/.my.cnf.
  • After installing the full set, RAM usage reaches ~40-45MB. By default APC configured to use 32MB for caching. To reduce ram usage, you may disable APC by moving or deleting the following file - /etc/php5/conf.d/apc.ini
  • I recommend installing Ajenti and/or Webmin to manage your VPS.
  • For security reasons delete, move or password protect "[domain.tld]/public/phpinfo.php" file, which installed automatically on each new site installation.

Credits

lowendscript's People

Contributors

asimzeeshan avatar cwaffles avatar esemeniuc avatar ilevkov avatar j-mie avatar kevcenteno avatar lowendbox avatar minecrafter avatar perttierkkila avatar shaunpud avatar suciptoid avatar suvdeep avatar tourshi avatar widcket avatar xeoncross avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lowendscript's Issues

wordpress is ERROR

--2014-10-20 02:40:12-- http://wordpress.org/latest.tar.gz
Resolving wordpress.org... 66.155.40.249, 66.155.40.250
Connecting to wordpress.org|66.155.40.249|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://wordpress.org/latest.tar.gz [following]
--2014-10-20 02:40:12-- https://wordpress.org/latest.tar.gz
Connecting to wordpress.org|66.155.40.249|:443... connected.
ERROR: certificate common name *.wordpress.org' doesn't match requested host na mewordpress.org'.
To connect to wordpress.org insecurely, use `--no-check-certificate'.

Please fix it

Update

Hi,

This shell is great,i have used for 2 years.but it's too old in 2017.

Could you update it,i mean update to new version ,like php version 7 ,and so on.

thank you!

Regards
hqin

Can't connect to MYSQL without password

I've setup a root password for MYSQL and now I cannot automatically create a user/db via this script. Any ideas short of removing the password?

./setup-debian.sh mysqluser mydomain.tld
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
MySQL Username: username
MySQL Password: password
MySQL Database: mydomainy.tld

install_curl line

Hello.. i recently tried your script.. work awesome thanks for all the hard work. However there was issue with line 911 :
function install_curl{
print_info "Checking curl"
check_install curl curl
If anyone have same issue, just add space after function install_curl
thanks

On Ubuntu newer release there's no package named `php5-apc` or `php5-suhosin`

Refer to this issue, PHP 5.5 has Zend OpCache built-in and APC Opcode Cache is not required. This lead to an configure error, which make PHP not work in the further installation.

E: Package 'php5-apc' has no installation candidate
E: Package 'php5-suhosin' has no installation candidate

mv: cannot stat '/etc/php5/conf.d/apc.ini': No such file or directory
./setup-debian.sh: line 292: /etc/php5/conf.d/apc.ini: No such file or directory
mv: cannot stat '/etc/php5/conf.d/suhosin.ini': No such file or directory
./setup-debian.sh: line 311: /etc/php5/conf.d/suhosin.ini: No such file or direc
tory

Please help update the bash script.
In addition, I'm running a Ubuntu 14.04 server.

MYSQL doesn't start... ERROR 2002 (HY000)

Hi,
I've had, I think, the same issue in the past when I have tried to use this script with Debian 7. Now I have it in a fresh Debian 6 KVM vps.
MYSQL doesn't start and cannot start.
When I attempt to start it manually I receive this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
purging mysql-server and mysql-client and reinstalling via the script gives the same problem.

Mysql fails to start

Output after running ./setup-debian.sh mysql on debian6 x64 :

invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
configured to not write apport reports
configured to not write apport reports
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Nothing in /var/log/mysql.err , mysql.log or /var/log/mysql/

support Debian7 64bit ?

hi,
does this script support Debian7-64bit ?

i tried ,but failed to build up the site.

Regards

Disallowing root logins

Greets:

I could have sworn one of the features of LEA's script was disallowing root logins. I recently gave this script a try and noticed that root logins are now allowed.

Maybe disallowing them would be a good idea?

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.