Giter VIP home page Giter VIP logo

vps_setup's Introduction

#VPS Configuration Script

Due to the nature of my work, I do need to bring up VPSs quite often. Since multiple providers are used to house these VMs, the need for a "generic" script to setup a VPS came-up.

Each VPS should have a complete development environment and a bare-bone deployment environment. Therefore, you will find most of the common programming languages/frameworks and basic tools installed with the exception of Java (details are in a separate section). This includes:

  • Text editors (vi, emacs, nano)
  • Version Control Systems (git, subversion, mercurial)
  • gcc/g++
  • Python 2.x & PIP
  • Perl
  • PHP and Pear
  • Ruby and Gems
  • Webserver (nginx)

My operating system of choice is Debian 7.0 Wheezy 64-bit

VPS Customization

This script is customizable in terms of specifying VM-specific attributes such as hostname, ssh port, etc. Customization of the vps is based on variables set in a file named vps_setup-env.conf.

VPS Setup Scripts

###Basic Setup The main setup is performed by vps_setup.sh which is written in bash.

The following actions are performed by the script:

  • Set repositories. The following additional repositories are added
    • Debian Backports
    • Nginx Repository
    • Testing Repository - disabled through apt pinning
  • Install packages in packages.list
  • Add $SUPER_USER as member of sudo, adm and www-data groups.
  • Set Timezone
  • Set Locale (default is en_US.UTF-8)
  • Set iSpell wordlist (default is American English)
  • Hostname
  • DNS (inserting Google Public DNS 8.8.8.8, 8.8.4.4)
    • It is advised to run namebench to find the best DNS servers for your server
  • SSH Setup
    • Change port to non-standard port number
    • Explicitly add inet interface to Listen directive
    • Disable root login
    • Disable password login
    • Disable X11 forwarding
    • Disable PAM & DNS
    • Only allow $SUPER_USER to access machine via ssh
  • iptables firewall setup. You can see the iptables rules in the scripts directory
  • Unattended security upgrades
  • IPv6 is enabled - if an IPv6 address is given - in the following configurations
    • Network Interfaces
    • Hosts
    • DNS
    • Firewall (ip6tables)
    • SSH

###Nginx TBD

###What is not Setup?

  • Java - Due to the amount of extra packages required by the JDK and JRE, Java setup is commented out of the script

Testing Repositories

Due to the need to install some packages from testing, the testing package repos are added to the apt source list. However, no testing packages are installed unless explicitly requested:

aptitude -t testing install enlightenment

This is acheived by updating the apt preferences or pinning.

##Running The Script

# You may want to consider changing the root password
passwd

# Setup configuration script
cp vps_setup-env.conf.default vps_setup-env.conf

# Edit configuration file to your liking
vi vps_setup-env.conf

# Run the main script
chmod 755 vps_setup.sh
./vps_setup.sh

##Common Applications to Add

There are number of very common applications that you may need add to your VPS and were not included above. Mostly, these have not been included for performance or storage reasons.

Java

TBD

MySQL

TBD

License

See the LICENSE file.

vps_setup's People

Contributors

alghanmi avatar

Watchers

 avatar  avatar

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.