Host your website

Here is a summary of the steps to follow if you want to host a web page or web application on a MaadiX server:

  1. On the MaadiX Control Panel, create a regular account with SFTP access (or SFTP and SSH access) to be the webmaster of the site.

  2. On the MaadiX Control Panel, add the domain or sub-domain and assign the previously created account as webmaster.

  3. Connect to the server with the webmaster account to upload the web files to the /var/www/html/ejemplo.com directory.

  4. In your domain provider’s DNS zone editor, add an A record that points the domain or sub-domain to the server’s IP (external operation to MaadiX).

  5. Wait until the server detects that the DNS is pointing to the server (this may take a few minutes)

  6. On the MaadiX Control Panel, activate the web server for the domain: “Edit domain” > “Activate web server” (it takes a few seconds to activate).

Below you can find a more detailed explanation of each step. The order of the steps can be changed according to your needs.

Remember that you can host as many websites as you want, there is no limit to the number of domains, you just have to have enough space and resources on the server.

Your webmaster account

The first thing you need to manage a website on a MaadiX server is a regular account with SFTP access (or SFTP and SSH access) to act as webmaster.

Remember that the Superuser account cannot be assigned as a webmaster.

This functionality is designed so that the person who develops and updates a website has their own account and limited permissions, only those necessary to upload the files that make up the website. They will not be able to make other modifications in the server.

This is useful for organizations where the person who manages the server is different from the person who develops the website.

To create a regular account you have to go to the control panel, to the section ‘Users’ > ‘Regular accounts’ and click on the ‘Create new account’ button.

For a regular account to be assigned as webmaster it must have SFTP access, or SFTP and SSH access. You can choose this when creating the account, in the ‘SSH or SFTP access to the server’ section.

The same account can be assigned as webmaster for several domains.

In case your website or web application uses databases (such as Wordpress), it is probably useful to activate phpMyAdmin access to this account (you can see more details here).

Adding the domain to MaadiX

To add your domain or subdomain, go to the Control Panel, to the ‘Domains’ > ‘Add a new domain’ section, and assign the regular account created previously as webmaster, selecting it from the drop-down menu. You can edit it later if you need to.

All the details of this form, including the checkbox for activating the web server, are explained on the Domains page.

In addition, when a domain is added to the Control Panel, the /var/www/html/example.com directory is created on the server, even if the web server is still disabled (that is, the Apache virtual host and Let’s Encrypt certificates have not yet been created). This is useful for planning migrations and uploading the files that compose the web before changing the DNS.

Note: in case you do not have your own domain name, you can use subdomain.maadix.org, where ‘subdomain’ coincides with the name you chose when you purchased your MaadiX server. In this case, you have to upload the web files to /var/www/html/subdomain.maadix.org with the Superuser account.

Upload content

Once you have added the domain, you will have to upload the files of your website or application to the directory /var/www/html/example.com.

You can access this location with your assigned webmaster account and upload the files using an SFTP client. In case you don’t have an SFTP client installed and you don’t know which one to choose, Filezilla is one of the most used and simple ones.

Remember that, for security reasons, FTP connections are not allowed on MaadiX servers, only SFTP.

The section to follow depends on the type of access you gave your webmaster account when creating it (SFTP or SFTP+SSH); if you are not sure, you can check it in ‘Users’ > ‘Regular accounts’.

With an SFTP account

This will be the case when you have assigned as webmaster an account that is only authorized by SFTP. SFTP accounts will only have access by SFTP and not by terminal (by SSH).

This account will be the owner of the /var/www/html/ejemplo.com folder, so only by connecting to this account you will be able to modify the files in it.

The login details for the connection using Filezilla (or another SFTP client), will be the following:

  • Server: sftp://subdomain.maadix.org

  • Protocol: SFTP (remember to specify).

  • User name: Webmaster name account.

  • Password: the password of the Webmaster account.

  • Port: by default will be port 22 (see more in the security section).

Screenshot

SFTP client (access with a SFTP account).

When the connection is established from an SFTP account you will see a folder with its name. Within this folder you will find a folder with the name of the domain or sub-domain (which is a symbolic link to /var/www/html/example.com). There may be several folders if this account is a Webmaster for other domains.

You can also have other files of your own that you have uploaded or created previously. Webmaster accounts only have access to this area and not to all system files (as the Superuser account does).

In the domain folder (for example /your_account_name/example.com) is where you will have to upload the files that make up the website or web application. This can be done easily by dragging the files from your local computer.

Note: if you make too many failed connection attempts (more than 6) with an SFTP client the server will block the IP of your connection (from your office or home). Find more information here.

With an SSH account

This will be the case when you have assigned as a webmaster an account that has access via SFTP and SSH. This account will be able to access the server both by terminal (via SSH) and by using an SFTP client.

The way to access via SFTP is similar to the one described in the previous section, but in this case the location where you land when the connection is established is different. These accounts have their own directory in /home/USERNAME and unlike SFTP accounts they are not caged in it. They can access other directories and perform read/write operations on files they own.

You will have to navigate through the folders until you reach /var/www/html/example.com/, which is where you will have to upload or create the files of your new website or application. Another faster option is to type the path /var/www/html/example.com/ in the ‘Remote Site’ field.

Once there, you can follow the same steps described for SFTP accounts.

Screenshot

SFTP client (access with a SSH account).

Point the domain to the server

In order to create a website accessible from any browser you will need a domain or sub-domain that you will have to register with a provider (for example, gandi.net or Njal.la, on the Internet you can find many more).

Once you have your domain, you will have to add an A-type DNS record that points to your server’s IP. This is an operation external to MaadiX: it is done from your domain provider’s DNS zone editor, since MaadiX is not a domain provider and does not offer a DNS zone editor.

You can find your server’s IP, configuration examples, and how to check that the record has propagated correctly on the DNS page.

Activate the web server and the SSL certificate

Adding the domain does not activate the web server automatically: you always have to edit the domain and explicitly check the “Activate Web Server” box (it takes a few seconds to activate). If the DNS is not yet pointing correctly to your server, activation will fail.

Screenshot

Enabling the web server.

When activated, in addition to the virtual host, an SSL certificate is automatically generated and configured with Let’s Encrypt for the domain, with nothing further needed on your part: connections to your website will be made over https. You can find more details about this process on the Domains page.