How to host a website with Virtualmin

How to host a website with Virtualmin

Assuming you have virtualmin setup on your server, these are the steps required to enable you to host a website

If for some reason you dont have an ubuntu server with virtualmin and you would like one then please read and first.

You should be logged into Virtualmin, and if this is your first time here you should see on the left that it says “No virtual servers created”

The first virtual server that you should create in virtualmin is the one for the server name itself (in this case, karkinos), so click onto “create virtual server”

Fill in the domain name, and I personally prefer a custom username – as follows

There are a lot of advanced options and features available when you expand them. What your own requirements are will depend what you select here.

Advanced Options
Usually we leave these at the defaults

Available Options
We handle DNS externally, so that would be unticked.
We absolutely want a website – so we leave that on, and mail we usually disable (we tend to use exchange hosting separately). If you do disable mail then you must also disable virus,spam filtering and mailman as they rely on the email service.
The webmin login is important if you expect end users to be changing their settings, as opposed to providing a fully managed service.

IP address and forwarding
If you are creating an SSL site then you must setup a network interface (A single IP is required per SSL certificate).
The external ip address might need to be set if you are accepting mail or managing DNS and you are behind a firewall, but for just webhosting it is not as important.

Click create server and you should see the magic

Now we have a virtual server, lets browse to it

Now I could tell you that means it’s working – but just to prove it – lets upload a file using FileZilla (available on all desktop platforms).

The file we are uploading will be index.php (we are going to check php works at the same time) and consists of the following.

<html>
<head>
	<title>Nothing to see here.. move along..</title>
</head>
<body>
	<h1>This is a test page just to see if this site can host php files</h1>
	
	Server Name : <?php echo $_SERVER['SERVER_NAME']; ?> 
</body>
</html>

In filezilla we are going to use the quickconnect box to connect via sftp – so we enter: sftp://karkinos.flashwing.local and our username/password that we created above. We will have to trust the SSH key on the first connection.

The right hand side of filezilla should look like this

drag the index.php file over to the public_html folder and then we browse to the server again in our web browser

And thats it – you can go back and create as many virtual servers as you like now.

No comments yet.

Leave a Reply

Reset all fields