Web Server
Using the TerraMaster Web Server, you can set up your TNAS as a website server. Through the graphical interface of the Web Server, you can configure multiple virtual hosts, PHP, webpage data storage paths, and network protocols, providing convenience for website maintenance and management.
Settings
Managing TNAS as a Web Server
You can enable and manage the Web Server with ease. In the settings page, you can modify the following Web Server settings:
Root Directory: Select the root directory for the Web server's websites to provide access to external users. PHP Version: Choose the PHP version for scripting language support on the server. HTTP Port: Specify the port number for HTTP access to the Web server (default: 8808). HTTPS Port: Specify the port number for HTTPS access to the Web server (default: 477).
During installation, a default "www" shared folder is created to store website files. To use another shared folder for the website server, modify permissions in the User Groups module of the control panel under the "media" user group.
Setting Up TNAS as a Web Server
- Open "Web Server" and navigate to "Settings" in the left panel.
- Check "Enable Web Server" and configure "Root Directory," "PHP Version," "HTTP Port," and "HTTPS Port."
- Click "Apply" to save the settings.
- When accessing the web server via HTTP, use the following format: http://Web Server IP Address:Port Number (e.g., http://10.18.8.183:8808). Directly entering http://Web Server IP Address will not work.
- For HTTPS access, use: https://Web Server IP Address:Port Number (e.g., https://10.18.8.183:477). Ensure to replace 477 with your configured HTTPS port number.
Virtual Hosting
Virtual hosting enables multiple websites to operate on a single web server, offering services such as Web, FTP, Mail, and more. Once the web server is enabled, users can configure multiple virtual hosts within it. Each virtual host shares the same IP address (the TNAS device's IP address) but uses different port numbers. Each port number corresponds to a specific virtual host, directing users to different websites when accessed via different port numbers.
Managing Virtual Hosts
On the virtual host management page, you can perform the following actions:
- Add: Create a new virtual host.
- Edit: Modify settings for the selected virtual host.
- Stop/Enable: Disable or enable the selected virtual host.
- Delete: Remove the selected virtual host.
Setting Up Multiple Virtual Hosts on the Web Server
- Open "Web Server" and navigate to the "Virtual Host" section in the left panel.
- Click the "Create" icon in the toolbar to open the "Add Virtual Host" popup window.
- Customize the following settings for the virtual host:
- Subfolder: Specify the directory path for the virtual host.
- PHP Version: Choose the version of PHP for the virtual host.
- Host Name: Enter the host name for the virtual host.
- Port: Assign a unique port number for the virtual host.
- Protocol: Select the protocol (HTTP or HTTPS) for the virtual host.
- Click "Apply" to save the settings. A confirmation message "Settings Successful" will appear, indicating the virtual host setup is complete.
When accessing a virtual host via HTTP:
- When users access a virtual host on the web server using HTTP, the access address will be: http://Web Server IP Address:Virtual Host Port Number (e.g., http://10.18.8.183:8080). Directly entering http://Web Server IP Address will not work.
- When users access a virtual host on the web server using HTTPS, the access address will be: https://Web Server IP Address:Virtual Host Port Number (e.g., https://10.18.8.183:8443). Directly entering https://Web Server IP Address will not work.
PHP
Managing PHP
On the PHP page, you can perform the following actions with PHP:
- Create: Create a PHP instance.
- Edit: Edit the selected PHP instance.
- Delete: Delete the selected PHP instance.
How to Create PHP
- Open "WEB Server" and navigate to the PHP section in the left panel.
- Click the "Create" icon in the toolbar, and the "Add PHP" popup window will appear.
- Edit the basic PHP settings, including Name, Description, and Version.
- Select options such as "Enable PHP Cache," "Enable Xdebug," and "Enable display_errors to show PHP error messages." Enter the directory tree where PHP can open files. Check the desired "Extension Names."
- Click "Apply" to confirm the settings and complete the creation of the PHP instance.