mirror of
https://github.com/pterodactyl/documentation.git
synced 2025-12-11 14:00:27 -06:00
Push getting started documentation
This commit is contained in:
parent
65e469f138
commit
2a3f6e4e85
10
.snippets/webservers/apache.conf
Normal file
10
.snippets/webservers/apache.conf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName <domain>
|
||||||
|
DocumentRoot "/var/www/pterodactyl/public"
|
||||||
|
AllowEncodedSlashes On
|
||||||
|
php_value upload_max_filesize 100M
|
||||||
|
php_value post_max_size 100M
|
||||||
|
<Directory "/var/www/pterodactyl/public">
|
||||||
|
AllowOverride all
|
||||||
|
</Directory>
|
||||||
|
</VirtualHost>
|
||||||
44
.snippets/webservers/nginx-nossl.conf
Normal file
44
.snippets/webservers/nginx-nossl.conf
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name <domain>;
|
||||||
|
|
||||||
|
root /var/www/pterodactyl/public;
|
||||||
|
index index.html index.htm index.php;
|
||||||
|
charset utf-8;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /favicon.ico { access_log off; log_not_found off; }
|
||||||
|
location = /robots.txt { access_log off; log_not_found off; }
|
||||||
|
|
||||||
|
access_log off;
|
||||||
|
error_log /var/log/nginx/pterodactyl.app-error.log error;
|
||||||
|
|
||||||
|
# allow larger file uploads and longer script runtimes
|
||||||
|
client_max_body_size 100m;
|
||||||
|
client_body_timeout 120s;
|
||||||
|
|
||||||
|
sendfile off;
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param HTTP_PROXY "";
|
||||||
|
fastcgi_intercept_errors off;
|
||||||
|
fastcgi_buffer_size 16k;
|
||||||
|
fastcgi_buffers 4 16k;
|
||||||
|
fastcgi_connect_timeout 300;
|
||||||
|
fastcgi_send_timeout 300;
|
||||||
|
fastcgi_read_timeout 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
66
.snippets/webservers/nginx.conf
Normal file
66
.snippets/webservers/nginx.conf
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
server_tokens off;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name <domain>;
|
||||||
|
return 301 https://$server_name$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
server_name <domain>;
|
||||||
|
|
||||||
|
root /var/www/pterodactyl/public;
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/pterodactyl.app-access.log;
|
||||||
|
error_log /var/log/nginx/pterodactyl.app-error.log error;
|
||||||
|
|
||||||
|
# allow larger file uploads and longer script runtimes
|
||||||
|
client_max_body_size 100m;
|
||||||
|
client_body_timeout 120s;
|
||||||
|
|
||||||
|
sendfile off;
|
||||||
|
|
||||||
|
# SSL Configuration
|
||||||
|
ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
|
||||||
|
ssl_session_cache shared:SSL:10m;
|
||||||
|
ssl_protocols TLSv1.2;
|
||||||
|
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
|
||||||
|
ssl_prefer_server_ciphers on;
|
||||||
|
|
||||||
|
# See https://hstspreload.org/ before uncommenting the line below.
|
||||||
|
# add_header Strict-Transport-Security "max-age=15768000; preload;";
|
||||||
|
add_header X-Content-Type-Options nosniff;
|
||||||
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
|
add_header X-Robots-Tag none;
|
||||||
|
add_header Content-Security-Policy "frame-ancestors 'self'";
|
||||||
|
add_header X-Frame-Options DENY;
|
||||||
|
add_header Referrer-Policy same-origin;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param HTTP_PROXY "";
|
||||||
|
fastcgi_intercept_errors off;
|
||||||
|
fastcgi_buffer_size 16k;
|
||||||
|
fastcgi_buffers 4 16k;
|
||||||
|
fastcgi_connect_timeout 300;
|
||||||
|
fastcgi_send_timeout 300;
|
||||||
|
fastcgi_read_timeout 300;
|
||||||
|
include /etc/nginx/fastcgi_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -42,7 +42,7 @@ module.exports = {
|
|||||||
collapsable: false,
|
collapsable: false,
|
||||||
children: [
|
children: [
|
||||||
'/panel/getting_started',
|
'/panel/getting_started',
|
||||||
'/panel/downloading',
|
'/panel/webserver_configuration',
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
# Download
|
|
||||||
@ -1,4 +1,7 @@
|
|||||||
# Getting Started
|
# Getting Started
|
||||||
|
|
||||||
|
[[toc]]
|
||||||
|
|
||||||
Pterodactyl Panel is designed to run on your own web server. You will need to have root access to your server in order to run and use this panel.
|
Pterodactyl Panel is designed to run on your own web server. You will need to have root access to your server in order to run and use this panel.
|
||||||
|
|
||||||
You are expected to understand how to read documentation to use this Panel. We have spent many hours detailing how to install or upgrade our
|
You are expected to understand how to read documentation to use this Panel. We have spent many hours detailing how to install or upgrade our
|
||||||
@ -12,13 +15,13 @@ Pterodactyl runs on a wide range of operating systems, so pick whichever you are
|
|||||||
|
|
||||||
::: warning
|
::: warning
|
||||||
Pterodactyl does not support most OpenVZ systems due to incompatabilities with Docker. If you are planning on running
|
Pterodactyl does not support most OpenVZ systems due to incompatabilities with Docker. If you are planning on running
|
||||||
this software on an OpenVZ based system you will not be successful.
|
this software on an OpenVZ based system you will — most likely — not be successful.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
| Operating System | Version | Supported | Notes |
|
| Operating System | Version | Supported | Notes |
|
||||||
| ---------------- | ------- | :-------: | ----- |
|
| ---------------- | ------- | :-------: | ----- |
|
||||||
| **Ubuntu** | 14.04 | :warning: | Documentation assumes changes to `systemd` introduced in `16.04` |
|
| **Ubuntu** | 14.04 | :warning: | Documentation assumes changes to `systemd` introduced in `16.04` |
|
||||||
| | 16.04 | :white_check_mark: | Recommended. |
|
| | 16.04 | :white_check_mark: | Documentation written assuming Ubuntu 16 as the base OS. |
|
||||||
| | 18.04 | :white_check_mark: | |
|
| | 18.04 | :white_check_mark: | |
|
||||||
| **CentOS** | 6 | :no_entry_sign: | Does not support all of the required packages. |
|
| **CentOS** | 6 | :no_entry_sign: | Does not support all of the required packages. |
|
||||||
| | 7 | :white_check_mark: | |
|
| | 7 | :white_check_mark: | |
|
||||||
@ -34,12 +37,21 @@ this software on an OpenVZ based system you will not be successful.
|
|||||||
* `tar`
|
* `tar`
|
||||||
* `unzip`
|
* `unzip`
|
||||||
* `git`
|
* `git`
|
||||||
|
* `composer`
|
||||||
|
|
||||||
|
### Installing Composer
|
||||||
|
Composer is a dependency manager for PHP that allows us to ship everything you'll need code wise to operate the Panel. You'll
|
||||||
|
need composer installed before continuing in this process.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
```
|
||||||
|
|
||||||
### Example Dependency Installation
|
### Example Dependency Installation
|
||||||
The commands below are simply an example of how you might install these dependencies. Please consult with your
|
The commands below are simply an example of how you might install these dependencies. Please consult with your
|
||||||
operating system's package manager to determine the correct packages to install.
|
operating system's package manager to determine the correct packages to install.
|
||||||
|
|
||||||
```sh
|
``` bash
|
||||||
# Add "add-apt-repository" command
|
# Add "add-apt-repository" command
|
||||||
apt -y install software-properties-common
|
apt -y install software-properties-common
|
||||||
|
|
||||||
@ -59,7 +71,7 @@ apt -y install php7.2 php7.2-cli php7.2-gd php7.2-mysql php7.2-pdo php7.2-mbstri
|
|||||||
The first step in this process is to create the folder where the panel will live and then move ourselves into that
|
The first step in this process is to create the folder where the panel will live and then move ourselves into that
|
||||||
newly created folder. Below is an example of how to perform this operation.
|
newly created folder. Below is an example of how to perform this operation.
|
||||||
|
|
||||||
``` sh
|
``` bash
|
||||||
mkdir -p /var/www/pterodactyl
|
mkdir -p /var/www/pterodactyl
|
||||||
cd /var/www/pterodactyl
|
cd /var/www/pterodactyl
|
||||||
```
|
```
|
||||||
@ -69,8 +81,129 @@ is as simple as using `curl` to download our pre-packaged content. Once it is do
|
|||||||
and then set the correct permissions on the `storage/` and `bootstrap/cache/` directories. These directories
|
and then set the correct permissions on the `storage/` and `bootstrap/cache/` directories. These directories
|
||||||
allow us to store files as well as keep a speedy cache available to reduce load times.
|
allow us to store files as well as keep a speedy cache available to reduce load times.
|
||||||
|
|
||||||
```
|
``` bash
|
||||||
curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/download/v0.7.6/panel.tar.gz
|
curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/download/v0.7.6/panel.tar.gz
|
||||||
tar --strip-components=1 -xzvf panel.tar.gz
|
tar --strip-components=1 -xzvf panel.tar.gz
|
||||||
chmod -R 755 storage/* bootstrap/cache/
|
chmod -R 755 storage/* bootstrap/cache/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
Now that all of the files have been downloaded we need to configure some core aspects of the Panel.
|
||||||
|
|
||||||
|
::: tip Database Configuration
|
||||||
|
You will need a database setup and a user with the correct permissions created for that database before
|
||||||
|
continuing any further. If you are unsure how to do this, please consult our documentation.
|
||||||
|
:::
|
||||||
|
|
||||||
|
First we will copy over our default environment settings file, install core dependencies, and then generate a
|
||||||
|
new application encryption key. **You should make a backup of the encryption key and store it in a secure
|
||||||
|
location, _not on the server itself_.**
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
cp .env.example .env
|
||||||
|
composer install --no-dev --optimize-autoloader
|
||||||
|
|
||||||
|
# Only run the command below if you are installing this Panel for
|
||||||
|
# the first time and do not have any Pterodactyl Panel data in the database.
|
||||||
|
php artisan key:generate --force
|
||||||
|
```
|
||||||
|
|
||||||
|
### Environment Configuration
|
||||||
|
Pterodactyl's core environment is easily configured using a few different CLI commands built into the app. This step
|
||||||
|
will cover setting up things such as sessions, caching, database credentials, and email sending.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
php artisan p:environment:setup
|
||||||
|
php artisan p:environment:database
|
||||||
|
|
||||||
|
# To use PHP's internal mail sending (not recommended), select "mail". To use a
|
||||||
|
# custom SMTP server, select "smtp".
|
||||||
|
php artisan p:environment:mail
|
||||||
|
```
|
||||||
|
|
||||||
|
### Database Setup
|
||||||
|
Now we need to setup all of the base data for the Panel in the database you created earlier. **The command below
|
||||||
|
may take some time to run depending on your machine. Please _DO NOT_ exit the process until it is completed!** This
|
||||||
|
command will setup the database tables and then add all of the Nests & Eggs that power Pterodactyl.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
php artisan migrate --seed
|
||||||
|
```
|
||||||
|
|
||||||
|
You'll then need to create an administrative user so that you can log into the panel. To do so, run the command below.
|
||||||
|
At this time passwords **must** meet the following requirements: 8 characters, mixed case, at least one number.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
php artisan p:user:make
|
||||||
|
```
|
||||||
|
|
||||||
|
### Set Permissions
|
||||||
|
The last step in the installation process is to set the correct permissions on the Panel files so that the webserver can
|
||||||
|
use them correctly.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# If using NGINX or Apache (not on CentOS):
|
||||||
|
chown -R www-data:www-data *
|
||||||
|
|
||||||
|
# If using NGINX on CentOS:
|
||||||
|
chown -R nginx:nginx *
|
||||||
|
|
||||||
|
# If using Apache on CentOS
|
||||||
|
chown -R apache:apache *
|
||||||
|
```
|
||||||
|
|
||||||
|
## Queue Listeners
|
||||||
|
We make use of queues to make the application faster and handle sending emails and other actions in the background.
|
||||||
|
You will need to setup the queue worker for these actions to be processed.
|
||||||
|
|
||||||
|
### Crontab Configuration
|
||||||
|
The first thing we need to do is create a new cronjob that runs every minute to process specific Pterodactyl tasks, such
|
||||||
|
as session cleanup and sending scheduled tasks to daemons. You'll want to open your crontab using `sudo crontab -e` and
|
||||||
|
then paste the line below.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
* * * * * php /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1
|
||||||
|
```
|
||||||
|
|
||||||
|
### Create Queue Worker
|
||||||
|
Next you need to create a new systemd worker to keep our queue process running in the background. This queue is responsible
|
||||||
|
for sending emails and handling many other background tasks for Pterodactyl.
|
||||||
|
|
||||||
|
::: warning
|
||||||
|
If you are using Ubuntu 14.04 you cannot use this method to run your queue worker. Please see these instructions for
|
||||||
|
installing Supervisor and setting up your queue. Ensure you use the same ExecStart line as below.
|
||||||
|
:::
|
||||||
|
|
||||||
|
``` text
|
||||||
|
# Pterodactyl Queue Worker File
|
||||||
|
# ----------------------------------
|
||||||
|
# File should be placed in:
|
||||||
|
# /etc/systemd/system
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Pterodactyl Queue Worker
|
||||||
|
After=redis-server.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
# On some systems the user and group might be different.
|
||||||
|
# Some systems use `apache` as the user and group.
|
||||||
|
User=www-data
|
||||||
|
Group=www-data
|
||||||
|
Restart=always
|
||||||
|
ExecStart=/usr/bin/php /var/www/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
::: tip
|
||||||
|
If you are not using `redis` for anything you should remove the `After=` line, otherwise you will encounter errors
|
||||||
|
when the service starts.
|
||||||
|
:::
|
||||||
|
|
||||||
|
Finally, enable the service and set it to boot on machine start.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
sudo systemctl enable pteroq.service
|
||||||
|
sudo systemctl start pteroq
|
||||||
|
```
|
||||||
|
|||||||
52
panel/webserver_configuration.md
Normal file
52
panel/webserver_configuration.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# Webserver Configuration
|
||||||
|
|
||||||
|
[[toc]]
|
||||||
|
|
||||||
|
::: danger
|
||||||
|
You should remove the default Apache or NGINX configuration as it will expose application secrets to malicious
|
||||||
|
users by default.
|
||||||
|
:::
|
||||||
|
|
||||||
|
## NGINX
|
||||||
|
You should paste the contents of the file below, replacing `<domain>` with your domain name being used in a file called
|
||||||
|
`pterodactyl.conf` and place it in `/etc/nginx/sites-available/`, or — if on CentOS, `/etc/nginx/conf.d/`.
|
||||||
|
|
||||||
|
### NGINX With SSL
|
||||||
|
This configuration assumes that you will be using SSL on both the Panel and Daemons for significantly improved communication
|
||||||
|
security between users and the Panel. You will need to get a valid SSL certificate which can be done for free by using
|
||||||
|
Let's Encrypt. Please see our Creating SSL Certificates documentation for how to create these certificates before continuing.
|
||||||
|
|
||||||
|
<<< @/.snippets/webservers/nginx.conf{5,11,26-27}
|
||||||
|
|
||||||
|
Continue reading to the bottom of this section for the final steps with NGINX!
|
||||||
|
|
||||||
|
### NGINX Without SSL
|
||||||
|
|
||||||
|
<<< @/.snippets/webservers/nginx-nossl.conf{3}
|
||||||
|
|
||||||
|
### Enabling Configuration
|
||||||
|
The final step is to enable your NGINX configuration and restart it.
|
||||||
|
``` bash
|
||||||
|
# You do not need to symlink this file if you are using CentOS.
|
||||||
|
sudo ln -s /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/pterodactyl.conf
|
||||||
|
|
||||||
|
# You need to restart nginx regardless of OS.
|
||||||
|
systemctl restart nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
## Apache
|
||||||
|
You should paste the contents of the file below, replacing `<domain>` with your domain name being used in a file called
|
||||||
|
`pterodactyl.conf` and place it in `/etc/apache2/sites-available`, or — if on CentOS, `/etc/httpd/conf.d/`.
|
||||||
|
|
||||||
|
<<< @/.snippets/webservers/apache.conf{2}
|
||||||
|
|
||||||
|
### Enabling Configuration
|
||||||
|
Once you've created the file above, simply run the commands below. If you are on CentOS _you do not need to run the commands
|
||||||
|
below!_ You only need to run `systemctl httpd restart`.
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# You do not need to run any of these commands on CentOS
|
||||||
|
sudo ln -s /etc/apache2/sites-available/pterodactyl.conf /etc/apache2/sites-enabled/pterodactyl.conf
|
||||||
|
sudo a2enmod rewrite
|
||||||
|
systemctl restart apache2
|
||||||
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user