Having a web presence allows you to interact with your users, customers and audience from anywhere in the world. It is getting increasingly easier to host a website and there are a wide range of free resources on the Internet available for people with varying technical skills to create multiple websites.
Virtual Hosting is a web server technique that provides the capability to host multiple domains (websites) on one physical host, offering a cost-effective solution for those who need to do so.
This article will show you how to set up multiple websites on a QNAP NAS by using virtual hosting.
In this tutorial we will use the information provided in the following table as a reference guide.
|Host name||WAN/LAN IP & port||Document root||Demo web application|
WAN IP: 111.222.333.444
LAN IP: 10.8.12.45 (NAS)
Port: 80 (NAS)
Preparation before starting
The host name must point to the WAN IP of your NAS. You can normally configure this from your DNS service provider. For more information about DNS setting, please refer to Set up a DDNS Service for Remote Internet Access to a QNAP Turbo NAS
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. For more information about port forwarding via NAS, please refer to Accessing your QNAP NAS with myQNAPcloud Service
SSL certificate import
If you are going to enable SSL connections for the website and intend to use your own SSL certificates, you can import the certificate from "Control Panel" > "Security" > "Certificate and Private Key".
You can also buy SSL certificates from myQNAPcloud. For more information, please refer to How to purchase and use myQNAPcloud SSL certificates?
Activate the Web Server and Configure Virtual Hosting
1. Log into QTS, go to "Control Panel" > "Applications" > "Web Server", then in the "Web Server" page, tick "Enable Web Server".
- If you want to connect using secure connection, tick "Enable secure connection (HTTPS)".
2. Go to the "Virtual Host" page, tick "Enable Virtual Host" then click "Apply". You can then click "Create a Virtual Host" to establish the connection.
3. Enter the required information (Host name, Folder name, Protocol and Port) and click "Apply". The "Host Name" will point to the website that is stored in the mapping folder.
- You must create folders under "Web" before choosing a "Folder Name".
4. After completing these settings, you can upload web data to the NAS.
In this example, we put Joomla files into "/Web/site1_mysite", WordPress files into "/Web/site2_mysite" and phpBB3 files into "/Web/www_mysite2".
5. After uploading, you can visit the websites by entering the following URLs:
You should see the Joomla!, WordPress and phpBB3 web pages respectively. Additional setup options including enabling SSL connections or choosing another port number.
- If the port forwarding on your router is not port 80, you have to add the port number after the URL to connect to the website.