title: Configuring SSL with apache server in a docker container
body: <p>I am setting up a LAMP app in a docker container hosted in ubuntu. I am a docker noob</p>
  <p>I generated the CSR on the server that is hosting the docker container that has the public IP and domain i am using.</p>
  <p>In my Docker file I have</p>
  <pre><code>COPY ./dev.key /etc/apache2/ssl/dev.key
  COPY ./dev.combined /etc/apache2/ssl/dev.combined
  </code></pre>
  <p>Then in the apache.conf i have</p>
  <pre><code>&lt;VirtualHost *:443&gt;
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/dev.combined
    SSLCertificateKeyFile /etc/apache2/ssl/dev.key
  
    ServerAdmin admin@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
  
  &lt;/VirtualHost&gt;
  </code></pre>
  <p>The problem is when i try to start apache I get the error:</p>
  <blockquote>
  <p>AH02565: Certificate and private key 127.0.0.1:443:0
  from /etc/apache2/ssl/dev.combined and /etc/apache2/ssl/dev.key do not
  match AH00016: Configuration Failed</p>
  </blockquote>
  <p>There is something i am not understanding in configuring this docker image.</p>
  <p>The Domain has a real public IP , so the CSR and Cert need to point to this IP.</p>
  <p>Am I setting up something incorrectly in Docker so it thinks it is running 127.0.0.1 and not the IP i need?</p>
  <p>Thanks for any help. I am in way over my head.</p>