Defining Protein Parameters by Server IP
This guide explains how to define Protein parameters individually by server IP. Reads the system settings required to run protein sites from the Protein Params screen. When there are multiple servers using the same database (for example, a live and test server), the folder paths or publication mode of each server may be different.
Therefore, Main Params, Publish Mode and Extend Params values can now be defined separately for each server IP. Which IP settings a server will use is written in the reactor/protein.config file on that server. If there is no definition for that IP, Default values are used as before. For single-server installations, there is no need to do anything.
1. When to Use
Situation | What to do |
|---|---|
There is only one server | Nothing is done, Default values are used |
Suddenly multiple servers use the same database, settings are the same | Do nothing, all use Default |
Servers have different folder paths, broadcast mode or additional parameters | An IP definition for each different server is created |
2. Preparing the protein.config File
- The AddOns/Yazilimsa/Protein/reactor/protein.config file is opened on the server. The file has the same structure as workcube.config: dsn and ip.
- Example: {"dsn": "PROD_DSN", "ip": "10.0.0.12"}
- dsn field is the main datasource name defined in Lucee, IP field enters which IP settings this server will use in Protein Params.
- IP is not found automatically, whatever is written in the file is used.
- The old format (only the datasource name on a single line) continues to work. In this case, the server uses Default. Lines starting with
- // or # are considered comments. The protein.config.example file in the same folder can be used as an example.
- protein.config is specific to each server and is not added to git.
3. Creating a Parameter Set for IP
- Protein Params screen opens. At the top is the Server IP card.
- The card shows the IP in this server's protein.config file. When this IP is clicked, the New IP definition field is filled automatically. For convenience, the server's own IPs are also listed.
- IP is written in the New IP definition field and the + button is pressed.
- The new definition is created as a copy of the Default values and is selected in the Parameter set list.
4. Editing IP-Specific Values
- The IP to be edited is selected from the parameter set list. The selected IP appears in the card headers.
- Main Params, Publish Mode and Extend Params values in the Broadcast card are edited and saved for this IP.
- General and Cloudflare settings are common to all servers. These cards appear only when Default is selected.
- The server uses the values in the IP definition. A parameter not included in the definition comes from Default.
- To delete an IP definition, the trash can icon next to the Parameter set list is used. The server using the deleted IP returns to Default.
5. Site Publishing
Site publishing also works with the settings of the server's IP. Publish Mode (Apache legacy or Docker + Nginx) and the folder paths used in the publication are read from the parameter set used by the server. Thus, sites in the same database are published on each server with the broadcast settings of that server.
6. Verifying the Result
When the process is completed:
- In the This server tag on the Server IP card in Protein Params, the set (IP or Default) used by the server is displayed.
- On the detail page of the site, the Server Broadcast Settings tab opens. The top information line displays the broadcast mode and the parameter set used.
- If the default appears, check that the IP in protein.config is written exactly the same as the IP defined in Protein Params.
- If protein.config has been changed, the Protein application must be restarted for the sites to use the new IP.
7. Other Changes
The unused Protein License field on the Protein Params screen has been removed. Card name changed from Publication and License to Publication.
Summary
Step | What |
|---|---|
1 | If the settings of the servers are different, decide if IP-based definition is required |
2 | Reactor/protein.config of each server write dsn and ip to file |
3 | Protein Params > Add IP definition from Server IP card |
4 | Select IP and Main Edit and save Params, Publish Mode and Extend Params values |
5 | Check the set used from this server tag and the Server Publish Settings tab et |
6 | If default appears, check IP spelling in protein.config |
Feedback
Shall we talk about Workcube?
Call duration has expired.