PufferPanel Master node setup - johnkeates/PufferPanel GitHub Wiki

Once your environment setup is complete, you can continue with the actual PufferPanel installation. If the environment is not complete yet, see Master node environment setup

###1. SSH Keys

Before we install the admin cp, we generate some SSH keys for the www-data users. This is required in order to talk to the nodes in a later stage.

####1.1. Permissions and directories

To create the keys and fix everything up, first set correct permissions so they can actually be made:

sudo mkdir /var/www/.ssh/
sudo chown www-data:www-data /var/www
sudo chmod 0775 /var/www
sudo chown www-data:www-data /var/www/.ssh
sudo chmod 0775 /var/www/.ssh

This way, the keys can be generated correctly, as they are stored in: /var/www/.ssh/ because that is the home directory for the www-data user which apache runs as.

####1.2. ssh-keygen

Generate the keys for the www-data user, execute:

  1. sudo su www-data to become www-data
  2. bash to get a nice bash shell
  3. cd to get to /var/www because that is your home directory
  4. ssh-keygen -t rsa to start the RSA key generation
  5. Press enter to accept the default path for both keys
  6. Press enter to not enter a password (we don't want one)
  7. Execute exit twice to get back to where you were

Your new keys are stored here:

  • /var/www/.ssh/id_rsa is your private key, keep it private!
  • /var/www/.ssh/id_rsa.pub is your public key, this is given to 'other' nodes

To aid with the ssh key safekeeping, create a configuration file:

sudo nano /etc/apache2/conf.d/ssh-deny

Insert this text:

<Directory /var/www/.ssh>
    Order Deny,Allow
    Deny from all
</Directory>

and save by pressing Control+X, Y, Enter.

You may need to restart apache in order to activate this: sudo invoke-rc.d apache2 restart. Check your configuration by directing your browser to http://master1.domain.tld/.ssh/id_rsa . If you can see your key, something went wrong. Please check all steps before you continue.

###2. PufferPanel installation

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/configuration.php.dist

At this point, PufferPanel is ready for setup. You will need a clean database and credentials to be able to complete the setup. To get those, log in to PHPMyAdmin with the credentials you set up during the environment setup, and create a new user with database. To do this and preset everything you need, follow these steps:

  1. Log in to PHPMyAdmin on http://master1.domain.tld/phpmyadmin (username is root, use the password you set)
  2. Click on Privileges
  3. Click on Add a new User
  4. Fill out the username box (use something like pp-production-db)
  5. Leave Host set to Any Host (or set up a hosts table, but you're on your own with that)
  6. Click Generate password and copy the password because you'll need it later on
  7. Select Create database with same name and grant all privileges
  8. Click Create User at the bottom of the dialog

At this point, you have the following information:

  • The hostname, this is the name of your master, like master.domain.tld
  • The username, this is the name you chose at step 4
  • The password, this is the value you got at step 6
  • The database name, this is exactly the same as username at step 4

You will need this to set up your admin cp installation. To set up your new installation, point your browser to the vhost you created (i.e. master1.domain.tld) with the url:

http://master1.domain.tld/admin/install

Follow the instructions on the screen, and don't forget to store the hashfile (the installer will tell you all about it) with the hash displayed in the installer screen to /etc/hashfile.txt and remember it's location. Afterwards, execute:

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

to reset the permissions to a somewhat safer state.

If you didn't read the messages on the installation screen: you need to delete the installation directory! To do so:

sudo rm -r /var/www-vhosts/master1.domain.tld/admin/install

Your master node is hereby complete.

Troubleshooting:


Q: I get a blank page!

A: Did you restart Apache2? If so, check the error logs for your vhost after making a request


Q: My page looks like it's from 1990!

A: Your CSS and other assets aren't loading, fix this in the database by changing the assets_url in acp_settings to http://youradminurl/assets/ and of course replace youradminurl with your subdomain like master1.domain.tld


Q: I can't login!

A: you probably messed up your cookie domain, set it to your domain name (NOT your FQDN, just the domain + tld). You can do this in the acp_settings table in the database. If using your domain name doesn't work, try setting it to NULL (meaning: leave it blank).


Q: The navigation is all messed up, when I click something in the admin, the url tries to find admin within admin!

A: Your master_url is incorrect, fix this in the database by changing the master_url in acp_settings to your FQDN


Q: My modpack uploads keep failing!

A: Check your php.ini file, you might want to set the post and upload variables to something bigger than 2MB. For example, use upload_max_filesize = 64M and post_max_size = 64M


⚠️ **GitHub.com Fallback** ⚠️