### Install Wiki.js Dependencies Source: https://faq.o2switch.fr/guides/nodejs/installer-wikijs Activate the NodeJS virtual environment created by 'Setup NodeJS App' and install the application's dependencies using npm. This command should be run after setting up the environment and navigating to the application's root directory. ```bash # Enter the NodeJS environment source /home/o3dev/nodevenv/appWikijs/10/bin/activate && cd /home/o3dev/appWikijs # Install the dependencies npm install # And... that's it. ``` -------------------------------- ### Install Wagtail CMS Source: https://faq.o2switch.fr/cpanel/logiciels/hebergement-python-multi-version Remove the default 'Hello World' application, start a new Wagtail project, navigate to the application directory, and install project dependencies. ```bash # Go back to the root of the hosting cd # Delete the python Hello World created by cPanel rm -fr app-wagtail/* # Start a new wagtail project # The first option corresponds to the project name # Followed by the directory where you want to install it. So the same as the Application Root defined previously wagtail start monsitewagtail "app-wagtail" # Go to the directory containing the application sources cd app-wagtail # Install dependencies pip install -r requirements.txt ``` -------------------------------- ### Install WordPress Core Source: https://faq.o2switch.fr/guides/wordpress/introduction-wpcli Install WordPress with specified URL, title, and admin credentials. ```bash wp core install --url="http://o2alex.odns.fr" --title="Mon site WordPress" --admin_user="alexis" --admin_password="mon mot de passe" --admin_email="support@o2switch.fr" ``` -------------------------------- ### Install PHP Dependencies with Composer Source: https://faq.o2switch.fr/guides/php/heberger-application-symfony Navigate to your application directory and run `composer install` to install all necessary PHP dependencies. ```bash cd /home/o2demo/mon-application composer install ``` -------------------------------- ### Install Project Dependencies Source: https://faq.o2switch.fr/guides/php/installer-composer Navigate into the project directory and use Composer to install all necessary dependencies. ```bash cd squelette-silex composer install ``` -------------------------------- ### Install Dependencies and Build React Application Source: https://faq.o2switch.fr/guides/nodejs/application-reactjs Navigate to your project directory, install the application's dependencies using npm, and then run the build command to create production-ready files for your React application. ```bash # Il faut se placer dans le dossier qui contient les fichiers de l'application cd SnapShot # Il faut installer les dépendances npm install ``` -------------------------------- ### Deprecated Authentication Example Source: https://faq.o2switch.fr/cpanel/outils/exception-parefeu Example of environment variables setup for deprecated cPanel password authentication. Note: API token authentication is recommended. ```bash SERVER="le-serveur.o2switch.net" LOGIN="toto1234" # Le mot de passe doit être urlencodé, pour faire cela, trois options : # A) si "JQ" installé : printf %s 'le mot de passe' | jq -sRr @uri # B) si PHP installé : php -r "echo urlencode('Le mot de passe');" # C) si OK avec un site tiers, attention à ne pas ajouter un saut de ligne à la fin : https://www.urlencoder.org/fr/ PASSWORD='Le mot de passe cPanel' ENDPOINT='frontend/o2switch/o2switch-ssh-whitelist/index.live.php' ``` -------------------------------- ### Download and Install Composer Source: https://faq.o2switch.fr/guides/php/installer-composer Download the Composer installer script, run it to generate the composer.phar file, and then remove the installer script. ```bash php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php php -r "unlink('composer-setup.php');" ``` -------------------------------- ### Install and Activate WordPress Plugin Source: https://faq.o2switch.fr/guides/wordpress/introduction-wpcli Install a WordPress plugin by its slug or from a zip archive, and then activate it. The --activate flag can be used to activate during installation. ```bash wp plugin install jetpack wp plugin activate jetpack ``` -------------------------------- ### Update PATH, Clean Up, and Install Ghost Source: https://faq.o2switch.fr/cpanel/logiciels/hebergement-nodejs-multi-version Temporarily update the system's PATH to include the Ghost-CLI executable. Remove default files created by the Node.js app setup tool, as Ghost requires an empty application directory for installation. Finally, install Ghost locally using the Ghost-CLI. ```bash # Attention, the path here depends on your project name and NodeJS version # You must indicate the path to the folder containing the ghost-cli executable # You can look in the "nodevenv" folder at the root of the hosting. # Normally it is in a folder of the following form: # /home/{IDENTIFIER}/nodevenv/{APPLICATION ROOT}/{VERSION NODE}/lib/lib/node_modules/ghost-cli/bin export PATH="$HOME/nodevenv/ghost-backend/20/lib/lib/node_modules/ghost-cli/bin/:$PATH" # We delete the default files created, like the "Hello World" by the NodeJS tool rm -fr app.js node_modules public tmp # We install ghost ghost install local --no-setup # We configure Ghost, remember to replace your site's address in the command ghost config --url https://ghost.o2tuto.fr --db sqlite3 --dbpath content/data/ghost.db --mail Direct ``` -------------------------------- ### Install and Activate WordPress Theme Source: https://faq.o2switch.fr/guides/wordpress/introduction-wpcli Install a WordPress theme by its slug or from a zip archive, and then activate it. Note that some themes may require a parent theme. ```bash wp theme install wck2014 wp theme activate wck2014 wp theme install twentythirteen wp theme install wck2014 ``` -------------------------------- ### Install Wagtail CLI Source: https://faq.o2switch.fr/cpanel/logiciels/hebergement-python-multi-version Activate the Python environment and install the Wagtail command-line interface using pip. Ensure you use the correct source command provided by your hosting environment. ```bash # Do not copy this command, take the one provided by the python tool on your hosting # The command changes based on your project name and selected python version source /home/dojo2567/virtualenv/app-wagtail/3.11/bin/activate && cd /home/dojo2567/app-wagtail # Install Wagtail CLI pip install wagtail ``` -------------------------------- ### Installation des dépendances de Redmine Source: https://faq.o2switch.fr/cpanel/logiciels/hebergement-ruby-multi-version Installez Bundler, puis utilisez-le pour installer toutes les dépendances nécessaires à Redmine, en excluant les environnements de développement et de test. ```bash # On installe Bundler qui est nécessaire à l'installation de toutes les dépendances de Redmine gem install bundler # Puis les dépendances bundle install --without development test ``` -------------------------------- ### Example Symfony .env Configuration Source: https://faq.o2switch.fr/guides/php/heberger-application-symfony Examples of common configurations for the `.env` file, including setting the environment to production, database connection URLs for SQLite, MySQL, and PostgreSQL, and SMTP mailer configurations. ```dotenv # Penser à passer en prod, en mode dev des informations confidentielles peuvent être affichées! APP_ENV=prod # Si vous utilisez une base de données, c'est à configurer. Dans le cas de MySQL & PostgreSQL, vous avez du les créer précédemment # Exemple avec sqlite DATABASE_URL=sqlite:///%kernel.project_dir%/data/database.sqlite # Exemple de configuration pour MySQL DATABASE_URL="mysql://NOM_UTILISATEUR:MOT_DE_PASSE@127.0.0.1:3306/db_name?serverVersion=mariadb-10.3.28" # Exemple pour Postgresql. Attention à bien utiliser 127.0.0.1 et pas localhost DATABASE_URL="postgresql://NOM_UTILISATEUR:MOT_DE_PASSE@127.0.0.1:5432/db_name?serverVersion=9&charset=utf8" # Si vous utilisez des emails, il faut configurer la connexion SMTP # Attention, des carractères spéciaux comme le "@" ou le "+" doivent être encodés # Par exemple avec https://www.urlencoder.org/ ou https://www.php.net/manual/en/function.urlencode.php MAILER_DSN=smtp://user:pass@smtp.example.com:port # Exemple concret MAILER_DSN=smtp://noreply%40domain.com:mot%20de%20passe@xxxxxxxx.o2switch.net:465?verify_peer=0 ``` -------------------------------- ### Git Clone Execution Example Source: https://faq.o2switch.fr/guides/nodejs/application-reactjs Example output showing the successful cloning of a Git repository, including object enumeration, compression, reception, and delta resolution. It also lists the files present in the cloned directory. ```bash [o2demo@raclette ~]$ git clone https://github.com/Yog9/SnapShot.git Clonage dans 'SnapShot'... remote: Enumerating objects: 297, done. remote: Counting objects: 100% (139/139), done. remote: Compressing objects: 100% (46/46), done. remote: Total 297 (delta 110), reused 93 (delta 93), pack-reused 158 Réception d'objets: 100% (297/297), 3.42 Mio | 5.28 Mio/s, fait. Résolution des deltas: 100% (146/146), fait. [o2demo@raclette ~]$ ls SnapShot/ CONTRIBUTING.md package.json public README.md snapscout.png src yarn.lock ``` -------------------------------- ### Example Composer Usage (with path) Source: https://faq.o2switch.fr/guides/php/installer-composer Demonstrates how to use the downloaded composer.phar file by specifying its full path or relative path. ```bash php ~/bin/composer.phar [commande composer] # ou ~/bin/composer.phar [commande composer] ``` -------------------------------- ### Prepare Composer Installation Directory Source: https://faq.o2switch.fr/guides/php/installer-composer Connect to your hosting via SSH, create a 'bin' directory to store the Composer binary, navigate into it, and display the full path. ```bash ssh identifiantcPanel@monserveur.tld # Création du répertoire bin, s'il existe déjà, ça ne pose pas de problème mkdir bin cd bin pwd ``` -------------------------------- ### Example Apache Raw Access Log Entry Source: https://faq.o2switch.fr/cpanel/mesures/log-acces-brut This is an example of a single log entry from the Apache web server. It details a GET request for the root directory, including the client's IP address, timestamp, requested resource, status code, response size, referrer, and user agent. ```apache 199.45.155.94 - - [04/Oct/2024:01:29:17 +0200] "GET / HTTP/1.1" 200 37767 "-" "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)" ``` -------------------------------- ### Configure Messenger Component with Cron Job Source: https://faq.o2switch.fr/guides/php/heberger-application-symfony Example of a cron job command to consume messages using the Symfony Messenger component. This setup replaces Supervisor and ensures asynchronous tasks are processed. Adjust paths and queue names as needed. ```bash php /home/o2demo/mon-application-sf/bin/console messenger:consume --time-limit=295 --memory-limit=128M async > /home/o2demo/log.txt 2>&1 ``` -------------------------------- ### Activate Node.js Environment and Install Ghost-CLI Source: https://faq.o2switch.fr/cpanel/logiciels/hebergement-nodejs-multi-version Enter your Node.js virtual environment using the 'source' command provided by cPanel. Then, install the Ghost-CLI globally within this environment. It's recommended to use a dedicated SSH client for this process due to potential resource limitations in cPanel's Terminal. ```bash # Do not copy this command, take the one provided in cPanel in the NodeJS tool source /home/dojo2567/nodevenv/ghost-backend/20/bin/activate && cd /home/dojo2567/ghost-backend # Install ghost-cli npm install ghost-cli@latest -g ``` -------------------------------- ### Download and Prepare Wiki.js Sources Source: https://faq.o2switch.fr/guides/nodejs/installer-wikijs Download the Wiki.js source code, create a directory for it, extract the archive, and remove the pre-installed node_modules folder. This prepares the application files for deployment within the o2switch environment. ```bash # Download the sources. Take the latest version found on the following page (wiki-js.tar.gz file) # https://github.com/Requarks/wiki/releases/ # Example as of 07/06/22 wget https://github.com/requarks/wiki/releases/download/v2.5.285/wiki-js.tar.gz # Create the directory where the sources will go mkdir appWikijs # Extract the archive into the appWikijs directory tar -xvf wiki-js.tar.gz -C appWikijs # Navigate to the application directory cd appWikijs # Remove the pre-installed dependency folder as we need to manage it with Setup NodeJS App directly rm -vfr node_modules ``` -------------------------------- ### Install Project Dependencies Source: https://faq.o2switch.fr/guides/nodejs/application-reactjs This output shows the result of installing project dependencies using npm. It includes information about optional dependencies, peer dependency warnings, and a summary of installed packages and vulnerabilities. ```bash es5-ext@0.10.58 postinstall /home/o2demo/SnapShot/node_modules/es5-ext > node -e "try{require('./_postinstall')}catch(e){}" npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/react-scripts/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/jest-haste-map/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.16.7 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself. npm WARN @babel/plugin-proposal-class-static-block@7.17.6 requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself. npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself. added 1667 packages from 788 contributors and audited 1672 packages in 56.438s 99 packages are looking for funding run `npm fund` for details found 48 vulnerabilities (2 low, 32 moderate, 13 high, 1 critical) run `npm audit fix` to fix them, or `npm audit` for details ``` -------------------------------- ### Configure Wiki.js Application Source: https://faq.o2switch.fr/guides/nodejs/installer-wikijs Generate the configuration file by renaming the sample file and then edit it to provide the necessary database connection parameters. This step is crucial for the application to connect to its data store. ```bash # Generate the configuration file from the sample mv config.sample.yml config.yml # Edit the file with the database connection parameters vi config.yml ``` -------------------------------- ### Composer Project Configuration Source: https://faq.o2switch.fr/guides/php/installer-composer Example composer.json file detailing project name, description, license, PHP requirements, dependencies, autoloading, and scripts. ```json { "name": "fabpot/silex-skeleton", "description": "A pre-configured skeleton for the Silex microframework", "license": "MIT", "type": "project", "require": { "php": ">=5.5.9", "silex/silex": "~2.0", "silex/web-profiler": "~2.0", "symfony/asset": "~2.8|^3.0", "symfony/browser-kit": "~2.8|^3.0", "symfony/class-loader": "~2.8|^3.0", "symfony/config": "~2.8|^3.0", "symfony/console": "~2.8|^3.0", "symfony/css-selector": "~2.8|^3.0", "symfony/debug": "~2.8|^3.0", "symfony/finder": "~2.8|^3.0", "symfony/form": "~2.8|^3.0", "symfony/monolog-bridge": "~2.8|^3.0", "symfony/process": "~2.8|^3.0", "symfony/security": "~2.8|^3.0", "symfony/translation": "~2.8|^3.0", "symfony/twig-bridge": "~2.8|^3.0", "symfony/validator": "~2.8|^3.0" }, "autoload": { "psr-0": { "": "src/" } }, "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } }, "scripts": { "run": [ "echo 'Started web server on http://localhost:8888'", "php -S localhost:8888 -t web" ] } } ``` -------------------------------- ### Installer les dépendances Etherpad et corriger les chemins Source: https://faq.o2switch.fr/guides/nodejs/installer-etherpad Après avoir créé l'environnement NodeJS, activez-le et utilisez ces commandes pour installer les dépendances npm, en créant des liens symboliques pour résoudre les problèmes de chemins spécifiques à Etherpad. ```bash # On entre dans l'environnement nodeJS virtuel source /home/o3dev/nodevenv/appEtherpad/10/bin/activate && cd /home/o3dev/appEtherpad # Afin qu'on puisse lancer la commande npm directement dans appEtherpad, on fait un lien symbolique vers le fichier de dépendance dans src # C'est nécessaire de lancer npm dans appEtherpad directement, pour que le dossier node_modules soit géré correctement (lien symbolique, spécificité de setup nodejs app) ln -s src/package.json package.json # Ensuite on fait le lien nécessaire à etherpad ln -s src ep_etherpad-lite # A présent on peut installer les dépendances npm install # Dés que cela est terminé, un lien symbolique node_modules est créé à la racine du projet # Récupérer le chemin vers le dossier vers lequel pointe ce lien avec # Attention, dans de / après node_modules !! ``` -------------------------------- ### Install FileZilla on Linux Source: https://faq.o2switch.fr/guides/configuration-logiciel/filezilla Use these commands to install FileZilla on Linux systems via package managers. ```bash apt-get install filezilla ``` ```bash yum install filezilla ``` -------------------------------- ### Remove All IPs Response Example Source: https://faq.o2switch.fr/cpanel/outils/exception-parefeu Example JSON response after successfully removing all entries from the SSH whitelist. ```json { "metadata": {}, "status": 1, "messages": [ "Toutes les autorisations ont été supprimées avec succès." ], "warnings": null, "data": null, "errors": null } ``` -------------------------------- ### Installer WordPress avec WP-CLI Source: https://faq.o2switch.fr/guides/wordpress/introduction-wpcli Télécharge les fichiers de WordPress et prépare la génération du fichier de configuration wp-config.php. ```bash # On télécharge WordPress wp core download # On génère le fichier de configuration ``` -------------------------------- ### Remove IP Response Example Source: https://faq.o2switch.fr/cpanel/outils/exception-parefeu Example JSON response after successfully removing an IP address from the SSH whitelist. ```json { "warnings": null, "data": null, "errors": null, "metadata": {}, "status": 1, "messages": [ "L'autorisation a été supprimée avec succès, elle sera effective d'ici quelques minutes (~5mins)." ] } ```