Getting Started
Once you've installed the Bytemark virtual hosting packages you're ready to begin hosting your websites with it.
In this brief tutorial we'll configure a system to host three different websites:
- example.com
- example.net
- example.org
The three sites will each be configured to host a website, with FTP access for uploading, and the last domain will also have email configured.
Requirements
To follow this guide with your own domains you'll need to SSH into you machine as the user admin, and you'll need to have configured DNS so that the IP address for your domains points to the IP address of your machine.
(The admin user is created when the bytemark-vhost meta-package is installed, and will have the same password as your root account.)
Configuring Webhosting
To configure a new website for your domain is a simple matter of creating a new directory upon your system.
All the websites will live beneath the /srv/ directory, and we'll create our three sites by running these commands:
admin@skxtrial:~$ mkdir -p /srv/example.com/public/htdocs admin@skxtrial:~$ mkdir -p /srv/example.net/public/htdocs admin@skxtrial:~$ mkdir -p /srv/example.org/public/htdocs
As soon as you've executed these commands you should be able to point your browser at http://example.com/ and see a default page - indicating that things worked. If you don't see this page then please consult our FAQ.
Configuring FTP Access
To configure FTP access we just need to specify a password for each site, and wait for it to propagate.
Setting a password involves creating a text file and storing the password within it, for example the following three commands may be used to setup passwords for our three virtual hosts:
admin@skxtrial:~$ mkdir -p /srv/example.com/config/ admin@skxtrial:/$ echo 'password1' > /srv/example.com/config/ftp-password admin@skxtrial:~$ mkdir -p /srv/example.net/config/ admin@skxtrial:~$ echo 'password2' > /srv/example.net/config/ftp-password admin@skxtrial:~$ mkdir -p /srv/example.org/config/ admin@skxtrial:~$ echo 'password3' > /srv/example.org/config/ftp-password
Passwords are updated once every minute, and once updated you should find you may FTP to your server with the following details:
| Username | Password |
| example.com | password1 |
| example.net | password2 |
| example.org | password3 |
(You may run /usr/sbin/setup-ftp-accounts to trigger an immediate rebuild of the password database.)
Once you have FTP access configured you should be able to upload your website contents!
Email Hosting
The final step in our simple guide is to configure the email handling for example.org. To create a mailbox for jimbo@example.org we create a directory for the email to be delivered to, then then set his password by creating a text file in his mailbox with the chosen password inside it.
admin@skxtrial:~$ mkdir -p /srv/example.org/mailboxes/jimbo admin@skxtrial:~$ echo 'password4' > /srv/example.org/mailboxes/jimbo/password
This would then cause email to be accepted for jimbo@example.org, and allow the user to collect it using secure IMAP or POP3 protocols, with his email address as the username and 'password4' as his password. He can also use the server to send email for him over SMTP using the same username and password.
To enable rejection of spam email and emails that contain viruses, we create two files inside the config directory for the domain. For example, to enable both services for example.org, we could do the following.
admin@skxtrial:~$ mkdir -p /srv/example.org/config admin@skxtrial:~$ touch /srv/example.org/config/antispam admin@skxtrial:~$ touch /srv/example.org/config/antivirus
For more detail about setting up mail for virtual hosts in this way, please see the dedicated Getting Started With Email Guide.
