Host Multiple Websites on QNAP NAS by the Virtual Host Feature

Today, having a web presence to allow your users, customers or audience from anywhere in the world to interact with you or your company via the World Wide Web is essential. Hosting a website is not as difficult as before and with plenty of free resources on the Internet, setting up multiple website are not limited to the professionals and can be only a few clicks away.

Virtual Host is a web server technique that provides the capability to host more than one domain (website) on one physical host offers a cost-effective solution for personal and small business with such need.

QNAP NAS supports virtual hosting and this article will show you how to set up multiple websites on QNAP NAS by using virtual host. Read on.

In this tutorial we will use the information provided in the table below as the reference guide.

Host name WAN/LAN IP & port Document root Demo web application
site1.mysite.com WAN IP: 111.222.333.444
LAN IP: 10.8.12.45 (NAS)
Port: 80 (NAS)
/Web/site1_mysite Joomla!
site2.mysite.com /Web/site2_mysite WordPress
www.mysite2.com /Web/www_mysite2 phpBB3

Before you start

Before you start, please make sure you have checked the following items:

DNS records

The host name must point to the WAN IP of your NAS and you can normally configure this from your DNS service providers.

Port forwarding

If the web server listens on port 80 you need to configure port forwarding on your router to allow inbound traffic from port 80 to the LAN IP (10.8.12.45) of your NAS.

SSL certificate import

If you are going to enable SSL connection for the website and intend to use your own trusted SSL certificates you may import the certificate from within the administration backend under 'System Administration' > 'Security' > 'Import SSL Secure Certificate'.

Activate the Web Server and Configure the Virtual Host Function

Login the administration page and then go to 'Network Services' > 'Web Server'. Check the box 'Enable Web server' and click 'Apply'.

Next go to the 'Virtual Host' tab and check the box 'Enable Virtual Host' and click 'Apply'.

Click 'Create New Virtual Host' to start the wizard and enter the required information (Host name, Folder name, Protocol and Port) then click 'Apply'.



Continue to enter the information for the rest of the sites you wish to host on the NAS.

Upload the Website Data to the NAS

So far we have NAS configured to host multiple websites and next we are going to upload the files for each website by mapping the Web (or Qweb) share folder to your desktop.

Once the 'Web' share folder is mapped create a folder for each website (site1_mysite, site2_mysite and www_mysite2) and start transferring the website files to the corresponding folders we created.

Once the files transfers complete point your web browser to the websites by entering the following URL:

http://site1.mysite.com
http://site2.mysite.com
http://www.mysite2.com

You should see the Joomla!, phpBB3 and WordPress web pages respectively. Additional setup options including enabling SSL connections or choose another port number other than port 80.