Skip to content

Instantly share code, notes, and snippets.

@johnkeates
Created March 8, 2014 00:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnkeates/9423232 to your computer and use it in GitHub Desktop.
Save johnkeates/9423232 to your computer and use it in GitHub Desktop.

Setting up PufferPanel installation on Debian Wheezy (Debian Stable 2013-2014) 7.4

What you basically need to do:

A. Setup at least 1 master node B. Setup at least 1 client node

This requires vhosts and certain tools and dependencies. Each node setup list allows you to perform all tasks for setting this up for the node type. First, you'll set up the node environments and the master, next you set up the node communication, storage locations and client nodes.

Before you begin, make sure of the following:

  • You are using Debian or a comparable DEB based Linux distribution
  • You have root access and/or sudo access
  • You have contrib and non-free repos on in your APT settings
  • You are not killing existing services on the system

Master Node setup

On your admin server, where you will be using the admin cp:

  1. Install all dependencies:

    sudo apt-get install git libapache2-mod-php5 mysql-server phpmyadmin php5-mcrypt php5-cli php5-dev php-pear libssh2-1 libssh2-php libssh2-1-dev denyhosts

This installs everything you need to run most PHP 5.4.x webapps, with MySQL, Postfix for email support and phpmyadmin for database administration. Additionally, it sets you up with some developer tools (for example: to install php5-ssh2 from pecl if the version from the repos is too old). It also installs DenyHosts which uses TCPWrappers's /etc/hosts.deny to blacklist brute forcing hostst on the fly so SSH break-ins are a a lot harder.

  1. Setup a vhost:

    I use a vhost-specific location: /var/www-vhosts/, so to make a vhosts for your master node:

    sudo mkdir -p /var/www-vhosts/master1.domain.tld

    (Replace master1.domain.tld with your actual FQDN, and do so in any examples from here!)

    Create directories for the log files:

    sudo mkdir /var/log/apache2/master1.domain.tld

    Create a vhost configuration file and set the basic settings:

    sudo nano /etc/apache2/sites-available/master1.domain.tld

    This opens nano with the vhost config file in the proper location. Enter the following configuration to get started:

    <VirtualHost *:80> DocumentRoot /var/www-vhosts/master1.domain.tld ServerName master1.domain.tld ServerAlias www.master1.domain.tld

     <Directory "/var/www-vhosts/master1.domain.tld">
     	allow from all
     	Options -Indexes
     </Directory>
    
     ErrorLog /var/log/apache2/master1.domain.tld/error.log
     LogLevel notice
     TransferLog /var/log/apache2/master1.domain.tld/access.log
     UseCanonicalName on
    

    Save and exit with: Ctrl-X and press Y to accept the save and enter to close nano. Execute: sudo a2ensite master1.domain.tld to activate the vhost.

    To automatically rotate the server logs, create a logrotate file:

    sudo nano /etc/logrotate.d/apache2-master1.domain.tld

    and use these settings for a default log rotation scheme:

    /var/log/apache2/master1.domain.tld/*.log { weekly missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript }

    Again, Ctrl+X to save, Y to confirm, enter to close.

    Set the correct permissions on everything to make your environment reasonably secure:

    sudo chgrp -R www-data /var/www-vhosts/master1.domain.tld sudo chgrp -R www-data /var/log/apache2/master1.domain.tld sudo chmod -R 775 /var/www-vhosts/master1.domain.tld sudo chmod -R 775 /var/log/apache2/master1.domain.tld

    At this point you have the following:

    • A vhost capable of running a PufferPanel Master Node with all dependencies
    • Automatic log rotation
    • Tools for later upgrades
    • Tools for setting up databases and database credentials
    • Mail capabilities using a robust MTA
    • Reasonably secured vhost environment

    Next, we clone the PufferPanel repository to get the needed files for our master (we're going with bleeding-edge here, select a version with checkout if you want a specific release):

    cd ~ #(In case you aren't in your home directory) git clone https://github.com/DaneEveritt/PufferPanel.git cd PufferPanel sudo cp -R master /var/www-vhosts/master1.domain.tld/ sudo chown -R www-data:www-data /var/www-vhosts/master1.domain.tld/ sudo chmod -R 0775 /var/www-vhosts/master1.domain.tld/ sudo chmod 0777 /var/www-vhosts/master1.domain.tld/admin/install sudo chmod 0777 /var/www-vhosts/master1.domain.tld/admin/install/do sudo chmod 0777 /var/www-vhosts/master1.domain.tld/core/framework sudo chmod 0666 /var/www-vhosts/master1.domain.tld/core/framework/master_configuration.php.dist

    At this point, PufferPanel is ready for setup. To set up your new installation, point your browser to the vhost you created (i.e. master1.domain.tld). Follow the instructions on the screen, and afterwards, execute:

    sudo chmod 0755 /var/www-vhosts/master1.domain.tld/core/framework sudo chmod 0444 /var/www-vhosts/master1.domain.tld/core/framework/master_configuration.php.dist

    to reset the permissions to a somewhat more safer state.

    Your master node is hereby complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment