Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
This guide explains how to replace, within an Infomaniak Web hosting, the address of a site currently a subdomain (https://dev.domain.xyz
for example) with the main domain (https://domain.xyz
).
Preamble
- The operations in brief:
- We start with a site created and accessible via the URL of the main domain
dev.domain.xyz
. - We add an alias
domain.xyz
. - We swap the two types (the main domain becomes an alias and the alias becomes the main domain).
- We remove the old name
dev.domain.xyz
.
- We start with a site created and accessible via the URL of the main domain
- Note that the site remains in the original folder on the server; the name of this location may be in the form
/sites/dev.domain.xyz
but this has absolutely no impact on the live site. - Also, familiarize yourself with the last chapter of this other guide.
The operations in detail
To switch from a site with a subdomain address "dev.domain.xyz
" to a direct address "domain.xyz
":
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on the chevron ‍ to expand the Domains section of this site:
- Click on the button Add a domain:
- Add the desired new name, check the corresponding boxes.
- Click on the button to Confirm:
- Once the addition is complete, click on the action menu â‹® located to the right of the relevant item.
- Choose to set the item as the primary domain:
- Confirm the operation to proceed with the domain swap.
This guide provides instructions to synchronize kDrive with a VPS (or vice versa) via the WebDAV
protocol found in the rClone application.
COMPATIBILITY my kSuite ✗‍ | my kSuite+ ✗‍ ✔‍= Compatible offer | ✗‍= Not available |
Prerequisites
- Have a VPS.
- Know your kDrive identifier (kDrive ID).
Synchronize kDrive and VPS via rClone
The operation allows you to retrieve in real-time the files and folders from kDrive and to read, create or modify these files from your VPS while ensuring that they are synchronized again on the kDrive server. An rClone mount point can be created with a folder on your VPS to manipulate these kDrive files.
Refer to the rClone documentation if you are looking for information about the available options:
- Example of rClone command:
rclone mount kdrive:/My_kDrive_Folder_Path /home/ubuntu/Target_Folder_Path --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --cache-dir /home/ubuntu/rclone/cache --daemon --allow-other --dir-cache-time 1h --log-file /home/ubuntu/rclone/rclone.log --log-level INFO
- The
--daemon
attribute of this command allows you to start the synchronization in the background because without it, this sync ends with each disconnection of the VPS…
- Example of an rClone configuration file:
[kdrive] type = webdav url = https://***.connect.kdrive.infomaniak.com/*** vendor = other user = *** pass = ***
- Server address:
https://IDkDrive.connect.kdrive.infomaniak.com
(see the prerequisites above) - Username: email address to log in to the Infomaniak user account
- Password: application password if two-factor authentication is enabled or ‍your Infomaniak user account password if you have not enabled 2FA
This guide explains how to install and configure systemd
on a Serveur Cloud and presents the main commands that can be used.
⚠️ For additional help contact a partner or launch a free tender — also discover the role of the host.
Prerequisites
- Follow the installation guide for
systemd
on Serveur Cloud. - Consult the official documentation to learn about all the possibilities offered by systemd
- The "unit" files must be placed in:
~/.config/systemd/user/ (/home/clients/absolute-path-id/.config/systemd/user)
(replacing absolute-path-id visible in your Manager) and the permissions must be set to 0644. - The
--user
parameter must be specified in each command.
Main commands
Here is a non-exhaustive list of commands that can be used with systemd
.
Force systemd
to reload the unit files and take the changes into account:
systemctl --user daemon-reload
Activating a service:
systemctl --user enable --now SERVICENAME.service
Checking the status of a service:
systemctl --user status SERVICENAME.service
Configuration of Node as a service with systemd
It will be necessary to create a "Unit" file with the ".service" extension, which will need to be saved in the directory:
~/.config/systemd/user/
It is possible to reuse the example below by replacing the values starting with {}:
[Unit]
Description={Le nom du service} # Spécifier ici un nom du service. Celui-ci est obligatoire mais n'a pas d'impact sur le fonctionnement
[Service]
Restart=always
Environment=NODE_VERSION={la version souhaitée} # Spécifier ici la version de Node à utiliser. S'assurer qu'elle soit installée au préalable avec "nvm install {la version souhaitée}"
WorkingDirectory=%h/{repertoire du projet Node} # %h correspond à la racine de l'hébergement
ExecStart=/bin/bash -c "exec $HOME/.nvm/nvm-exec {commande de lancement du script node}" # Cette commande dépend du projet. Par exemple, "npm run start", "npm run serve" ou encore "node server.js" sont courants
[Install]
WantedBy=default.target
Additional actions with a Unit file
systemctl --user daemon-reload
Start the service (if it is already active, nothing happens):
systemctl --user start [Nom du Unit]
Stop the service (if it is not active, nothing happens):
systemctl --user stop [Nom du Unit]
Restart the service (if it is not running, it will be started):
systemctl --user restart [Nom du Unit]
Get information about the service; namely:
- "Active" which indicates whether the service is running and for how long
- "CGroup" shows the process group managed by the service, this allows you to see the active processes, with their arguments and their ID
Below "CGroup" are any logs (the standard output and error of the process):
systemctl --user status [Nom du Unit]
Enable automatic startup of the service at server boot; NB: this does not start the service:
systemctl --user enable [Nom du Unit]
Disable the automatic startup of the service at server boot; NB: this does not stop the service:
systemctl --user disable [Nom du Unit]
Configuration with user entries:
[Unit]
Description="nom service"
[Service]
Restart=always
Environment=NODE_VERSION=16.17
WorkingDirectory=%h/sites/"nom-repertoire-site"/
ExecStart=/bin/bash -c "exec $HOME/.nvm/nvm-exec npm run start"
[Install]
WantedBy=default.target
This guide explains how to enable PHP-FPM status
to, for example, debug a slow site at the PHP level.
Preamble
PHP-FPM status
allows you to monitor in real-time the scripts that are executed as well as their execution time.- This operation is only possible on Serveur Cloud.
Enable PHP-FPM status
To activate PHP-FPM
on a site, contact Infomaniak support from an email address listed on your user account to authenticate your request.
In your request, please specify the source IP address that should be authorized.
Once PHP-FPM status
is activated, the following URL links will display the necessary information:
- https://domain.xyz/fpm-status?json&full
- https://domain.xyz/fpm-status?html&full
- https://domain.xyz/fpm-status?xml&full
Warning: if your site contains rewrite rules including the path /fpm-status
, you will likely need to make an exception for it.
This guide concerns the redirection of web traffic to a specific port, including when using a dedicated IP and a specific web application (such as Node
or Varnish
for example).
Prerequisites
- Add a site to your hosting.
- Install
HAProxy
on the Cloud Server.
Redirect web traffic to a specific port
By default, on Serveur Cloud, web traffic is sent to Apache
. To send requests to a Node
script or another service (provided it "listens" on a port between 4000 and 4009), you need to go through HAProxy
.
This applies notably to servers Express
, Socket.IO
, Meteor.js
, Nuxt.js
, Django
, Flask
, Ruby on Rails
, even possibly Java (J2E)
, etc.
For this, you must ensure that the service is listening on a port between 4000 and 4009 (especially with server.listen(4000)
for Express
or a basic HTTP Node
server, but depending on the type of project by other means, a configuration file, in the code or otherwise) and on all interfaces (0.0.0.0).
It will also be necessary to configure HAProxy
as in the example below:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the relevant product.
- Click on Fast installer in the left sidebar.
- Click on the action menu â‹® located to the right of
HAProxy
. - Click on Configure:
- Choose the desired information and save:
Retrieving the source IP of a request
When you redirect web traffic to your web application, the way requests are processed changes, and the request is first received by a reverse proxy
(local to the server) which then forwards the request to the chosen port. Thus, due to the request forwarding, the methods usually used to retrieve the visitor's IP will return the IP of the reverse proxy
instead of the visitor's.
In these cases, to retrieve the real source IP of the visitor, you need to consult an HTTP header named X-Forwarded-For
, which will contain the source IPs accumulated during each redirection. This header will therefore contain last the original IP address of the client, allowing the real visitor to be identified.
Warning: It is important to note that HTTP headers can be manipulated, which presents security risks. To minimize these risks, it is recommended to verify that the request comes from a reliable server before trusting the content of the X-Forwarded-For
header. This verification may involve ensuring that the request was transmitted by a trusted intermediary server, identified by a pre-established list of IP addresses. In the case where the site uses a dedicated IP, the trusted servers are:
- 83.166.133.15
- 83.166.133.17
- 83.166.133.16
- 84.16.92.5
- 84.16.92.43
- 10.2.32.255
- 10.2.34.164
This guide explains how to reset a VPS Cloud / VPS Lite.
Preamble
- This procedure deletes all the content of the volume dedicated to the operating system (
/dev/vda
). - In the case of a VPS Cloud, the volume dedicated to data storage (
/dev/vdb
) is not affected by the reset.
Warning: depending on the installed operating system, the system volume may be named /dev/sda
, /dev/sda1
or /dev/vda
… same for the data volume /dev/sdb
, /dev/sdb2
or /dev/vdb
… It is therefore necessary to replace these indications with those corresponding to your situation.
Reset the OS VPS Cloud / VPS Lite
To access the VPS:
- Click here to access the management of your product on the Manager Infomaniak (need help?).
- Click directly on the name assigned to the relevant product.
- Click the Reset button.
- Follow the displayed instructions to complete the reset.
This guide explains how to restore a snapshot of VPS Cloud Infomaniak.
Warning: depending on the installed operating system, the system volume may be named /dev/sda
, /dev/sda1
or /dev/vda
; the same applies to the data volume /dev/sdb
, /dev/sdb2
or /dev/vdb
… It is therefore necessary to replace these indications with those corresponding to your situation.
Restore a snapshot
To do this:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Snapshot in the left sidebar.
- Click on the action menu â‹® to the right of the relevant item in the displayed table.
- Click on Restore:
- Click on the blue button to start the snapshot restoration.
- An email is sent when the snapshot is restored.
Restore the operating system disk
Restoring the system volume as shown in the example above is an irreversible operation. The operating system disk will be replaced by the snapshot and the server will be in the exact state of the backup date.
The data stored on the data volume (vdb) is not affected by this operation.
Restore the data disk (vdb)
Two data restoration modes are possible:
1. "Read-only" mode
If the size of the snapshot differs from the size of the volume, only this read-only mode is available.
This option allows you to mount the snapshot data image, enabling read-only access to the backup data.
For your information, here are some useful commands to leverage your backup:
- To access the main data volume:
mount /dev/vdb /mnt/
. - To mount the data volume in a specific "backup" folder:
mount -o nouuid -o ro,norecovery /dev/vdc /backup
.
To find out which letter to use (/dev/vd?), use the command lsblk
:
2. "Restore" mode
Data volume restoration is an irreversible operation. The data disk (vdb) will be replaced by the snapshot. At the end of the restoration, it will be necessary to remount the data volume so that your operating system refreshes the content.
The following procedure and commands are provided for informational purposes only:
- Make sure your data volume is not mounted:
* umount /mnt
(/mnt or the location you chose to access your data). - Remount the data volume:
* mount /dev/(vdb) /mnt
To find out the name of the data volume attached to your server, use the command lsblk
(see above).
Infomaniak does not provide root access on Serveur Cloud.
On the other hand, root access is possible on:
This guide concerns the installation of Python modules, possible on Serveur Cloud.
Installation of Python modules on Serveur Cloud
The installation is done through PIP
, which is a package manager used to install and manage packages written in Python.
Infomaniak offers PIP
and PIP3
through the Fast Installer.
Once PIP is installed, you will be able to install Python modules by specifying --user
in the command.
For example:
pip3 install mysql-connector-python --user
This guide explains how to benefit from new versions of PHP, MySQL and many other packages by migrating a Cloud Server to new Infomaniak infrastructure.
Migration procedure
By migrating your data to the new Cloud infrastructure, you increase the performance and reliability of your sites, which will have access to the latest technologies:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the relevant product.
- Click on the blue button in the "Upgrade your Cloud Server" box (or on Manage):
The migration is free and takes place in 3 steps:
- Infomaniak provides a state-of-the-art Cloud Server with the same characteristics as the current one, at the same price and with the same commitment period.
- You have one month to move your hosting to the new Cloud Server provided (read below).
- When your hosting services have been moved to the new server, cancel the old Cloud Server.
Regarding step 2...
When moving a hosting from one Cloud Server to another:
- FTP access and databases remain unchanged.
- Only the supported versions of PHP and MariaDB, as well as the server's IPv4 and IPv6 addresses, change for the hosting.
- The hostnameshostnames) do not change and are automatically updated to point to the new IP addresses.