### Install Composer Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Installs Composer, a dependency manager for PHP, by downloading the installer, verifying its integrity, and moving it to the system's PATH. ```bash php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" sudo mv composer.phar /usr/local/bin/composer ``` -------------------------------- ### Install InfluxDB on Debian Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Installs InfluxDB by adding the official repository and then installing the package. Enables and starts the InfluxDB service. ```bash wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - echo "deb https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list sudo apt update sudo apt install -y influxdb sudo systemctl enable --now influxdb ``` -------------------------------- ### Install Node.js, Npm, and Yarn Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Installs Node.js from NodeSource, and Yarn package manager from its official Debian repository. Also installs the gulp globally. ```bash curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - sudo apt-get install -y nodejs curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn sudo npm install -g gulp ``` -------------------------------- ### Install MongoDB Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Install MongoDB 4.2 from the official repository. This includes adding the GPG key, configuring the repository, and installing the mongodb-org package. ```bash curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - ``` ```bash sudo add-apt-repository 'deb https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main' ``` ```bash sudo apt update ``` ```bash sudo apt install mongodb-org -y ``` ```bash sudo systemctl enable mongod --now ``` -------------------------------- ### Install Sudo and Create Admin User Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Install the sudo package, create a new user named 'admin', add them to the sudo group, and configure their SSH authorized keys. ```bash apt install sudo adduser admin usermod -aG sudo admin sudo -u admin vi /home/admin/.ssh/authorized_keys #add your key ``` -------------------------------- ### Install Certbot using Snap Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Installs Certbot, a tool for automatically issuing and renewing SSL/TLS certificates, using the snap package manager. ```bash sudo apt install snapd -y sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot sudo snap set certbot trust-plugin-with-root=ok ``` -------------------------------- ### Install GogoCarto Dependencies Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Update package lists and install essential packages for GogoCarto. This includes development tools, libraries, and web server components. ```bash sudo apt-get update && sudo apt-get install -y --no-install-recommends \ bzip2 \ cron \ htop \ g++ \ gettext \ git \ gnupg \ imagemagick \ libfreetype6 \ libgd3 \ libmcrypt4 \ libmemcached11 \ libmemcachedutil2 \ libsodium23 \ libtidy5deb1 \ libxml2 \ libxslt1.1 \ libzip4 \ nano \ openssl \ unzip \ wget \ lftp \ libbz2-dev \ libc-client-dev \ libcurl4-openssl-dev \ libfreetype6-dev \ libgd-dev \ libicu-dev \ libkrb5-dev \ libmagickcore-dev \ libmagickwand-dev \ libonig-dev \ libmcrypt-dev \ libmemcached-dev \ libtidy-dev \ libxml2-dev \ libxslt-dev \ libz-dev \ libzip-dev \ python3-pip \ nginx \ php \ php-fpm \ php-common \ php-gmp \ php-curl \ php-intl \ php-mbstring \ php-xmlrpc \ php-gd \ php-pear \ php-bcmath \ php-imagick \ imagemagick \ php-soap \ php-ldap \ php-imap \ php-tidy \ php-bz2 \ php-dba \ php-exif \ php-gettext \ php-xml \ php-simplexml \ php-xsl \ php-cli \ php-zip \ php-dev \ dirmngr \ gnupg \ apt-transport-https \ software-properties-common \ ca-certificates \ curl \ build-essential \ ``` -------------------------------- ### Install acme.sh for Wildcard Certificates Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Installs acme.sh, a script for obtaining and managing SSL certificates, and configures it for Gandi LiveDNS to issue wildcard certificates. ```bash wget -O - https://get.acme.sh | sh -s email=contact@colibris-outilslibres.org export GANDI_LIVEDNS_KEY="fdmlfsdklmfdkmqsdfk" acme.sh --issue --dns dns_gandi_livedns -d gogocarto.fr -d *.gogocarto.fr ``` -------------------------------- ### Install MongoDB PHP Extension Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Install the MongoDB PECL extension and configure PHP to use it. Adjust PHP.ini settings for large imports if necessary. ```bash pecl channel-update pecl.php.net ``` ```bash pecl install mongodb ``` ```ini extension=mongodb.so ``` ```bash service php7.3-fpm restart ``` -------------------------------- ### Install Telegraf Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Installs the Telegraf agent package on Debian-based systems. ```bash sudo apt -y install telegraf ``` -------------------------------- ### Production Cron Jobs for SaaS Instance Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation.md Configure these cron jobs for a multi-instance (SaaS) GoGoCarto setup. Includes tasks for project updates, newsletters, webhooks, and custom domain handling. ```shell # for a SAAS instance * * * * * php GOGOCARTO_DIR/bin/console --env=prod app:project:update # If you have more than 1400 project, you should run it twice a minute : * * * * * sleep 30 && php GOGOCARTO_DIR/bin/console --env=prod app:project:update # Task ran for every projects that need it at once @hourly php GOGOCARTO_DIR/bin/console --env=prod app:users:sendNewsletter */5 * * * * php GOGOCARTO_DIR/bin/console --env=prod app:webhooks:post @daily php GOGOCARTO_DIR/bin/console --env=prod app:projects:check-for-deleting # Next one is for custom domain, it works only with NGINX 0 * * * * cd GOGOCARTO_DIR &&bash bin/execute_custom_domain.sh ``` -------------------------------- ### Configure Sudo for GogoCarto User Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Allow the 'gogocarto' user to start and stop the cron service without a password by adding a specific command alias to the sudoers file. ```bash Cmnd_Alias CRON_CMDS = /usr/bin/systemctl start cron, /usr/bin/systemctl stop c$ gogocarto ALL=(ALL) NOPASSWD: CRON_CMDS ``` -------------------------------- ### Watch for File Changes During Development Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation.md Run this command to start a process that watches for file changes and automatically recompiles assets during development. ```shell make watch ``` -------------------------------- ### Update System Packages Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Update the package list and upgrade installed packages on Debian systems. ```bash apt update && apt upgrade -y ``` -------------------------------- ### Initialize Project with Local Environment Variables Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation.md Create a local environment file and set the MongoDB connection URL. This is a prerequisite for initializing the project manually. ```shell MONGODB_URL=mongodb://localhost:27017 ``` ```shell make init ``` -------------------------------- ### Enable Nginx Site Configuration Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Creates a symbolic link to enable the Nginx site configuration file. This command should be run after placing the configuration file in sites-available. ```bash ln -nsf /etc/nginx/sites-available/gogocarto.fr /etc/nginx/sites-enabled/gogocarto.fr ``` -------------------------------- ### Create GogoCarto User Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Create a dedicated user account for GogoCarto without special permissions. ```bash adduser gogocarto ``` -------------------------------- ### Clean Existing Database Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/restore_db.md Connect to MongoDB, switch to the target database, and drop it to ensure a clean state before restoration. Use 'exit' to leave the mongo shell. ```bash mongo use XXX db.dropDatabase() exit ``` -------------------------------- ### Make Backup Script Executable Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Grant execute permissions to the backup script. ```bash chmod +x /root/backup.sh ``` -------------------------------- ### PHP CLI Configuration Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Adjust PHP CLI settings for maximum execution time and memory limit. ```bash #/etc/php/7.3/cli/php.ini max_execution_time = 6000 memory_limit = -1 ``` -------------------------------- ### PHP-FPM Pool Configuration Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Configure PHP-FPM pool settings for the gogocarto user, including process management and listener ownership. ```bash #/etc/php/7.3/fpm/pool.d/www.conf user = gogocarto group = gogocarto listen.owner = gogocarto listen.group = gogocarto pm.max_children = 400 pm.start_servers = 100 pm.min_spare_servers = 100 pm.max_spare_servers = 300 ``` -------------------------------- ### Restore Database from Backup Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/restore_db.md Use the mongorestore command to restore the database from a specified backup file. Replace XXX with the database name and DATE with the backup date. ```bash mongorestore -d=XXX /var/backups/mongobackups/DATE/XXX ``` -------------------------------- ### Production Cron Jobs for Normal Instance Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation.md Configure these cron jobs for a standard GoGoCarto instance to perform daily and hourly maintenance tasks. ```shell # for a Normal instance @daily php GOGOCARTO_DIR/bin/console --env=prod app:elements:checkvote @daily php GOGOCARTO_DIR/bin/console --env=prod app:elements:checkExternalSourceToUpdate @daily php GOGOCARTO_DIR/bin/console --env=prod app:notify-moderation @hourly php GOGOCARTO_DIR/bin/console --env=prod app:users:sendNewsletter */5 * * * * php GOGOCARTO_DIR/bin/console --env=prod app:webhooks:post ``` -------------------------------- ### PHP-FPM Configuration Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Set PHP-FPM execution time and memory limit. ```bash #/etc/php/7.3/fpm/php.ini max_ecution_time = 200 memory_limit = 512M ``` -------------------------------- ### Clone GoGoCarto Repository Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation.md Use this command to clone the GoGoCarto project from its GitLab repository. ```shell git clone https://gitlab.adullact.net/pixelhumain/GoGoCarto.git ``` -------------------------------- ### Configure /etc/hosts File Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Edit the /etc/hosts file to map IP addresses to hostnames, including IPv4 and IPv6 configurations for the server. ```bash # nameserver config # IPv4 127.0.0.1 localhost.localdomain localhost 100.101.102.103 gogocarto gogocarto.fr # # IPv6 ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts acab:acab:acab:acab::2 gogocarto gogocarto.fr ``` -------------------------------- ### Matomo Environment Variables Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/matomo.md Configure these environment variables in your `.env.local` file to connect to your Matomo instance. ```env MATOMO_URL=https://my_matomo_server.org/ MATOMO_SITE_ID=12 MATOMO_USER_TOKEN=anonymous ``` -------------------------------- ### Clone GoGoCarto Repository Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Clones the GoGoCarto Git repository into the /var/www directory, creating a dedicated directory and setting appropriate ownership. ```bash cd /var/www sudo mkdir gogocarto sudo chown gogocarto:gogocarto gogocarto/ sudo -u gogocarto git clone https://gitlab.adullact.net/pixelhumain/GoGoCarto.git gogocarto/ ``` -------------------------------- ### Update GoGoCarto Application Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation.md Run this command as the 'gogocarto' user to update the GoGoCarto application to the latest version. ```shell # With gogocarto user make gogo-update ``` -------------------------------- ### Create InfluxDB User Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Creates a new user 'gogocarto' with all privileges in InfluxDB using a curl command. ```bash curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER gogocarto WITH PASSWORD 'strongpassword' WITH ALL PRIVILEGES" ``` -------------------------------- ### Set Session Directory Ownership Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Change ownership of the PHP session directory to gogocarto user and group. ```bash sudo chown gogocarto:gogocarto -R /var/lib/php/sessions/ ``` -------------------------------- ### Gogocarto Backup Script Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md A bash script to back up MongoDB and Gogocarto files, compress them, and upload to an FTP server. It also cleans up old backups. ```bash #!/bin/bash HOST=${HOST:-backup.host} USER=${USER:-user} PASSWORD=${PASSWORD:-pass} KEEPBACKUPDAYS=${KEEPBACKUPDAYS:-10} DIRECTORYMONGO=${DIRECTORYMONGO:-/var/backups/mongobackups} DIRECTORYFILES=${DIRECTORYFILES:-/var/backups/gogocarto-uploads} GOGOCARTODIRECTORY=${GOGOCARTODIRECTORY:-/var/www/gogocarto} if [ ! -d "$DIRECTORYMONGO" ]; then mkdir -p $DIRECTORYMONGO fi if [ ! -d "$DIRECTORYFILES" ]; then mkdir -p $DIRECTORYFILES fi # backup mongodb mongodump --out $DIRECTORYMONGO/`date +"%Y-%m-%d"` # backup gogocarto files cd $GOGOCARTODIRECTORY/web/uploads tar -zcvf $DIRECTORYFILES/`date +"%Y-%m-%d"`.tar.gz . # clean older backups find $DIRECTORYFILES/ -mtime +$KEEPBACKUPDAYS -exec rm -rf {} \; find $DIRECTORYMONGO/ -mtime +$KEEPBACKUPDAYS -exec rm -rf {} \; # compress and remplace existing on ftp cd $DIRECTORYFILES tar -zcvf /tmp/gogocarto-uploads.tar.gz . cd $DIRECTORYMONGO tar -zcvf /tmp/mongobackups.tar.gz . cd /tmp lftp -u $USER,$PASSWORD $HOST -e "rm -r gogocarto;mkdir -p gogocarto;cd gogocarto;put mongobackups.tar.gz; put gogocarto-uploads.tar.gz; exit" # remove local one rm mongobackups.tar.gz gogocarto-uploads.tar.gz ``` -------------------------------- ### Enable HTTP Authentication for InfluxDB Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Enables HTTP authentication for InfluxDB by modifying its configuration file. ```bash sudo vim /etc/influxdb/influxdb.conf ``` ```ini [http] auth-enabled = true ``` -------------------------------- ### Restart PHP-FPM Service Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Restart the PHP 7.3 FPM service to apply configuration changes. ```bash service php7.3-fpm restart ``` -------------------------------- ### Nginx Server Blocks for HTTP and HTTPS Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md This configuration sets up two server blocks: one for HTTP redirection to HTTPS and another for handling HTTPS traffic with SSL/TLS settings, caching, and PHP processing. It's designed for wildcard subdomains. ```nginx #/etc/nginx/sites-avaible/gogocarto.fr server { listen 80; listen [::]:80; server_name gogocarto.fr; access_log /var/log/nginx/gogocarto.fr.access.log; error_log /var/log/nginx/gogocarto.fr.error.log; location /.well-known/acme-challenge/ { default_type "text/plain"; root /var/www/certbot; } location / { return 301 https://www.$host$request_uri; } } server { listen 80; listen [::]:80; server_name *.gogocarto.fr; access_log /var/log/nginx/gogocarto.fr.access.log; error_log /var/log/nginx/gogocarto.fr.error.log; location /.well-known/acme-challenge/ { default_type "text/plain"; root /var/www/certbot; } location / { return 301 https://$host$request_uri; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name *.gogocarto.fr; root /var/www/gogocarto/web; # For example with certbot (you need a certificate to run https) ssl_certificate /root/.acme.sh/gogocarto.fr/fullchain.cer; ssl_certificate_key /root/.acme.sh/gogocarto.fr/gogocarto.fr.key; # Security hardening (as of 11/02/2018) ssl_protocols TLSv1.2; # TLSv1.3, TLSv1.2 if nginx >= 1.13.0 ssl_prefer_server_ciphers on; 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_ecdh_curve secp384r1; # Requires nginx >= 1.1.0, not compatible with import-videos script ssl_session_timeout 10m; ssl_session_cache shared:SSL:10m; ssl_session_tickets off; # Requires nginx >= 1.5.9 ssl_stapling on; # Requires nginx >= 1.3.7 ssl_stapling_verify on; # Requires nginx => 1.3.7 # Configure with your resolvers # resolver $DNS-IP-1 $DNS-IP-2 valid=300s; # resolver_timeout 5s; # Enable compression for JS/CSS/HTML bundle, for improved client load times. # It might be nice to compress JSON, but leaving that out to protect against potential # compression+encryption information leak attacks like BREACH. gzip on; gzip_types text/css application/javascript; gzip_vary on; add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"; access_log /var/log/nginx/gogocarto.fr.access.log; error_log /var/log/nginx/gogocarto.fr.error.log; location ^~ '/.well-known/acme-challenge' { default_type "text/plain"; root /var/www/certbot; } # cache.appcache, your document html and data location ~* \.(?:manifest|appcache|html?|xml)$ { add_header Cache-Control "max-age=0"; } # Feed location ~* \.(?:rss|atom)$ { add_header Cache-Control "max-age=3600"; } # Media: images, icons, video, audio, HTC location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ { access_log off; add_header "Access-Control-Allow-Origin" *; add_header Cache-Control "max-age=2592000"; } # Media: svgz files are already compressed. location ~* \.svgz$ { access_log off; gzip off; add_header Cache-Control "max-age=2592000"; } # CSS and Javascript location ~* \.(?:css|js)$ { add_header Cache-Control "max-age=31536000"; access_log off; } # WebFonts location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header Cache-Control "max-age=2592000"; add_header "Access-Control-Allow-Origin" *; access_log off; } # strip app.php/ prefix if it is present rewrite ^/index\.php/?(.*)$ /$1 permanent; location / { index index.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /index.php/$1 last; } # pass the PHP scripts to FastCGI server from upstream phpfcgi location ~ ^/(app|app_dev|index|config)\.php(/|$) { fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*); include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS on; fastcgi_read_timeout 300; } } ``` -------------------------------- ### Configure Telegraf for InfluxDB Output and Inputs Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Configures Telegraf to send metrics to a local InfluxDB instance and enables various input plugins for system monitoring. ```toml # Global tags can be specified here in key="value" format. [global_tags] # dc = "us-east-1" # will tag all metrics with dc=us-east-1 # rack = "1a" ## Environment variables can be used as tags, and throughout the config file # user = "$USER" # Configuration for telegraf agent [agent] interval = "10s" round_interval = true metric_batch_size = 1000 metric_buffer_limit = 10000 collection_jitter = "0s" flush_interval = "10s" flush_jitter = "0s" precision = "" debug = false quiet = false hostname = "" omit_hostname = false ### OUTPUT # Configuration for influxdb server to send metrics to [[outputs.influxdb]] urls = ["http://localhost:8086"] database = "telegraf_metrics" ## Retention policy to write to. Empty string writes to the default rp. retention_policy = "" ## Write consistency (clusters only), can be: "any", "one", "quorum", "all" write_consistency = "any" ## Write timeout (for the InfluxDB client), formatted as a string. ## If not provided, will default to 5s. 0s means no timeout (not recommended). timeout = "5s" username = "gogocarto" password = "strongpassword" ## Set the user agent for HTTP POSTs (can be useful for log differentiation) # user_agent = "telegraf" ## Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes) # udp_payload = 512 # Read metrics about cpu usage [[inputs.cpu]] ## Whether to report per-cpu stats or not percpu = true ## Whether to report total system cpu stats or not totalcpu = true ## Comment this line if you want the raw CPU time metrics fielddrop = ["time_*"] # Read metrics about disk usage by mount point [[inputs.disk]] ## By default, telegraf gather stats for all mountpoints. ## Setting mountpoints will restrict the stats to the specified mountpoints. # mount_points = ["/"] ## Ignore some mountpoints by filesystem type. For example (dev)tmpfs (usually ## present on /run, /var/run, /dev/shm or /dev). ignore_fs = ["tmpfs", "devtmpfs"] # Read metrics about disk IO by device [[inputs.diskio]] ## By default, telegraf will gather stats for all devices including ## disk partitions. ## Setting devices will restrict the stats to the specified devices. # devices = ["sda", "sdb"] ## Uncomment the following line if you need disk serial numbers. # skip_serial_number = false # Get kernel statistics from /proc/stat [[inputs.kernel]] # no configuration # Read metrics about memory usage [[inputs.mem]] # no configuration # Get the number of processes and group them by status [[inputs.processes]] # no configuration # Read metrics about swap memory usage [[inputs.swap]] # no configuration # Read metrics about system load & uptime [[inputs.system]] # no configuration # Read metrics about network interface usage [[inputs.net]] # collect data only about specific interfaces # interfaces = ["eth0"] [[inputs.netstat]] # no configuration [[inputs.interrupts]] # no configuration [[inputs.linux_sysctl_fs]] # no configuration ``` -------------------------------- ### Reload Nginx Service Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Applies the Nginx configuration changes by gracefully reloading the service. This command is used after modifying configuration files. ```bash service nginx reload ``` -------------------------------- ### Restart SSH Service Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Restart the SSH daemon to apply the changes made to the sshd_config file. ```bash service sshd restart ``` -------------------------------- ### Harden SSH Configuration Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Modify the SSH server configuration file (/etc/ssh/sshd_config) to enhance security by changing the port, disabling root login, and enforcing public key authentication. ```bash Port 1999 # change port for something uncommon PermitRootLogin no # no login as root PermitEmptyPasswords no # empty password for ssh acces, bad idea.. AllowUsers admin gogocarto # only users admin and gogocarto shall pass MaxAuthTries 3 # only 3 tries ClientAliveInterval 60 #check activity every 60 seconds (1 minute) ClientAliveCountMax 5 # after 5 minutes without activity, kick out Protocol 2 # only more secure protocol IgnoreRhosts yes # ignore old unsecure ways to connect LogLevel INFO # log a lot of infos PasswordAuthentication no PubkeyAuthentication yes ChallengeResponseAuthentication no UsePAM no ``` -------------------------------- ### Set Nginx User Source: https://github.com/pixelhumain/gogocarto/blob/master/docs/installation_debian.md Specifies the user under which the Nginx worker processes will run. This is typically set in the main nginx.conf file. ```nginx user gogocarto ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.