c986ed2467211bcaeee967afc680a3f83cfbd13f
wiki/info/landscape/amazon-ec2.md
| ... | ... | @@ -95,7 +95,7 @@ To set up a multi instance for a server with name "SSV", subdomain "ssv.sapsaili |
| 95 | 95 | 1. Connect to the EC2 instance where your multi instance should be deployed. For example: Connect to the instance "SL Multi-Instance Sailing Server" with dns name "ec2-34-250-136-229.eu-west-1.compute.amazonaws.com" in region Ireland via SSH. |
| 96 | 96 | |
| 97 | 97 | <pre> |
| 98 | - ssh -i .ssh/Administrator.pem root@ec2-34-250-136-229.eu-west-1.compute.amazonaws.com |
|
| 98 | + ssh sailing@ec2-34-250-136-229.eu-west-1.compute.amazonaws.com |
|
| 99 | 99 | </pre> |
| 100 | 100 | |
| 101 | 101 | 2. Navigate to the directory /home/sailing/servers. |
| ... | ... | @@ -145,20 +145,20 @@ To set up a multi instance for a server with name "SSV", subdomain "ssv.sapsaili |
| 145 | 145 | 8. Find the next unused ports for the variables SERVER_PORT, TELNET_PORT and EXPEDITION_PORT. You can do this by extracting all existing variable assignments from all env.sh files within the /home/sailing/servers directory. |
| 146 | 146 | |
| 147 | 147 | <pre> |
| 148 | - grep -Roh --include=env.sh "SERVER_PORT=.*" /home/sailing/servers | tr -d "SERVER_PORT=" | sort | uniq |
|
| 148 | + for i in /home/sailing/servers/*/env.sh; do cat $i | grep "^ *SERVER_PORT=" | tail -1 | tr -d "SERVER_PORT="; done | sort -n |
|
| 149 | 149 | </pre> |
| 150 | 150 | |
| 151 | 151 | Do this for TELNET_PORT and EXPEDITION_PORT likewise. |
| 152 | 152 | |
| 153 | - If this is the first multi instance on the server, use the values SERVER_PORT=8888, TELNET_PORT=14900, EXPEDITION_PORT=2000. |
|
| 153 | + If this is the first multi instance on the server, use the values SERVER_PORT=8888, TELNET_PORT=14888, EXPEDITION_PORT=2010. |
|
| 154 | 154 | |
| 155 | 155 | 9. Append the following variable assignments to your env.sh file. |
| 156 | 156 | <pre> |
| 157 | 157 | SERVER_NAME=SSV |
| 158 | - TELNET_PORT=14900 |
|
| 158 | + TELNET_PORT=14888 |
|
| 159 | 159 | SERVER_PORT=8888 |
| 160 | 160 | MONGODB_NAME=SSV |
| 161 | - EXPEDITION_PORT=2000 |
|
| 161 | + EXPEDITION_PORT=2010 |
|
| 162 | 162 | MONGODB_HOST=dbserver.internal.sapsailing.com |
| 163 | 163 | MONGODB_PORT=10202 |
| 164 | 164 | DEPLOY_TO=ssv |
| ... | ... | @@ -192,12 +192,13 @@ To set up a multi instance for a server with name "SSV", subdomain "ssv.sapsaili |
| 192 | 192 | |
| 193 | 193 | To reach your multi instance via "ssv.sapsailing.com", perform the following steps within the AWS Web Console inside region Ireland. |
| 194 | 194 | |
| 195 | -1. Create a new target group with the following details. |
|
| 195 | +1. Create a new target group with the following details, where the name "S-shared-ssv" is created as follows: "S" for "Sailing", "shared" because it's a shared instance, and "ssv" represents the server instance name: |
|
| 196 | 196 | |
| 197 | 197 | <img src="/wiki/images/amazon/TargetGroup_1.png"/> |
| 198 | - <img src="/wiki/images/amazon/TargetGroup_2.png"/> |
|
| 199 | 198 | |
| 200 | - Notice the overwritten health check port that is now pointing directly to the instance. |
|
| 199 | + <img src="/wiki/images/amazon/TargetGroup_2.png"/> |
|
| 200 | + |
|
| 201 | + Notice the overwritten health check port that is now pointing directly to the instance with its `SERVER_PORT` 8888. |
|
| 201 | 202 | |
| 202 | 203 | 2. Add the "SL Multi-Instance Sailing Server" instance to the target group. |
| 203 | 204 | |
| ... | ... | @@ -211,13 +212,15 @@ To reach your multi instance via "ssv.sapsailing.com", perform the following ste |
| 211 | 212 | |
| 212 | 213 | <img src="/wiki/images/amazon/ApplicationLoadBalancer_2.png"/> |
| 213 | 214 | |
| 214 | - Your application load balancer is now configured to redirect all requests with host-header "ssv.sapsailing.com" to the target group "S-shared-ssv". That means all requests will now be routed to the "SL Multi-Instance Sailing Server" instance inside this target group using HTTPS and port 443 as specified in the configuration of the target group. To establish a connection on port 8888, where our multi instance is listening, we have to modify the apache configuration on the "SL Multi-Instance Sailing Server" instance. |
|
| 215 | + Your application load balancer is now configured to redirect all requests with host-header "ssv.sapsailing.com" to the target group "S-shared-ssv". That means all requests will now be routed to the "SL Multi-Instance Sailing Server" instance inside this target group using HTTPS and port 443 as specified in the configuration of the target group. To establish a connection on port 8888 (the `SERVER_PORT` property from above), where our multi instance is listening, we have to modify the apache configuration on the "SL Multi-Instance Sailing Server" instance. |
|
| 215 | 216 | |
| 216 | -4. Connect to the "SL Multi-Instance Sailing Server" instance via SSH. Navigate to the directory /etc/httpd/conf.d. Open up the file "001-events.conf" and append the following line. |
|
| 217 | +4. Connect to the "SL Multi-Instance Sailing Server" instance via SSH as user `root`. Navigate to the directory /etc/httpd/conf.d. Open up the file "001-events.conf" and append the following line. |
|
| 217 | 218 | |
| 218 | 219 | <pre> |
| 219 | 220 | Use Plain-SSL ssv.sapsailing.com 127.0.0.1 8888 |
| 220 | 221 | </pre> |
| 222 | + |
|
| 223 | + where 8888 is again the `SERVER_PORT` from before. |
|
| 221 | 224 | |
| 222 | 225 | 5. Save the file and run a configuration file syntax check. |
| 223 | 226 | |
| ... | ... | @@ -230,10 +233,9 @@ To reach your multi instance via "ssv.sapsailing.com", perform the following ste |
| 230 | 233 | 6. Reload the httpd configuration. |
| 231 | 234 | |
| 232 | 235 | <pre> |
| 233 | - /etc/init.d/httpd reload |
|
| 236 | + service httpd reload |
|
| 234 | 237 | </pre> |
| 235 | 238 | |
| 236 | - |
|
| 237 | 239 | You should now be able to reach your multi instance with the dns name "ssv.sapsailing.com". |
| 238 | 240 | |
| 239 | 241 |