Skip to content

Commit

Permalink
First
Browse files Browse the repository at this point in the history
  • Loading branch information
hernandito committed May 23, 2018
1 parent f585059 commit 3c7ab89
Show file tree
Hide file tree
Showing 11 changed files with 499 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.gitignore
.github
.gitattributes
READMETEMPLATE.md
README.md
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#FROM linuxserver/baseimage.apache
MAINTAINER hernandito

# copy sources.list
COPY sources.list /etc/apt/

ENV APTLIST="libapache2-mod-php5 wget mc inotify-tools php5-gd php5-sqlite php5-mcrypt php5-tidy php5-mysql libapache2-mod-proxy-html"

# install main packages
#RUN apk update -qy && \
#apk install $APTLIST -qy && \

# cleanup
#apk clean -y && \
#rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ADD config/ /root/

ADD firstrun.sh /etc/my_init.d/firstrun.sh
RUN chmod +x /etc/my_init.d/firstrun.sh

RUN mkdir -p /etc/letsencrypt

#ADD https://dl.eff.org/certbot-auto /usr/bin/certbot-auto
#RUN chmod a+x /usr/bin/certbot-auto

# add some files
ADD services/ /etc/service/
RUN chmod -v +x /etc/service/*/run /etc/service/*/finish /etc/my_init.d/*.sh

# Update apache configuration with this one
RUN a2enmod proxy proxy_http proxy_ajp rewrite deflate substitute headers proxy_balancer proxy_connect proxy_html xml2enc authnz_ldap

# ports and volumes
EXPOSE 80 443
VOLUME /config /etc/letsencrypt
ENV YOUR_EMAIL=
ENV SINGLE_DOMAIN=
ENV YOUR_DOMAIN=




57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

![apache-le](https://raw.githubusercontent.com/hernandito/Apache-LetsEncrypt/master/apache_logo_medium_copy.png)


Based on LinuxServer.io's Apache Docker, this Docker add LetsEncrypt SSL Certificate generation and renewal. All the hard work and merits go to the LinuxServer team.

This is an apache web server docker with reverse proxy services enabled. Reverse proxy gives the ability going to www.domain.com:8351 for a service, you can go direct to www.domain.com/service and also enable HTTPS.

[![apache](http://www.softaculous.com/website/images/ampps/apache.png)][apacheurl]
[apacheurl]: https://httpd.apache.org/

## Usage

```
docker create \
--name="apache" \
-p 80:80 -p 443:443 \
-v /path/to/config:/config \
linuxserver/apache
```

**Parameters**

* `-p 80, 443` - the port(s)
* `-v /config/` - Location for reverse proxy files. Contains log, www, keys and apache folder
* `-e PGID` for for GroupID - see below for explanation - *optional*
* `-e PUID` for for UserID - see below for explanation - *optional*

It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it apache /bin/bash`.

### User / Group Identifiers

Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™.

In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below:

```
$ id <dockeruser>
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
```

## Setting up the application

* Config files are located in /config/apache
* Place web files in /config/www
* Place keys in /config/keys

## Updates

* Upgrade to the latest version simply `docker restart apache`.
* To monitor the logs of the container in realtime `docker logs -f apache`.


**Versions**

* 09-09-16 - Add layer badges to README.
* 06-11-15 - Initial Release
Binary file added apache_logo_medium_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions config/crons.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#1 * * * * add any cron strings here
0 0 */3 * * certbot-auto renew
141 changes: 141 additions & 0 deletions config/sample-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
ServerName YourDomain.com
<VirtualHost *:80>

DocumentRoot /config/www/

<Directory "/config/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>

<Directory "/config/www/phpmyadmin">
Options FollowSymLinks
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory>

<Directory "/config/www/adminer/>
AuthType Basic
AuthName "Adminer"
AuthUserFile /config/apache/.htpasswd
Require valid-user
AllowOverride All
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>

Alias /ampache "/config/www/ampache/"
<Directory "/config/www/ampache/>
AllowOverride All
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>


</VirtualHost>


<VirtualHost *:443>
ServerName YourDomain.com

SSLEngine on
SSLProtocol All -SSLv2 -SSLv3
SSLCipherSuite AES128+EECDH:AES128+EDH
SSLCertificateFile /etc/letsencrypt/live/YourDomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/YourDomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/YourDomain.com/chain.pem
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyRequests off

DocumentRoot /config/www/

<Location /sab>
ProxyPass http://Your-Internal-IP-Here:88/sabnzbd
ProxyPassReverse http://Your-Internal-IP-Here:88/sabnzbd
AuthUserFile /config/apache/.htpasswd
AuthType Basic
AuthName "SabNZBd"
Require user YourUserName
</Location>

<Location /sick>
ProxyPass http://Your-Internal-IP-Here:8081/sick
ProxyPassReverse http://Your-Internal-IP-Here:8081/sick
AuthUserFile /config/apache/.htpasswd
AuthType Basic
AuthName "SickRage_Proxy"
Require user YourUserName
</Location>

<Location /couch>
ProxyPass http://Your-Internal-IP-Here:5000/couch
ProxyPassReverse http://Your-Internal-IP-Here:5000/couch
AuthUserFile /config/apache/.htpasswd
AuthType Basic
AuthName "CouchPotato"
Require user YourUserName
</Location>

<Location /headphones>
ProxyPass http://Your-Internal-IP-Here:8681/headphones
ProxyPassReverse http://Your-Internal-IP-Here:8681/headphones
AuthUserFile /config/apache/.htpasswd
AuthType Basic
AuthName "Headphones"
Require user YourUserName
</Location>

<Location /rtorrent>
ProxyPass http://Your-Internal-IP-Here:8090
ProxyPassReverse http://Your-Internal-IP-Here:8090
AuthUserFile /config/apache/.htpasswd
AuthType Basic
AuthName "ruTorrent_Proxy"
Require user YourUserName
</Location>

<Location /owncloud>
ProxyPass https://Your-Internal-IP-Here:8000
ProxyPassReverse https://Your-Internal-IP-Here:8000
</Location>

<Location /calibre>
ProxyPass http://Your-Internal-IP-Here:8085/calibre
ProxyPassReverse http://Your-Internal-IP-Here:8085/calibre
AuthUserFile /config/apache/.htpasswd
AuthType Basic
AuthName "Calibre"
Require user YourUserName
</Location>

<Location /subsonic>
ProxyPass http://Your-Internal-IP-Here:4040/subsonic
ProxyPassReverse http://Your-Internal-IP-Here:4040/subsonic
</Location>

<Location /phpmyadmin>
ProxyPass http://Your-Internal-IP-Here:81/phpmyadmin
ProxyPassReverse http://Your-Internal-IP-Here:81/phpmyadmin
AuthUserFile /config/apache/.htpasswd
AuthType Basic
AuthName "PHPMyAdmin_Through-Proxy"
Require user YourUserName
</Location>

<Directory "/config/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Loading

0 comments on commit 3c7ab89

Please sign in to comment.