Web Service
On the Web Service page, you can manage all your web services. This article will guide you through the process of creating and managing your web services.
To set up a web service:
- Go to the Web Services page and click Create.
- Select a service type:
- Static website: For simple websites containing static data.
- Native script language website: For dynamic websites built with scripting languages that are supported by Synology's Package Center. You can also select or create a profile for the scripting language.
- Containerized script language website: For dynamic websites built with scripting languages that are supported by Docker Hub.
- Configure the general settings for the website.
- If you selected Containerized script language website as the service type, configure the following settings from this step to step 7. If you selected Static or Native script language website, go to step 7.
- PHP
- Choose the desired extensions.
- Set up FPM settings:
- FPM mode: The method of managing the processes.
- Max processes: The maximum number of child processes.
- Start servers: The number of child processes to start when PHP-FPM starts.
- Min spare servers: The minimum number of idle child processes PHP-FPM creates.
- Max spare servers: The maximum number of idle child processes PHP-FPM creates.
- Python
- Set up uWSGI.
- Process: The number of processes that uWSGI can simultaneously activate.
- Enable threads: Each process contains one thread by default. Enable this option to allow a process to contain multiple threads.
- Max. request count: Processes will restart when the maximum number of requests is reached.
- Buffer size (bytes): The buffer size for the headers of each request.
- Set up uWSGI.
- Node.js
- Set up npm's configuration file. You can upload a package.json file or enter the following information.
- Version: The version of your service.
- Author: The author of your service.
- Main script: The main properties of your package.json.
- License: The license of your service.
- Commands: The script properties of your package.json.
- Set up npm's configuration file. You can upload a package.json file or enter the following information.
- PHP
- Add modules for your Containerized script language website. For Python websites, you can also add modules by clicking Browse and uploading a requirements file (requirements.txt).
- Module Name: The name of the module.
- Default Version: You can use the Latest version or Customize a module version. For example, you can enter the customized version as the followings:
- PHP (composer) and Node.js (npm) dependencies syntax
- >=1.0 <1.1
- 1.4.*
- ~1.2
- ^1.2.3
- Python requirements syntax. Enter “=“ before numbers
- == 1.3
- >= 1.2 , <= 2.0
- ~= 1.4.2
- PHP (composer) and Node.js (npm) dependencies syntax
- Action: Click
to remove a module.
- Set up the database for your Containerized script language website.
- Type: The database your website uses, including MariaDB and PostgreSQL.
- Version: The version of the database.
- Database: The name of your database.
- User: The username for accessing the database.
- Password: The password of the database user.
- Confirm your settings and click Create.
Note:
- The format of a requirements.txt file needs to follow the format of the requirement specifier. Refer to pip documentation and Version Specifier for more information.
- The format of a package.json file must follow the format defined by npm documents. Refer to the npm Docs for more information on package.json specifiers.
To edit a web service:
- Go to the Web Services page.
- Select the web service you want to modify its settings.
- Click Edit.
- The editable options vary depending on the web service you selected.
- Click Save after you modify the settings.
To manage a web service:
- Go to the Web Services page.
- Select a web service and click Action.
- You can perform the following actions for the service: Start, Pause, Repair, and Delete.