documentation/assets/js/38.b955d4bc.js
2022-07-02 14:21:11 +00:00

1 line
15 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{381:function(t,a,s){"use strict";s.r(a);var e=s(48),r=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"debian-9"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#debian-9"}},[t._v("#")]),t._v(" Debian 9")]),t._v(" "),s("p",[t._v("In this guide we will install Pterodactyl v1.x — including all of it's dependencies — and configure our webserver to serve it using SSL.")]),t._v(" "),s("p"),s("div",{staticClass:"table-of-contents"},[s("ul",[s("li",[s("a",{attrs:{href:"#install-requirements"}},[t._v("Install Requirements")]),s("ul",[s("li",[s("a",{attrs:{href:"#mariadb"}},[t._v("MariaDB")])]),s("li",[s("a",{attrs:{href:"#php-7-4"}},[t._v("PHP 7.4")])]),s("li",[s("a",{attrs:{href:"#nginx"}},[t._v("Nginx")])]),s("li",[s("a",{attrs:{href:"#redis"}},[t._v("Redis")])]),s("li",[s("a",{attrs:{href:"#additional-utilities"}},[t._v("Additional Utilities")])])])]),s("li",[s("a",{attrs:{href:"#server-configuration"}},[t._v("Server Configuration")]),s("ul",[s("li",[s("a",{attrs:{href:"#configuring-mariadb"}},[t._v("Configuring MariaDB")])]),s("li",[s("a",{attrs:{href:"#setup-php"}},[t._v("Setup PHP")])]),s("li",[s("a",{attrs:{href:"#nginx"}},[t._v("Nginx")])]),s("li",[s("a",{attrs:{href:"#redis-setup"}},[t._v("Redis Setup")])])])]),s("li",[s("a",{attrs:{href:"#installing-the-panel"}},[t._v("Installing the Panel")])])])]),s("p"),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),s("p",[t._v("This guide is based off the "),s("RouterLink",{attrs:{to:"/panel/1.0/getting_started.html"}},[t._v("official installation documentation")]),t._v(" but is tailored specifically for Debian 9.")],1)]),t._v(" "),s("h2",{attrs:{id:"install-requirements"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#install-requirements"}},[t._v("#")]),t._v(" Install Requirements")]),t._v(" "),s("p",[t._v("We will first begin by installing all of Pterodactyl's "),s("RouterLink",{attrs:{to:"/panel/1.0/getting_started.html#dependencies"}},[t._v("required")]),t._v(" dependencies.")],1),t._v(" "),s("h3",{attrs:{id:"mariadb"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mariadb"}},[t._v("#")]),t._v(" MariaDB")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("## Install the MariaDB repo for debian")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" -y software-properties-common dirmngr\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("bash")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("## Get apt updates")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" update\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("## Install MariaDB")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" -y mariadb-common mariadb-server mariadb-client\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("## Start maraidb")]),t._v("\nsystemctl start mariadb\nsystemctl "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("enable")]),t._v(" mariadb\n")])])]),s("h3",{attrs:{id:"php-7-4"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#php-7-4"}},[t._v("#")]),t._v(" PHP 7.4")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("## Install the PHP 7.4 repo for debian")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" -y ca-certificates apt-transport-https\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wget")]),t._v(" -q https://packages.sury.org/php/apt.gpg -O- "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" apt-key "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" -\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("echo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"deb https://packages.sury.org/php/ stretch main"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("tee")]),t._v(" /etc/apt/sources.list.d/php.list\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("## Get apt updates")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" update\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("## Install PHP 7.4")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" -y php7.4 php7.4-"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("cli,gd,mysql,pdo,mbstring,tokenizer,bcmath,xml,fpm,curl,zip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"nginx"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nginx"}},[t._v("#")]),t._v(" Nginx")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" -y nginx\n")])])]),s("h3",{attrs:{id:"redis"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#redis"}},[t._v("#")]),t._v(" Redis")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" -y redis-server\n\nsystemctl start redis-server\nsystemctl "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("enable")]),t._v(" redis-server\n")])])]),s("h3",{attrs:{id:"additional-utilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#additional-utilities"}},[t._v("#")]),t._v(" Additional Utilities")]),t._v(" "),s("h4",{attrs:{id:"certbot"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#certbot"}},[t._v("#")]),t._v(" Certbot")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" -y certbot "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v("\n")])])]),s("h4",{attrs:{id:"composer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#composer"}},[t._v("#")]),t._v(" Composer")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -sS https://getcomposer.org/installer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" php -- --install-dir"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("/usr/local/bin --filename"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("composer\n")])])]),s("h2",{attrs:{id:"server-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#server-configuration"}},[t._v("#")]),t._v(" Server Configuration")]),t._v(" "),s("p",[t._v("This following section covers the configuration of parts of the server to run the panel.")]),t._v(" "),s("h3",{attrs:{id:"configuring-mariadb"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#configuring-mariadb"}},[t._v("#")]),t._v(" Configuring MariaDB")]),t._v(" "),s("p",[t._v("The fastest way to set up mariadb is to use the "),s("code",[t._v("mysql_secure_installation")]),t._v(" command and follow prompts")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("mysql_secure_installation\n")])])]),s("p",[t._v("The following are safe defaults.")]),t._v(" "),s("p",[t._v("Change to your own secure password"),s("br"),t._v(" "),s("code",[t._v("Set root password? [Y/n] Y")])]),t._v(" "),s("p",[t._v("Get rid of users that could access the db by default"),s("br"),t._v(" "),s("code",[t._v("Remove anonymous users? [Y/n] Y")])]),t._v(" "),s("p",[t._v("Keep root off the external interfaces"),s("br"),t._v(" "),s("code",[t._v("Disallow root login remotely? [Y/n] Y")])]),t._v(" "),s("p",[t._v("Extra databases that aren't needed"),s("br"),t._v(" "),s("code",[t._v("Remove test database and access to it? [Y/n] Y")])]),t._v(" "),s("p",[t._v("Clears and sets all the changes made"),s("br"),t._v(" "),s("code",[t._v("Reload privilege tables now? [Y/n] Y")])]),t._v(" "),s("p",[t._v("All done! If you've completed all of the above steps, your MariaDB installation should now be secure.")]),t._v(" "),s("h4",{attrs:{id:"adding-mariadb-user"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#adding-mariadb-user"}},[t._v("#")]),t._v(" Adding MariaDB user")]),t._v(" "),s("p",[t._v("To add your first user to the database, see our tutorial on "),s("RouterLink",{attrs:{to:"/tutorials/mysql_setup.html"}},[t._v("setting up MySQL")]),t._v(".")],1),t._v(" "),s("h3",{attrs:{id:"setup-php"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setup-php"}},[t._v("#")]),t._v(" Setup PHP")]),t._v(" "),s("p",[t._v("The default php-fpm configuration is fine to use and can be started and then enabled on the system using the\ncommands below.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("systemctl "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("enable")]),t._v(" php7.4-fpm\nsystemctl start php7.4-fpm\n")])])]),s("h3",{attrs:{id:"nginx-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nginx-2"}},[t._v("#")]),t._v(" Nginx")]),t._v(" "),s("p",[t._v("Please check our "),s("RouterLink",{attrs:{to:"/tutorials/creating_ssl_certificates.html"}},[t._v("tutorial")]),t._v(" on generating SSL certificates for more information.")],1),t._v(" "),s("h4",{attrs:{id:"ssl-configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ssl-configuration"}},[t._v("#")]),t._v(" SSL Configuration")]),t._v(" "),s("div",{staticClass:"language-conf extra-class"},[s("div",{staticClass:"highlight-lines"},[s("br"),s("br"),s("br"),s("br"),s("div",{staticClass:"highlighted"},[t._v(" ")]),s("br"),s("br"),s("br"),s("br"),s("br"),s("div",{staticClass:"highlighted"},[t._v(" ")]),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("div",{staticClass:"highlighted"},[t._v(" ")]),s("div",{staticClass:"highlighted"},[t._v(" ")]),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br"),s("br")]),s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('server_tokens off;\n\nserver {\n listen 80;\n server_name <domain>;\n return 301 https://$server_name$request_uri;\n}\n\nserver {\n listen 443 ssl http2;\n server_name <domain>;\n\n root /var/www/pterodactyl/public;\n index index.php;\n\n access_log /var/log/nginx/pterodactyl.app-access.log;\n error_log /var/log/nginx/pterodactyl.app-error.log error;\n\n # allow larger file uploads and longer script runtimes\n client_max_body_size 100m;\n client_body_timeout 120s;\n\n sendfile off;\n\n # SSL Configuration\n ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;\n ssl_session_cache shared:SSL:10m;\n ssl_protocols TLSv1.2 TLSv1.3;\n ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";\n ssl_prefer_server_ciphers on;\n\n # See https://hstspreload.org/ before uncommenting the line below.\n # add_header Strict-Transport-Security "max-age=15768000; preload;";\n add_header X-Content-Type-Options nosniff;\n add_header X-XSS-Protection "1; mode=block";\n add_header X-Robots-Tag none;\n add_header Content-Security-Policy "frame-ancestors \'self\'";\n add_header X-Frame-Options DENY;\n add_header Referrer-Policy same-origin;\n\n location / {\n try_files $uri $uri/ /index.php?$query_string;\n }\n\n location ~ \\.php$ {\n fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n fastcgi_pass unix:/run/php/php7.4-fpm.sock;\n fastcgi_index index.php;\n include fastcgi_params;\n fastcgi_param PHP_VALUE "upload_max_filesize = 100M \\n post_max_size=100M";\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n fastcgi_param HTTP_PROXY "";\n fastcgi_intercept_errors off;\n fastcgi_buffer_size 16k;\n fastcgi_buffers 4 16k;\n fastcgi_connect_timeout 300;\n fastcgi_send_timeout 300;\n fastcgi_read_timeout 300;\n include /etc/nginx/fastcgi_params;\n }\n\n location ~ /\\.ht {\n deny all;\n }\n}\n')])])]),s("h3",{attrs:{id:"redis-setup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#redis-setup"}},[t._v("#")]),t._v(" Redis Setup")]),t._v(" "),s("p",[t._v("The default Redis install is perfectly fine for the panel. If you have Redis already in use you may want to look into\n"),s("a",{attrs:{href:"https://community.pivotal.io/s/article/How-to-setup-and-run-multiple-Redis-server-instances-on-a-Linux-host",target:"_blank",rel:"noopener noreferrer"}},[t._v("running another Redis instance"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"installing-the-panel"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installing-the-panel"}},[t._v("#")]),t._v(" Installing the Panel")]),t._v(" "),s("p",[t._v("Excellent, we now have all of the required dependencies installed and configured. From here, follow the "),s("RouterLink",{attrs:{to:"/panel/1.0/getting_started.html#download-files"}},[t._v("official Panel installation documentation")]),t._v(".")],1)])}),[],!1,null,null,null);a.default=r.exports}}]);