### Install Shopware Dependencies with Composer Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Shopware/referenceguide.md Installs Shopware packages and dependencies using Composer. This command should be executed from the base directory of the Shopware installation. ```bash cd ~/shopware composer install ``` -------------------------------- ### Example systemd service file for Odoo Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Odoo/referenceguide.md This is an example of a systemd user-level service file used to manage the Odoo application. It defines service parameters like working directory, environment variables, execution commands, and restart policies. Ensure the paths and environment variables are correctly set for your Odoo installation. ```ini [Unit] Description=Odoo application (main) for %u Wants=network-online.target After=network-online.target Requires=dbus.socket StartLimitIntervalSec=0 [Service] LimitNOFILE=819200 LimitNPROC=819200 LimitMEMLOCK=infinity TimeoutStartSec=900 Type=simple WorkingDirectory=%h/application/odoo EnvironmentFile=%h/conf/.env ExecStart=%h/.pyenv/shims/python %h/application/odoo/odoo-bin -c %h/conf/odoo.conf ExecStop=/bin/kill -s TERM $MAINPID Restart=on-failure RestartSec=10s KillSignal=SIGQUIT StandardOutput=append:%h/logs/odoo.log [Install] WantedBy=default.target ``` -------------------------------- ### Install Composer Dependencies Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Magento 2/referenceguide.md Installs PHP dependencies for Magento 2 using Composer. Ensure your hosting environment meets the required PHP version and extensions. ```bash cd ~/public_html composer install ``` -------------------------------- ### Set Shopware File Permissions Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Shopware/referenceguide.md Sets the correct file and directory permissions for the Shopware installation to ensure proper read/write access while maintaining security. It recursively finds all files and directories within the Shopware installation and applies specific permissions. ```bash find ~/shopware -type f -exec chmod 644 {} \; find ~/shopware -type d -exec chmod 755 {} \; chown -R $USER:$USER ~/shopware ``` -------------------------------- ### Search for Apt Packages Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Configuration/install_packages.md This command-line snippet demonstrates how to search for available packages using the `apt` package manager. It takes a package name as input and returns a list of matching packages, which can then be used for installation. ```bash apt search ``` -------------------------------- ### Run Magento CLI Commands Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Magento 2/referenceguide.md Common Magento 2 CLI commands for setup, compilation, and deployment. These are executed from the Magento 2 project root directory. ```bash php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php bin/magento cache:flush ``` -------------------------------- ### TurboStack vhosts Configuration Example (YAML) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/TurboStack Platform/Hosts/yaml.md An example of a TurboStack configuration file demonstrating global parameters and system user configurations with vhosts entries for different applications. This includes settings for web server, database versions, OS packages, firewall rules, SSH keys, and detailed vhost configurations for production and development environments. ```yaml --- webserver: nginx mysql_version: 8.0 os_extra_packages: - ffmpeg - pwgen elasticsearch_version: 7.x firewall_country_block: CN,RU firewall_whitelist: - "1.2.3.4 # Home IP" - "5.6.7.8/24 # Office range" ssh_keys: - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDDKuK2+TIvERToLFqb+UYyJ/JZqia30Ksmd2Hsm/WML user@laptop system_users: - username: prod vhosts: - server_name: prod.mydomain.com prod.mydomain.eu app_type: my_app app_install: false php_version: 8.3 nodejs_version: 22.x cert_type: letsencrypt - username: dev vhosts: - server_name: dev.mydomain.com app_type: my_app app_install: false php_version: 8.4 nodejs_version: 22.x cert_type: letsencrypt - server_name: megento2dev.mydomain.com app_type: magento2 app_install: true cert_type: custom cert_pvk: | -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- cert_fullchain: |- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ftp: - user: dev-ftp homedir: /var/www/dev/ftp ``` -------------------------------- ### Dynamically Install PHP Packages with Version in YAML Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Configuration/install_packages.md This YAML configuration demonstrates dynamic installation of PHP packages by referencing a `php_main_version` variable. This allows for flexible installation of packages based on the defined PHP version. ```yaml php_main_version: "8.2" os_extra_packages: - php{{ php_main_version }}-amqp - php{{ php_main_version }}-ssh2 ``` -------------------------------- ### Create and Enable a systemd User Service Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Miscellaneous/systemd.md This snippet demonstrates how to create a systemd user service file, enable it to start on login, and start the service. It also shows how to enable lingering for services to start on boot even without an active login. ```bash systemctl --user daemon-reload systemctl --user enable your-app.service systemctl --user start your-app.service loginctl enable-linger your-username ``` -------------------------------- ### Create MedusaJS Project and Admin User Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/MedusaJS/setupexample.md These bash commands are used to create a new MedusaJS project and set up an administrator account. The first command initiates the project creation with an interactive setup, and the second command creates a user with the specified email and password. ```bash mkdir project cd project npx create-medusa-app@latest npx medusa user -e yourmail@tld.com -p ``` -------------------------------- ### Install Hosted Power mu-plugin for Varnish Support Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Wordpress/bestpractices.md Install the Hosted Power mu-plugin by placing 'hostedpower.php' into the '/wp-content/mu-plugins/' directory. This plugin ensures proper communication between the hosting environment, caching layers, and WordPress for optimal Varnish and full-page caching functionality. ```php // This is a placeholder for the hostedpower.php content. // The actual code is provided via download link in the documentation. ``` -------------------------------- ### Install New Odoo Addon using odoo-bin Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Odoo/addons.md This snippet shows how to install a new Odoo addon. First, upload the module to the designated addons directory. Then, stop the Odoo service, execute the odoo-bin command with the -i flag to install the module, and finally restart the service. The module name must be accurate. ```bash systemctl --user stop application.service ~/application/odoo/odoo-bin -i -c ~/conf/odoo.conf --stop-after-init systemctl --user start application.service ``` -------------------------------- ### Search for PHP Apt Packages Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Configuration/install_packages.md This command searches for all available PHP packages for a specific version (e.g., 8.2) using the `apt` package manager. The results help identify exact package names for installation. ```bash apt search php8.2 ``` -------------------------------- ### Multisite WordPress Cronjob Setup with WP-CLI Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Wordpress/bestpractices.md A bash script to set up cron jobs for multisite WordPress installations. It lists all site URLs and runs the cron event for each site individually, ensuring all scheduled tasks are executed across the network. ```bash #!/bin/bash # Adjust path to WordPress root WP_ROOT=/var/www/xxx/public_html /usr/local/bin/wp-cli site list --field=url --path=${WP_ROOT} 2>/dev/null | xargs -i -n1 /usr/local/bin/wp-cli cron event run --due-now --path=${WP_ROOT} --url="{}" ``` -------------------------------- ### Set WordPress File Permissions (Bash) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Wordpress/referenceguide.md Sets the recommended file and directory permissions for WordPress installations. Ensures secure and reliable operation by defining appropriate access levels for files (644) and directories (755), and assigns ownership to the current user. ```bash find ~/public_html -type f -exec chmod 644 {} \; find ~/public_html -type d -exec chmod 755 {} \; chown -R $USER:$USER ~/public_html ``` -------------------------------- ### systemd User Service Configuration Example Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Miscellaneous/systemd.md A basic INI configuration file for a systemd user service. It defines unit properties, service execution commands, restart behavior, environment variables, and installation targets. ```ini [Unit] Description=My App Service After=network.target StartLimitIntervalSec=0 [Service] ExecStart=/var/www/username/path-to-your-app/start.sh RestartSec=10s Restart=always Environment=NODE_ENV=production WorkingDirectory=/var/www/username/path-to-your-app/ [Install] WantedBy=default.target ``` -------------------------------- ### Manage systemd User Services for Magento Consumers Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Magento 2/referenceguide.md Examples of systemctl commands to check the status of individual Magento message queue consumers managed by systemd. ```bash systemctl --user status magento-consumer@sales.rule.update.coupon.usage.service systemctl --user status magento-consumer@product_action_attribute.update.service ``` -------------------------------- ### Install and Activate WP Redis Plugin via WP-CLI Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Wordpress/bestpractices.md Installs and activates the WP Redis plugin using WP-CLI. This plugin is recommended for dynamic WordPress sites to improve performance by caching database queries. ```bash wp plugin install wp-redis wp plugin activate wp-redis ``` -------------------------------- ### Deploy Account via YAML - TurboStack Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/TurboStack Platform/Hosts/Accounts/setup.md This snippet demonstrates how to deploy a new system user account by defining it in the source YAML configuration. It's an advanced method for users comfortable with YAML editing. The primary input is the username for the new account. ```yaml system_users: - username: prod ``` -------------------------------- ### YAML Configuration for Server Setup Source: https://context7.com/hosted-power/docs-turbostack-app/llms.txt Defines server settings, user vhosts, and application configurations using YAML. Supports multiple web servers, databases, caching, and application types like Magento 2, WordPress, and Dockerized apps. ```yaml --- webserver: nginx mysql_version: 8.0 mysql_innodb_size: 2G elasticsearch_version: 7.x varnish_cache_size: 4g redis_enabled: true redis_memory: 5gb firewall_country_block: CN,RU firewall_whitelist: - "1.2.3.4 # Home IP" - "5.6.7.8/24 # Office range" ssh_keys: - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDDKuK2+... user@laptop os_extra_packages: - ffmpeg - pwgen system_users: - username: prod vhosts: - server_name: prod.mydomain.com prod.mydomain.eu app_type: magento2 app_install: false php_version: 8.3 nodejs_version: 22.x varnish_enabled: true cert_type: letsencrypt - server_name: api.mydomain.com app_type: my_app docker_enabled: true rabbitmq_enabled: true - username: dev vhosts: - server_name: dev.mydomain.com app_type: wordpress php_version: 8.4 cert_type: selfsigned ftp: - user: dev-ftp homedir: /var/www/dev/ftp ``` -------------------------------- ### Custom Nginx Rewrite Rule (Bash) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/Web Servers/NGINX/nginx_basics.md This example demonstrates how to add a custom rewrite rule for the /blog path. It ensures that requests to /blog are permanently redirected to /blog/. This configuration should be placed in a file like /nginx/20rewrites.conf. ```bash location /blog { rewrite ^/blog$ /blog/ permanent; } ``` -------------------------------- ### Configure OS Extra Packages in YAML Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Configuration/install_packages.md This snippet shows how to specify additional operating system packages to be installed via the `os_extra_packages` key in a YAML configuration file. This is used within the TurboStack environment to manage server dependencies. ```yaml os_extra_packages: - acl ``` -------------------------------- ### Set Up Shopware Scheduled Task Cronjob Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Shopware/referenceguide.md Configures a cron job to run Shopware's scheduled tasks every 5 minutes. This ensures background jobs and internal tasks are processed regularly. Output is redirected to a log file. ```bash */5 * * * * cd ~/shopware && bin/console scheduled-task:run >> ~/logs/scheduled-task.log 2>&1 ``` -------------------------------- ### Configure MedusaJS Backend and Frontend with YAML Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/MedusaJS/setupexample.md This YAML configuration sets up Nginx as a webserver for both the MedusaJS backend and a demo frontend on TurboStack. It specifies Node.js versions, Let's Encrypt certificates, and proxy settings for ports 8000 and 9000. ```yaml webserver: nginx postgresql_version: 18 system_users: - username: demo vhosts: - server_name: shopname.tld www.shopname.tld app_name: frontend nodejs_version: 24 cert_type: letsencrypt proxy_enabled: true proxy_upstream_port: "8000" - server_name: dashboard.shopname.tld www.dashboard.shopname.tld app_name: dashboard nodejs_version: 24 cert_type: letsencrypt proxy_enabled: true proxy_upstream_port: "9000" ``` -------------------------------- ### Clear Shopware Cache via CLI Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Shopware/referenceguide.md Clears the application cache for Shopware. This is a necessary step after installing plugins, making configuration changes, or performing updates. ```bash cd ~/shopware bin/console cache:clear ``` -------------------------------- ### Configure Redis Socket in wp-config.php Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Wordpress/bestpractices.md Sets up the Redis server configuration in wp-config.php to use a Unix socket for connection. This is a common setup when Redis is installed on the same server as WordPress. ```php $redis_server = array( 'host' => '/var/run/redis/redis.sock', 'port' => null, 'database' => 1, ); ``` -------------------------------- ### Create Custom Server Template (YAML) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/TurboStack Platform/templates.md This snippet demonstrates the structure of a custom server template using YAML. It defines web server configuration, PostgreSQL version, OS extra packages, and system user details including virtual hosts and application settings. This is useful for creating repeatable server configurations. ```yaml --- webserver: nginx postgresql_version: 16 os_extra_packages: - libxml2-dev - libxslt1-dev - libldap2-dev - libsasl2-dev system_users: - username: prod vhosts: - server_name: example.com www.example.com app_name: odoo app_type: odoo python_version: 3.10.17 docker_enabled: true cert_type: selfsigned ``` -------------------------------- ### Start ncdu Disk Usage Scan Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Miscellaneous/disk_space_usage.md Initiates an interactive disk usage scan of the current directory using the ncdu tool. This command is useful for quickly identifying large files and directories within a specific location on the server. No specific dependencies are required beyond the ncdu utility being installed. ```bash prod@web2:~$ ncdu . ``` -------------------------------- ### Install Custom Addon Requirements using Pip Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Odoo/pythonrequirements.md Installs dependencies for custom Odoo addons that include their own `requirements.txt` files. This command uses a wildcard to install requirements from all subdirectories within 'custom-addons'. ```bash pip install -r custom-addons/*/requirements.txt ``` -------------------------------- ### Define Server Templates with YAML Source: https://context7.com/hosted-power/docs-turbostack-app/llms.txt Creates reusable server configurations using YAML for rapid deployment. Examples provided include templates for Odoo and Magento 2, specifying web server, database versions, OS packages, user accounts, and application-specific settings like PHP versions and caching. ```yaml # Example Odoo template --- webserver: nginx postgresql_version: 16 os_extra_packages: - libxml2-dev - libxslt1-dev - libldap2-dev - libsasl2-dev system_users: - username: prod vhosts: - server_name: example.com www.example.com app_name: odoo app_type: odoo python_version: 3.10.17 docker_enabled: true cert_type: selfsigned ``` ```yaml # Example Magento 2 template --- webserver: nginx mysql_version: 8.0 mysql_innodb_size: 4G elasticsearch_version: 7.x elasticsearch_heap_size: 2g varnish_cache_size: 4g redis_memory: 2gb system_users: - username: prod vhosts: - server_name: shop.example.com app_type: magento2 php_version: "8.2" varnish_enabled: true cert_type: letsencrypt ``` -------------------------------- ### Install Odoo Core Requirements using Pip Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Odoo/pythonrequirements.md Installs the core dependencies required by Odoo by referencing its `requirements.txt` file. This command should be run from the application's root directory. ```bash cd ~/application pip install -r odoo/requirements.txt ``` -------------------------------- ### Install Specific PHP Packages in YAML Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Configuration/install_packages.md This YAML snippet lists specific PHP packages to be installed, including different versions. These packages are managed through the `os_extra_packages` configuration in TurboStack. ```yaml os_extra_packages: - php8.2-amqp - php8.2-ssh2 - php8.4-amqp - php8.4-ssh2 - php8.4-dom ``` -------------------------------- ### Define Magento 2 Application in YAML Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/TurboStack Platform/Hosts/Accounts/setup.md This YAML snippet demonstrates how to define a Magento 2 application with specific configurations like server names, PHP version, Varnish enablement, and certificate type. It's intended for advanced users managing application deployments through source code. ```yaml system_users: - username: prod vhosts: - server_name: example.com www.example.com app_type: magento2 php_version: "8.2" varnish_enabled: true cert_type: self-signed ``` -------------------------------- ### Check Installed OpenSSH Packages (Bash) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Miscellaneous/openssh_FP.md This command lists all installed OpenSSH packages on a Debian-based system. It helps identify the specific OpenSSH components that are installed, which can be useful for cross-referencing with security advisories. ```bash # Show installed OpenSSH packages: dpkg -l | grep openssh ``` -------------------------------- ### Create FTP User via YAML Configuration Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Configuration/ftp.md This YAML snippet demonstrates how to create an FTP user ('stagftp') under an existing system user ('stag'). It specifies the server name, application type, PHP version, and certificate type for the associated virtual host, along with the FTP user's home directory. ```yaml system_users: - username: stag vhosts: - server_name: demo.hosted-power.com app_type: shopware php_version: "8.3" cert_type: letsencrypt ftp: - user: stagftp homedir: /var/www/stag/public_html/ftp ``` -------------------------------- ### Install apache2-utils for htpasswd Generation (YAML) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/Web Servers/NGINX/nginx_block_access.md This snippet shows how to add the 'apache2-utils' package to your Turbostack application's configuration. This package provides the 'htpasswd' utility required for generating authentication files. Ensure this is added to your turbostack YAML file and the changes are published. ```yaml os_extra_packages: - apache2-utils ``` -------------------------------- ### Add Custom NGINX Configurations Source: https://context7.com/hosted-power/docs-turbostack-app/llms.txt This bash snippet illustrates how to add custom NGINX configurations within the account's /nginx directory. It provides examples for creating rewrite rules, IP whitelists, and security rules, followed by a command to reload NGINX to apply these changes. ```bash # Custom rewrite rules - /nginx/20rewrites.conf cat > /nginx/20rewrites.conf << 'EOF' # Redirect non-WWW to WWW if ($host ~ ^(?!www\.)(?.+)$) { return 301 $scheme://www.$domain$request_uri; } # Redirect WWW to non-WWW if ($host ~* ^www\.(?.+)$) { return 301 $scheme://$domain$request_uri; } # Redirect multiple domains to main domain if ($http_host ~* "^(.*)(old-site\.be|another-site\.nl)$") { rewrite ^(.*)$ https://www.main-site.com$request_uri redirect; } EOF # Pre-Varnish IP whitelist - /nginx/outside/main/10whitelist.conf cat > /nginx/outside/main/10whitelist.conf << 'EOF' allow 192.168.0.0/24; deny all; EOF # Security rules - /nginx/60security.conf cat > /nginx/60security.conf << 'EOF' location = /robots.txt { allow all; log_not_found off; access_log off; } location ~* \.(txt|log)$ { deny all; } EOF # Apply changes tscli nginx reload ``` -------------------------------- ### Clear Magento Cache Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/Caching/redis.md Command to clear the Magento cache. This is a standalone operation and does not require specific dependencies beyond a Magento installation. ```bash php bin/magento cache:flush ``` -------------------------------- ### Enable TurboShield Configuration (YAML) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Configuration/turboshield.md This snippet shows how to enable TurboShield and set its operational level. The 'level' parameter determines the request threshold for rate limiting, with options 'low', 'medium', and 'high'. If not specified, 'medium' is the default. ```yaml turboshield: enabled: true level: medium # if not specified, medium is used ``` -------------------------------- ### Clear Magento Cache Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Magento 2/referenceguide.md Commands to clear Magento's internal caches, as well as Varnish and Redis caches if they are enabled. ```bash php bin/magento cache:clean php bin/magento cache:flush tscli varnish clear tscli redis clear ``` -------------------------------- ### Manage Screen Sessions for Long-Running Commands (Bash) Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/Databases/MySQL/mysql_basic_operations.md Provides commands to manage screen sessions, which are useful for ensuring that long-running processes like database dumps or imports continue even if the connection is lost. It includes creating, detaching, reattaching, and listing screen sessions. ```bash screen -S ``` ```bash Ctrl + A, then D ``` ```bash screen -dr ``` ```bash screen -ls ``` -------------------------------- ### Customize Varnish VCL Configuration Source: https://context7.com/hosted-power/docs-turbostack-app/llms.txt This bash snippet demonstrates how to customize Varnish Varnish Configuration Language (VCL) by adding custom configurations in the /etc/varnish/conf.d/ directory. It shows how to create a new VCL file and reload Varnish to apply the changes, including a custom cache bypass rule for admin pages. ```bash # View current Varnish configs ls -la /etc/varnish/conf.d/ # Output: # 10_bypass.vcl # 50_main.vcl # Create custom config (loaded between bypass and main) cat > /etc/varnish/conf.d/20_custom.vcl << 'EOF' sub vcl_recv { # Custom cache bypass for admin pages if (req.url ~ "^/admin") { return (pass); } } EOF # Reload Varnish to apply changes tscli varnish reload ``` -------------------------------- ### Update Shopware with Composer Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/Shopware/referenceguide.md Updates Shopware to the latest version using Composer and finalizes the update process. It's crucial to back up code and the database before performing an update. ```bash cd ~/shopware composer update bin/console system:update:finish ``` -------------------------------- ### Clear Varnish and Redis Caches Source: https://github.com/hosted-power/docs-turbostack-app/blob/main/Technologies/CMS & Frameworks/MedusaJS/referenceguide.md Commands to clear the cache stored in Varnish and Redis. These commands are useful for ensuring that the latest content is served to users after updates or configuration changes. ```bash tscli varnish clear tscli redis clear ```