Getting started with a POWER web hosting plan
Find out how to get started with a POWER Web Hosting plan
Find out how to get started with a POWER Web Hosting plan
Last updated 4th February 2021
You've subscribed to a Web POWER web hosting plan to deploy Node.js, Python or Ruby applications, and you want to begin developing your project.
This guide will explain how to manage your POWER web hosting using the OVHcloud Control Panel and the OVHcloud APIs.
Find out how to get started with a POWER web hosting plan.
The POWER web hosting management UI is in the Web Cloud
section, under Hosting plans
in the sidebar.
At the activation of your POWER web hosting plan, we have sent you an email with the SSH and FTP credentials. You can also manage them from the FTP - SSH
tab.
You will find detailed information on this topic in our SSH guide.
For default, your POWER web hosting plan is attached to a generated URL. In order to use your own domain name, you can add it in the Multisite
tab.
You will find detailed information on this topic in our Hosting multiple websites on your Web Hosting plan guide.
Your POWER web hosting plan includes databases. They can be accessed from the Databases
tab.
You will find detailed information on this topic in our Creating and managing a database in your Web Hosting plan guide.
Web server logs and website statistics are included in your POWER web hosting plan,under the Statistics and logs
tab.
You will find detailed information on this topic in our Accessing a website’s logs and statistics on a Web Hosting guide.
Let's suppose you have the default configuration for Node.js hosting:
To verify your configuration, you can use the Retrieve active configuration API endpoint.
Connect via SSH to your POWER web hosting, go to the www
folder and create an index.js
file there:
index.js
const http = require('http');
const port = 3000;
const msg = `Hello World from NodeJS ${process.version}\n`;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end(msg);
});
server.listen(port);
~ $ vi www/index.js
const http = require('http');
const port = 3000;
const msg = `Hello World from NodeJS ${process.version}\n`;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end(msg);
});
server.listen(port);
~ $ mkdir -p www/tmp
~ $ touch www/tmp/restart.txt
Then restart your instance.
Let's suppose you have the default configuration for Python hosting:
To verify your configuration, you can use the Retrieve active configuration API endpoint.
Connect via SSH to your POWER web hosting, go to the www
folder and create an app.py
file there:
app.py
import sys
def application(environ, start_response):
status = '200 OK'
output = '\n'.join(['Hello World!', f"Version : {sys.version}",
f"Executable : {sys.executable}"])
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
Then restart your instance.
Let's suppose you have the default configuration for Ruby hosting:
To verify your configuration, you can use the Retrieve active configuration API endpoint.
Connect via SSH to your POWER web hosting, go to the www
folder and create a config.ru
file there:
config.ru
require 'socket'
require 'timeout'
class Application
def call(env)
msg = "Hello World from ruby #{ RUBY_VERSION }p#{ RUBY_PATCHLEVEL }"
[200, { "Content-Type" => "text/plain" }, [msg]]
end
end
run Application.new
Then restart your instance.
This tutorial presupposes that you already have some familiarity with the OVHcloud APIs. If you want to know more on this topic, please look at the First Steps with the OVHcloud APIs guide.
The OVHcloud APIs currently available for POWER hosting plans are:
This endpoint allows you to modify your configuration parameters, for example your entry point.
You can create an .htaccess
file in your POWER web hosting root folder (usually www
) to set up a redirection from HTTP to HTTPS:
RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
~ $ cd www
~/www $ vi .htaccess
RewriteCond %{ENV:HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Each time you modify your application, you should tell the server to restart it.
In your document root you should touch
the file tmp/restart.txt
.
~ $ cd www
~/www$ mkdir tmp
~/www$ touch tmp/restart.txt
As this operation is performed on SSH server, you may need to wait before the web server notices your changes (max. 30 seconds).
Accessing a web web hosting plan via SSH
Hosting multiple websites on your Web Hosting plan
Creating and managing a database in your Web Hosting plan
Accessing a website’s logs and statistics on a Web Hosting
Join our community of users on https://community.ovh.com/en/.
Join our Gitter room to discuss directly with the POWER Web Hosting team and the other users of this lab.
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community