With the above change, our docker-compose. docker/apache:/etc/apache2/sites-available/ssl RUN chown -R executing the Dockerfile and providing the certificates at that time.Īs we created docker-compose file earlier we will now mount the certificates in the directory we created in the Dockerfile ( /etc/apache2/sites-available/ssl). docker/apache/nf /etc/apache2/sites-available/nf Hi there, I have recently installed XAMPP on my computer, but realized when I tested the certificate on and it gives me a Certificate Error, it will still let me continue with the website. RUN mkdir /etc/apache2/sites-available/sslĪfter everything, this is how our Dockerfile should look like this: FROM php:7.3-apacheĬOPY. certificate error, and XAMPP Component status check failure. So, to create this directory, we will add the following line to our Dockerfile before COPY commands. docker/apache/localhost.key directory structureĪfter placing the files correctly, we need to create the following placeholder directory on the server build. subj '/CN=localhost' -extensions EXT -config /.docker/apache/localhost.crt The following command will generate the certificate files: openssl req -x509 -out localhost.crt -keyout localhost.key \ This should work for local development purposes. We can use the OpenSSL CLI tool to generate the SSL Certificate files. We don't have any high-level signing authority. + RUN chown -R www-data:www-data /app & a2enmod rewrite ssl And for that, we will need to adjust the last line of the Dockerfile as: - RUN chown -R www-data:www-data /app & a2enmod rewrite Add cainfo ‘/usr/local/openssl-0.9.8/certs/cacert.pem’ to modify it. Finally, navigate to the php.ini file, modify CURL. After that, copy cacert.pem to openssl/zend, like ‘/usr/local/openssl-0.9.8/certs/cacert.pem’. On a server where the Apache server is running, we need to trigger the following command to enable the SSL module: a2enmod sslīut for our docker setup, we need to do this while building the container. Change Php.ini Click on and download cacert.pem. And all we have to do is to enable this module for the Apache server. Generate Certificate and Key files to use with the localhost and mount them on the right pathĪpache installation comes bundled with the SSL Module. Install and Enable the SSL module for the Apache web server.With the above config, we need to do two more things: Set some additional options for SSL when serving specific files.Provide the SSL Certificate and Key files.Turn the SSL Engine On for the matching server address.SSLCertificateKeyFile "/etc/apache2/sites-available/ssl/localhost.key" SSLCertificateFile "/etc/apache2/sites-available/ssl/localhost.crt" Options Indexes FollowSymLinks Includes execCGIĬustomLog $/access.log combined LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so For the initial setup, it should look like this: # File. The base image we will use for our PHP application is the official one from php with Apache prepackaged: php:7.3-apache.Īs we want to use Apache to serve our PHP application, we must prepare some configurations for Apache. We could use the Docker compose and use the base image directly, but as we need to enable a few plugins and install a few packages, it is better to prepare our custom image and then use it. We must prepare the docker container for the above PHP file via the Docker file. XAMPP is a great tool that has served PHP developers for a long time.Īnd in modern software development, where we talk about shipping the whole platform with IaaC/IaC (Infrastructure as a Code), this development workflow could be more convenient and help the developer's productivity.Īfter learning a few things about Docker and its benefits and building dockerized CI/CD process, I decided to bring Docker to this application and help future devs with easy onboarding and development.įirst, let's use a PHP application that shows today's date and greets the visitor nicely. AH00418: Parent: Created child process 8Recently I came across an application built with the LAM P (Linux, Apache, MySQL and PHP) stack.Īnd this application was critical enough, and one must not mess with it to break anything or increase maintenance.īut there was one problem, we had to use XAMPP to enable development on this application. AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache' AH00354: Child: Starting 150 worker threads. AH00418: Parent: Created child process 8592 AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache' AH01909: server certificate does NOT include an ID which matches the server name
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |