0

So this is sort of a shot in the dark but, hopping someone has ran into this before.

The suite of apps that our team is trying to deploy is being hosted on infrastructure we do not own. That infrastructure is sitting on AWS, and is configured as needed using ansible. The issue is once the apps get deployed, we get a service unavailable error, when we try to go to the web apps in a web browser or call the APIs using Curl.

The apps are a few .NET APIs, a .NET Web app, and a Java web app. The .NET apps are running on kestrel, and the Java app is running on JBoss. Apache is configured to proxy to the correct app based on the path of the request.

The configurations for apache/services are included below. The service unavailable issue seems sporadic and we have not been able to find a pattern. Is there anything in the configuration files below that would indicate a problem? Could it be some sort of race condition because of how many apps we are running on a single Ec2 instance?

Vhosts.conf


    DirectoryIndex index.php index.html


    <VirtualHost *:443>
      ServerName app.dev.gov
      RewriteEngine On
      RewriteOptions Inherit
      LogFormat "%a %l %u %t \"%r\" %>s %b"
      ErrorLog logs/ssl_error_log
      TransferLog logs/ssl_access_log
      LogLevel notice
      ServerAlias *.dev-acqit.helix.gsa.gov
      VirtualDocumentRoot /var/www/html/app.dev.gov.gov/%0
      SSLProxyEngine On

      ProxyPreserveHost On
      <Location />
        Require  all granted
      </Location>


      ProxyPass /AccessManagement/ http://localhost:5000/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse /AccessManagement/ http://localhost:5000/
      ProxyPassReverse /AccessManagement/ http://app.dev.gov.gov:8443
      ProxyPassReverse /AccessManagement/ https://app.dev.gov.gov:8443
      ProxyPass /DataCollection/ http://localhost:5001/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse /DataCollection/ http://localhost:5001/
      ProxyPassReverse /DataCollection/ http://app.dev.gov.gov:8443
      ProxyPassReverse /DataCollection/ https://app.dev.gov.gov:8443
      ProxyPass /Portfolios/ http://localhost:5002/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse /Portfolios/ http://localhost:5002/
      ProxyPassReverse /Portfolios/ http://app.dev.gov.gov:8443
      ProxyPassReverse /Portfolios/ https://app.dev.gov.gov:8443
      ProxyPass /FileGenerator/ http://localhost:5003/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse /FileGenerator/ http://localhost:5003/
      ProxyPassReverse /FileGenerator/ http://app.dev.gov.gov:8443
      ProxyPassReverse /FileGenerator/ https://app.dev.gov.gov:8443
      ProxyPass /DataExport/ http://localhost:5004/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse /DataExport/ http://localhost:5004/
      ProxyPassReverse /DataExport/ http://app.dev.gov.gov:8443
      ProxyPassReverse /DataExport/ https://app.dev.gov.gov:8443
      ProxyPass /Submissions/ http://localhost:5006/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse /Submissions/ http://localhost:5006/
      ProxyPassReverse /Submissions/ http://app.dev.gov.gov:8443
      ProxyPassReverse /Submissions/ https://app.dev.gov.gov:8443
      ProxyPass /Folio/ http://localhost:5007/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse /Folio/ http://localhost:5007/
      ProxyPassReverse /Folio/ http://app.dev.gov.gov:8443
      ProxyPassReverse /Folio/ https://app.dev.gov.gov:8443
      ProxyPass / https://localhost:8443/ retry=0 ttl=60 disablereuse=On
      ProxyPassReverse / https://localhost:8443/
      ProxyPassReverse / https://app.dev.gov.gov:8443/
      ProxyPassReverse / https://app.dev.gov.gov:8443/



      Timeout 10

      SSLEngine on

      SSLProtocol TLSv1.2
      # Added per security requirement 1.7.5 - Restrict weak SSL Ciphers
      SSLHonorCipherOrder On
      SSLCipherSuite AES256+EECDH:AES256+EDH
      SSLCertificateFile /etc/httpd/certs/app.dev.gov.gov/cert.crt
      SSLCertificateKeyFile /etc/httpd/certs/app.dev.gov.gov/cert_key.pk
      SSLCertificateChainFile /etc/httpd/certs/app.dev.gov.gov/chain.crt
      SSLVerifyDepth 10

      SSLProxyCACertificateFile /etc/httpd/certs/app.dev.gov.gov/chain.crt
      SSLProxyVerifyDepth 10
      SSLProxyVerify require
      SSLProxyCheckPeerCN off
      SSLProxyCheckPeerName off


      <Directory "/var/www/html/app.dev.gov.gov">
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require   all granted
      </Directory>
      RequestHeader set X-Forwarded-Proto 'https'


    </VirtualHost>

host-services combined

[Unit]
Description=AccessManagement Host

[Service]
WorkingDirectory=/var/dotnet/AccessManagement
ExecStart=/usr/bin/dotnet AccessManagement.Api.dll
Restart=always
# Restart app after 10 seconds if the dotnet app crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=AccessManagement
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_CONTENTROOT=/var/dotnet/AccessManagement
Environment=ASPNETCORE_URLS=http://localhost:5000/
Environment=MONGO__SSL=true
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Environment=S3_BUCKET_DATA=app.dev-data
Environment=ENVIRONMENT=development
Environment=S3_PATH=home/app
Environment=APP_VERSION=0.9.1
Environment=STACK_NAME=DotNet21-Mongo36

Environment=MONGO__PRIMARY=mongo.primary
Environment=MONGO__SECONDARY=mongo.secondary
Environment=MONGO__SSL=true
Environment=MONGO__BACKUP=mongo.backup
Environment=MONGO__PASSWORD=nope

Environment=ConnectionStrings__appDatabase=mongo.primary:27017,mongo.secondary:27017,mongo.backup:27017/AccessManagement?ssl=true&replicaSet=myReplicaSet&authSource=admin

Environment=CF_NAME=dotnet-api-19


[Install]
WantedBy=AccessManagement.target

[Unit]
Description=DataCollection Host

[Service]
WorkingDirectory=/var/dotnet/DataCollection
ExecStart=/usr/bin/dotnet DataCollection.API.dll
Restart=always
# Restart app after 10 seconds if the dotnet app crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=DataCollection
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_CONTENTROOT=/var/dotnet/DataCollection
Environment=ASPNETCORE_URLS=http://localhost:5001/
Environment=MONGO__SSL=true
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Environment=S3_BUCKET_DATA=app.dev-data
Environment=ENVIRONMENT=development
Environment=S3_PATH=home/app
Environment=APP_VERSION=0.9.1
Environment=STACK_NAME=DotNet21-Mongo36

Environment=MONGO__PRIMARY=mongo.primary
Environment=MONGO__SECONDARY=mongo.secondary
Environment=MONGO__SSL=true
Environment=MONGO__BACKUP=mongo.backup
Environment=MONGO__PASSWORD=nope

Environment=ConnectionStrings__appDatabase=mongo.primary:27017,mongo.secondary:27017,mongo.backup:27017/AccessManagement?ssl=true&replicaSet=myReplicaSet&authSource=admin

Environment=CF_NAME=dotnet-api-19


[Install]
WantedBy=DataCollection.target

[Unit]
Description=DataExport Host

[Service]
WorkingDirectory=/var/dotnet/DataExport
ExecStart=/usr/bin/dotnet DataExport.Api.dll
Restart=always
# Restart app after 10 seconds if the dotnet app crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=DataExport
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_CONTENTROOT=/var/dotnet/DataExport
Environment=ASPNETCORE_URLS=http://localhost:5004/
Environment=MONGO__SSL=true
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Environment=S3_BUCKET_DATA=app.dev-data
Environment=ENVIRONMENT=development
Environment=S3_PATH=home/app
Environment=APP_VERSION=0.9.1
Environment=STACK_NAME=DotNet21-Mongo36

Environment=MONGO__PRIMARY=mongo.primary
Environment=MONGO__SECONDARY=mongo.secondary
Environment=MONGO__SSL=true
Environment=MONGO__BACKUP=mongo.backup
Environment=MONGO__PASSWORD=nope

Environment=ConnectionStrings__appDatabase=mongo.primary:27017,mongo.secondary:27017,mongo.backup:27017/AccessManagement?ssl=true&replicaSet=myReplicaSet&authSource=admin

Environment=CF_NAME=dotnet-api-19


[Install]
WantedBy=DataExport.target

[Unit]
Description=FileGenerator Host

[Service]
WorkingDirectory=/var/dotnet/FileGenerator
ExecStart=/usr/bin/dotnet FileGenerator.Api.dll
Restart=always
# Restart app after 10 seconds if the dotnet app crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=FileGenerator
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_CONTENTROOT=/var/dotnet/FileGenerator
Environment=ASPNETCORE_URLS=http://localhost:5003/
Environment=MONGO__SSL=true
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Environment=S3_BUCKET_DATA=app.dev-data
Environment=ENVIRONMENT=development
Environment=S3_PATH=home/app
Environment=APP_VERSION=0.9.1
Environment=STACK_NAME=DotNet21-Mongo36

Environment=MONGO__PRIMARY=mongo.primary
Environment=MONGO__SECONDARY=mongo.secondary
Environment=MONGO__SSL=true
Environment=MONGO__BACKUP=mongo.backup
Environment=MONGO__PASSWORD=nope

Environment=ConnectionStrings__appDatabase=mongo.primary:27017,mongo.secondary:27017,mongo.backup:27017/AccessManagement?ssl=true&replicaSet=myReplicaSet&authSource=admin

Environment=CF_NAME=dotnet-api-19


[Install]
WantedBy=FileGenerator.target

[Unit]
Description=app Host

[Service]
WorkingDirectory=/var/dotnet/app
ExecStart=/usr/bin/dotnet app.Web.dll
Restart=always
# Restart app after 10 seconds if the dotnet app crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=app
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_CONTENTROOT=/var/dotnet/app
Environment=ASPNETCORE_URLS=http://localhost:5007/
Environment=MONGO__SSL=true
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Environment=S3_BUCKET_DATA=app.dev-data
Environment=ENVIRONMENT=development
Environment=S3_PATH=home/app
Environment=APP_VERSION=0.9.1
Environment=STACK_NAME=DotNet21-Mongo36

Environment=MONGO__PRIMARY=mongo.primary
Environment=MONGO__SECONDARY=mongo.secondary
Environment=MONGO__SSL=true
Environment=MONGO__BACKUP=mongo.backup
Environment=MONGO__PASSWORD=nope

Environment=ConnectionStrings__appDatabase=mongo.primary:27017,mongo.secondary:27017,mongo.backup:27017/AccessManagement?ssl=true&replicaSet=myReplicaSet&authSource=admin

Environment=CF_NAME=dotnet-api-19


[Install]
WantedBy=app.target

[Unit]
Description=Portapps Host

[Service]
WorkingDirectory=/var/dotnet/Portapps
ExecStart=/usr/bin/dotnet Portapp.API.dll
Restart=always
# Restart app after 10 seconds if the dotnet app crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=Portapps
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_CONTENTROOT=/var/dotnet/Portapps
Environment=ASPNETCORE_URLS=http://localhost:5002/
Environment=MONGO__SSL=true
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Environment=S3_BUCKET_DATA=app.dev-data
Environment=ENVIRONMENT=development
Environment=S3_PATH=home/app
Environment=APP_VERSION=0.9.1
Environment=STACK_NAME=DotNet21-Mongo36

Environment=MONGO__PRIMARY=mongo.primary
Environment=MONGO__SECONDARY=mongo.secondary
Environment=MONGO__SSL=true
Environment=MONGO__BACKUP=mongo.backup
Environment=MONGO__PASSWORD=nope

Environment=ConnectionStrings__appDatabase=mongo.primary:27017,mongo.secondary:27017,mongo.backup:27017/AccessManagement?ssl=true&replicaSet=myReplicaSet&authSource=admin

Environment=CF_NAME=dotnet-api-19


[Install]
WantedBy=Portapps.target

[Unit]
Description=Submissions Host

[Service]
WorkingDirectory=/var/dotnet/Submissions
ExecStart=/usr/bin/dotnet Submissions.API.dll
Restart=always
# Restart app after 10 seconds if the dotnet app crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=Submissions
User=apache
Environment=ASPNETCORE_ENVIRONMENT=Development
Environment=ASPNETCORE_CONTENTROOT=/var/dotnet/Submissions
Environment=ASPNETCORE_URLS=http://localhost:5006/
Environment=MONGO__SSL=true
Environment=DOTNET_CLI_TELEMETRY_OPTOUT=1
Environment=S3_BUCKET_DATA=app.dev-data
Environment=ENVIRONMENT=development
Environment=S3_PATH=home/app
Environment=APP_VERSION=0.9.1
Environment=STACK_NAME=DotNet21-Mongo36

Environment=MONGO__PRIMARY=mongo.primary
Environment=MONGO__SECONDARY=mongo.secondary
Environment=MONGO__SSL=true
Environment=MONGO__BACKUP=mongo.backup
Environment=MONGO__PASSWORD=nope

Environment=ConnectionStrings__appDatabase=mongo.primary:27017,mongo.secondary:27017,mongo.backup:27017/AccessManagement?ssl=true&replicaSet=myReplicaSet&authSource=admin

Environment=CF_NAME=dotnet-api-19


[Install]
WantedBy=Submissions.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.