### Install WordPress via SSH Source: https://docs.gandi.net/en/web_hosting/connection/ssh.html Example commands to download, extract, and set up WordPress in your web hosting directory using SSH. ```bash $ cd web/vhosts/wp.gandi.ninja/htdocs/ $ wget https://wordpress.org/latest.zip $ unzip latest.zip $ rm latest.zip index.html $ mv wordpress/* . ``` -------------------------------- ### Install Node.js 13.x Source: https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html Installs Node.js version 13.x and npm using NodeSource's setup script. This is required for running Etherpad-Lite. ```bash # curl -sL https://deb.nodesource.com/setup_13.x | bash - # apt install -y nodejs ``` -------------------------------- ### Run YunoHost Install Script Source: https://docs.gandi.net/en/cloud/vps/tutorials/yuno_install.html As the root user, run this command to download and execute the YunoHost installation script from the official source. This will begin the YunoHost installation process. ```bash # curl https://install.yunohost.org | bash ``` -------------------------------- ### Start Etherpad Lite Service Source: https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html Use this command to start the Etherpad Lite service. Ensure it is running correctly before proceeding. ```bash # systemctl start etherpad-lite ``` -------------------------------- ### Connect to MySQL with Node.js Source: https://docs.gandi.net/en/web_hosting/languages/nodejs.html A minimalistic Node.js example to test MySQL database connection on Web Hosting. Ensure the 'mysql' package is installed. ```javascript var http = require('http'), mysql = require('mysql'); var mysql_conn = mysql.createConnection({ socketPath: '/srv/run/mysqld/mysqld.sock', database: 'default_db', user: 'root', password: '' }); var test_mysql_conn = function(callback) { mysql_conn.connect(function(err) { if (err) { console.log(err.code); if (callback) callback("NOT WORKING"); } else { console.log('connected...'); if (callback) callback("OK"); } }); mysql_conn.end(); }; http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello Node.js!\n'); test_mysql_conn(function(mysql_status) { res.write('MySQL connection: ' + mysql_status + '\n'); res.end(); }); }).listen(process.env.PORT); ``` ```json { "name": "sample-nodejs-mysql-app", "version": "1.0.0", "description": "Sample Node.js MySQL app for Web Hosting", "main": "index.js", "dependencies": { "mysql": "*" } } ``` -------------------------------- ### Install Git, Nginx, and MariaDB Source: https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html Install essential packages for Etherpad-Lite: git for version control, nginx as a web server, and mariadb-server for the database. ```bash # apt install git nginx mariadb-server ``` -------------------------------- ### Install Etherpad-Lite Dependencies Source: https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html Navigates into the downloaded etherpad-lite directory and runs the 'run.sh' script to install necessary dependencies. This script needs to be run as root initially. ```bash $ cd etherpad-lite $ su -c bin/run.sh ``` -------------------------------- ### Connect to PostgreSQL with Node.js Source: https://docs.gandi.net/en/web_hosting/languages/nodejs.html A minimalistic Node.js example to test PostgreSQL database connection on Web Hosting. Ensure the 'pg' package is installed. ```javascript var http = require('http'), pg = require('pg'); var pg_url = "tcp://hosting-db@localhost/postgres"; var pg_conn = new pg.Client(pg_url); var test_pg_conn = function(callback) { pg_conn.connect(function(err) { if (err) { console.log(err); if (callback) callback("NOT WORKING"); } else { console.log('Connected to PostgreSQL'); if (callback) callback("OK"); } }); }; http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello Node.js!\n'); test_pg_conn(function(pg_status) { res.write('PostgreSQL connection: ' + pg_status + '\n'); res.end(); }); }).listen(process.env.PORT); ``` ```json { "name": "sample-nodejs-pgsql-app", "version": "1.0.0", "description": "Sample Node.js PostgreSQL app for Web Hosting", "main": "index.js", "dependencies": { "pg": "*" } } ``` -------------------------------- ### Install Necessary Packages Source: https://docs.gandi.net/en/cloud/tutorials/mattermost.html Install PostgreSQL, PostgreSQL contrib packages, sudo, and Nginx, which are required for the Mattermost installation. ```bash # apt-get install postgresql postgresql-contrib sudo nginx ``` -------------------------------- ### Install OpenStack Client Source: https://docs.gandi.net/en/cloud/vps/api/index.html Installs the Python OpenStack client required for interacting with the GandiCloud VPS API. ```bash pip3 install openstackclient ``` -------------------------------- ### Example .htpasswd File Content Source: https://docs.gandi.net/en/web_hosting/tutorials/htaccess.html This is an example of the content for a .htpasswd file. Replace 'ryan' with your desired username and 'oeteHNuwJnH7k' with your encrypted password. ```apache ryan:oeteHNuwJnH7k ``` -------------------------------- ### Example Virtual Host Path Source: https://docs.gandi.net/en/web_hosting/tutorials/filezilla.html This is an example of the directory structure where public website files should be placed within your web hosting environment. ```path /lamp0/web/vhosts/www.example.com/htdocs/ ``` -------------------------------- ### Enable and Start Etherpad-Lite Service Source: https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html Reloads the systemd daemon to recognize the new service file and enables the Etherpad-Lite service to start automatically on system boot. It then starts the service immediately. ```bash # systemctl daemon-reload # systemctl enable etherpad-lite ``` -------------------------------- ### Install Mumble Server Package Source: https://docs.gandi.net/en/cloud/tutorials/mumble.html Installs the Mumble server package from Ubuntu repositories. Requires root privileges. ```bash $ sudo apt-get install mumble-server ``` -------------------------------- ### Install Composer Source: https://docs.gandi.net/en/web_hosting/advanced_configurations/composer.html Download the Composer executable to the root of your site/vhost directory. You can verify the installation by running `php composer.phar`. ```bash php composer.phar ``` -------------------------------- ### Run Custom Start Command in package.json Source: https://docs.gandi.net/en/web_hosting/languages/nodejs.html Define a custom command to start your Node.js application using the 'scripts.start' field in package.json. This allows for more complex startup procedures. ```json { "name" : "foo", "version" : "1.2.3", "description" : "A packaged foo fooer for fooing foos", "scripts": { "start": "node index.js" } } ``` -------------------------------- ### Create and Push Repository for PHP Hosting Source: https://docs.gandi.net/en/web_hosting/connection/git.html This example demonstrates initializing a local Git repository, adding a remote for your PHP web hosting, and pushing your code. Remember to place web-accessible files in the `htdocs/` directory. ```bash $ mkdir example.com $ cd example.com $ git init $ git remote add gandi $GIT_URL/example.com.git $ mkdir htdocs $ echo "Hello world" > htdocs/index.html $ git add htdocs $ git commit -m "first version of index.html" $ git push gandi main ``` -------------------------------- ### List Available VPS Flavors Source: https://docs.gandi.net/en/cloud/vps/resource_management/index.html Use this command to see all the available resource configurations (flavors) for your VPS. Note the ID of the flavor you want to apply. ```bash openstack flavor list ``` -------------------------------- ### Update System Packages and Install cURL Source: https://docs.gandi.net/en/cloud/vps/tutorials/code_install.html Run this command to update your system's package list and installed packages, and ensure cURL is installed. ```bash apt update && sudo apt upgrade -y && sudo apt install curl -y ``` -------------------------------- ### Apply Hostname Change Source: https://docs.gandi.net/en/cloud/vps/tutorials/code_install.html Apply the new hostname immediately. Replace 'code.example.com' with your actual domain. ```bash hostname code.example.com ``` -------------------------------- ### Install Dependencies with Composer Source: https://docs.gandi.net/en/web_hosting/advanced_configurations/composer.html Run this command in your terminal to install the dependencies declared in `composer.json`. Composer will create a `vendor` folder containing the installed libraries and a `composer.lock` file with exact version information. ```bash php composer.phar install ``` -------------------------------- ### Deploy Website Code with Git Source: https://docs.gandi.net/en/web_hosting/tutorials/migration.html Use these Git commands to initialize a new repository, add a remote for your new hosting, commit your code, and push it for deployment. ```bash $ git init $ git remote add new ssh + git://{login}@git.dc2.gpaas.net/{vhost}.git $ git add htdocs $ git commit htdocs $ git push new master $ ssh {login}@git.dc2.gpaas.net 'deploy {vhost} .git' ``` -------------------------------- ### Install CODE Packages Source: https://docs.gandi.net/en/cloud/vps/tutorials/code_install.html Update package lists and install the 'coolwsd' and 'code-brand' packages. ```bash apt update && apt install coolwsd code-brand ``` -------------------------------- ### Deploy Code to Web Hosting Source: https://docs.gandi.net/en/web_hosting/connection/git.html Deploy your code to the web hosting by checking out the repository and installing dependencies. Specify a branch if not deploying 'master'. ```bash $ ssh {web_hosting_id}@git.{datacenter_id}.gpaas.net 'deploy {repository}.git' ``` ```bash $ ssh {web_hosting_id}@git.{datacenter_id}.gpaas.net 'deploy {repository}.git production' ``` -------------------------------- ### List Available Server Flavors Source: https://docs.gandi.net/en/cloud/vps/api/index.html Displays a list of available server configurations, specifying the CPU and RAM combinations for your virtual machines. ```bash $ openstack flavor list ``` -------------------------------- ### Download Etherpad-Lite Source: https://docs.gandi.net/en/cloud/tutorials/etherpad_lite.html Switches to the 'etherpad' user's home directory and clones the Etherpad-Lite repository from GitHub. ```bash # su - etherpad $ cd $ git clone https://github.com/ether/etherpad-lite.git ``` -------------------------------- ### Example SOA Record Response Source: https://docs.gandi.net/en/domain_names/advanced_users/secondary_nameserver.html An example of the ANSWER SECTION from a 'dig SOA' query, highlighting the serial number. ```dns ;; ANSWER SECTION: example.com. 604800 IN SOA s1.example.com. kermit.s1.example.com. 2019012319 86400 21600 604800 60 ``` -------------------------------- ### Executing Post-Install Scripts (package.json) Source: https://docs.gandi.net/en/web_hosting/languages/nodejs.html Use the `postinstall` npm script to run build commands after dependency installation. Conditionally execute commands based on the `$GANDI` environment variable. ```json { "scripts": { "postinstall": "[ -z \"$GANDI\" ] || NODE_ENV=production npm run build" } } ``` -------------------------------- ### Example of a Payment Rejection Notification Source: https://docs.gandi.net/en/billing/faq/index.html This is an example of an automated cancellation email received when a payment is rejected. Contact support for assistance. ```text Our payment system has rejected your payment, and we are unable to complete your order 1234567. Consequently, the order has been canceled, and your account has not been debited. (...) ``` -------------------------------- ### Initialize Terraform Source: https://docs.gandi.net/en/cloud/vps/tutorials/terraform_server_creation.html Initializes the Terraform working directory, downloading necessary providers. ```bash terraform init ``` -------------------------------- ### Get Billing Information Source: https://docs.gandi.net/en/rest_api/migration_from_v3/direct_customers/index.html Retrieves the billing information for your personal organization's prepaid account. This is a simple GET request. ```APIDOC ## GET /v5/billing/info ### Description Fetches the current billing information, including prepaid account balance, for the authenticated user's personal organization. ### Method GET ### Endpoint /v5/billing/info ### Parameters (No parameters required, authentication is via API key in header) ### Request Example (No request body needed) ### Response #### Success Response (200) (Details not provided in source) #### Response Example (Details not provided in source) ``` -------------------------------- ### Create and Push a New Repository Source: https://docs.gandi.net/en/web_hosting/connection/git.html Initialize a new Git repository, add a file, commit changes, and push to a remote repository on your web hosting. ```bash $ mkdir myapp $ cd myapp $ git init $ git remote add gandi $GIT_URL/default.git $ echo "Creating my repository" > test.txt $ git add test.txt $ git commit -m "Add a text file" $ git push gandi main ``` -------------------------------- ### Apache Server Start Logs Source: https://docs.gandi.net/en/web_hosting/languages/php.html These log entries indicate that the Apache web server has successfully started and is resuming normal operations. ```log [Thu Jun 14 12:08:45.199853 2012] [mpm_event:notice] [pid 186:tid 3557842618176] AH00489: Apache/2.4.1 (Unix) configured -- resuming normal operations [Thu Jun 14 12:08:45.199869 2012] [core:notice] [pid 186:tid 3557842618176] AH00094: Command line: '/usr/sbin/apache2 -d /srv/data/.config/apache -f /srv/data/.config/apache/apache2.conf -D lamp0-1' [Thu Jun 14 15:08:45.213486 2012] [mpm_event:notice] [pid 186:tid ``` -------------------------------- ### Example Site Directory Path in PHP Source: https://docs.gandi.net/en/web_hosting/languages/php.html This is an example of an absolute path to a Site's htdocs directory on Gandi Web Hosting. ```plaintext /lamp0/web/vhosts/www.yourdomainname.com/htdocs/ ``` -------------------------------- ### Generate Let's Encrypt SSL Certificate Source: https://docs.gandi.net/en/cloud/vps/tutorials/code_install.html Use Certbot to obtain an SSL certificate for your domain. Replace 'code.example.com' with your domain. Choose option 2 for webroot and specify '/var/www/html' as the root folder. ```bash certbot certonly -d code.example.com ``` -------------------------------- ### Set Hostname for CODE Server Source: https://docs.gandi.net/en/cloud/vps/tutorials/code_install.html Set the system's hostname to your desired domain name for the CODE server. Replace 'code.example.net' with your actual domain. ```bash echo code.example.net > /etc/hostname ``` -------------------------------- ### PostgreSQL Connection URL Example Source: https://docs.gandi.net/en/web_hosting/database_management/postgresql.html An example of a connection URL for PostgreSQL, useful for configuring applications or clients that support URL-based connections. ```text tcp://hosting-db@localhost/postgres ``` -------------------------------- ### Configure an A Record for the Bare Domain Source: https://docs.gandi.net/en/domain_names/faq/record_types/a_record.html Use this record to point your bare domain (e.g., example.com) to an IPv4 address. Replace 123.123.123.123 with your actual IP address. ```dns @ 10800 IN A 123.123.123.123 ``` -------------------------------- ### Example Domain Contact Information Response Source: https://docs.gandi.net/en/rest_api/migration_from_v3/resellers/index.html This is an example of the JSON response structure when retrieving contact information for a domain, showing details for the 'admin' contact. ```json { "admin": { "city": "Paris", "given": "Alice", "family": "Doe", "zip": "75001", "extra_parameters": {}, "country": "FR", "streetaddr": "5 rue neuve", "data_obfuscated": true, "mail_obfuscated": true, "phone": "+33.123456789", "same_as_owner": true, "state": "FR-IDF", "type": "individual", "email": "alice@example.org" }, } ``` -------------------------------- ### Install Certbot for Let's Encrypt Certificates Source: https://docs.gandi.net/en/cloud/vps/tutorials/code_install.html Install Certbot, a tool used to automatically fetch and deploy SSL certificates from Let's Encrypt. ```bash apt install certbot ``` -------------------------------- ### Enable Mattermost Service on Boot Source: https://docs.gandi.net/en/cloud/tutorials/mattermost.html Enable the Mattermost service to ensure it automatically starts when the server boots up. ```bash systemctl enable mattermost.service ```