Up-to-date apache server running on Arch Linux ready to run virtualhosts.
307
You may run your virtualhost easily on this image. You can see how to do it bellow.i
This image also includes a script to start Apache properly (/root/run-apache.bash)
In order to add your virtualhost to your image you need to add your virtualhost configuration file to the new image and 'include' it in Apache configuration. In my Dockerfile I have the following:
# Create the directory where virtualhost files will be stored. RUN mkdir -p /var/www/sites RUN mkdir -p /var/www/sites/my-virtualhost
# Copy the virtualhost configuration file from my machine to the # Docker container. [0/110] ADD my-virtualhost.conf /etc/httpd/conf/extra/vhosts/
# Include the new virtualhost at the end of the httpd-vhosts.conf file. RUN echo 'Include conf/extra/vhosts/my-virtualhost.conf' >> /etc/httpd/conf/extra/httpd-vhosts.conf
Here is an example of a virtualhost configuration file:
<VirtualHost *:80>
ServerAdmin [email protected] DocumentRoot "/var/www/sites/my-virtualhost ServerName my-virtualhost.arbiza.com.br ServerAlias www.my-virtualhost.arbiza.com.br ErrorLog "/var/log/httpd/my-virtualhost-error_log" CustomLog "/var/log/httpd/my-virtualhost-access_log" common <Directory "/var/www/sites/my-virtualhost"> Require all granted AllowOverride None Options -Indexes -FollowSymLinks -ExecCGI LimitRequestBody 512000 </Directory>
Use the following command to run the container:
docker run --restart=always -d
--name -p 80:80 -p 443:443
-v /path/in/your/machine/:/var/www/sites/my-virtualhost
/bin/bash /root/run-apache.bash
Using the -v option you are mapping a directory where the site files are in your machine to the virtualhost directory in the container. Teh /bin/bash /root/run-apache.bash command start Apache properly.
Content type
Image
Digest
Size
606.1 MB
Last updated
over 10 years ago
docker pull arbiza/apache:2016-01-09