[Support] Linuxserver.io - Apache


Recommended Posts

A quick thanks for this Docker. I used it to provide very restricted access to my Node-RED docker which I'm using for home automation and for which I want to write Alexa skills - this has allowed me implement the required https access from Amazon servers to my unraid hosted endpoint. plus I learned a bit about web server configuration along the way and have a nice self-hosted site out of it as well.  8)

 

Really appreciate all the LinuxServer.io work.

 

 

Link to comment

Have a super easy question...  I'm new to apache so this simple thing is throwing me for a loop.

 

I have the Docker installed, and want to add a password using .htaccess.  The guide is great, but it's missing noob-friendly detail.  What is the root directory file structure for the server?  I need to fix that line in my .htaccess file, which will be placed in the www folder and the .htpasswd will be placed a directory above that.  I'm using the default config mappings.

 

Thanks again for all the help and these dockers

Link to comment

Have a super easy question...  I'm new to apache so this simple thing is throwing me for a loop.

 

I have the Docker installed, and want to add a password using .htaccess.  The guide is great, but it's missing noob-friendly detail.  What is the root directory file structure for the server?  I need to fix that line in my .htaccess file, which will be placed in the www folder and the .htpasswd will be placed a directory above that.  I'm using the default config mappings.

 

Thanks again for all the help and these dockers

 

You don't actually need the .htaccess file. Don't worry about the requested path as you only need the contents of the .passwd file as this tool is used to hash the passwords. The resultant passwords is added to /config.htpasswd (I had to create this file).

 

Then, edit your default.conf file with something like this...

 

<VirtualHost *:80>

ServerName skills.mydomain.online

ServerAlias skills.mydomain.online

<Location /echo>

AuthUserFile /config/.htpasswd

AuthType Basic

AuthName "Skills"

Require user username

ProxyPass http://192.168.XXX.XXX:XXXX/echo

ProxyPassReverse http://192.168.XXX.XXX:XXXXecho

</Location>

</VirtualHost>

 

Where username is the name of the user you configured your password for. You need to but the Auth and Require entries inside the Location tags if you're setting up reverse proxy.

 

I've just set this all up and have a more detailed write up on my blog if it helps.

 

 

 

 

Link to comment

Newbie question....

 

 

I managed to setup apache correctly I think, and I'm trying to get mydomain.com to point to my server but I can't get it to work.  Should it be as simple as pointing port 443 in my router to my unraid server or am I missing something else?  I think I've setup cloudflare and my nameservers/ddns correctly

 

 

Thanks in advance

Link to comment

Where username is the name of the user you configured your password for. You need to but the Auth and Require entries inside the Location tags if you're setting up reverse proxy.

 

I've just set this all up and have a more detailed write up on my blog if it helps.

 

How would I get the root directory to work with this setup?  Also, how can I get the root of the domain and "www." setup the same way?  It works for "www.mydomain.com" and I'm asked to input the username/pass.  But if I just go to "mydomain.com" it lets me in, no questions asked.  That's just a redirect in my domain name settings page, right?  (redirect www to the mydomain.com to avoid using it)

Link to comment

Where username is the name of the user you configured your password for. You need to but the Auth and Require entries inside the Location tags if you're setting up reverse proxy.

 

I've just set this all up and have a more detailed write up on my blog if it helps.

 

How would I get the root directory to work with this setup?  Also, how can I get the root of the domain and "www." setup the same way?  It works for "www.mydomain.com" and I'm asked to input the username/pass.  But if I just go to "mydomain.com" it lets me in, no questions asked.  That's just a redirect in my domain name settings page, right?  (redirect www to the mydomain.com to avoid using it)

 

Do you have ServerName set to mydomain.com and ServerAlias set to www.mydomain.com?

 

 

Link to comment

 

Do you have ServerName set to mydomain.com and ServerAlias set to www.mydomain.com?

 

Well, as odd as this sounds, everything is now working as it should without much intervention from me.

 

I used my registrar to redirect www.domain.com to domain.com, so that fixed that issue.  And now, after editing the conf files, I am prompted for the username/password I setup for the applications I want.  I believe there was some sort of browser cache issue I had which made it seem that things weren't working correctly.

 

Now, I'm going to setup SSL.  Thanks again meep & CHBMB.  The guides you both put together were extremely helpful in getting things configured.  I'm sure I'll have some sort of other issue pop up in a bit, lol, but thanks again for now.

Link to comment

:(

 

Can anybody help me out, this is driving nuts.

I was originally try to install Zoneminder but it kept failing on the apache part. So I tried to install an apache server and get the same error.

It always wants to install to port 80 no matter what I put, which unsurprisingly results in address already in use because that's the unraid port. I have read and read and found similar errors elsewhere but nothing really sprang out. I was expecting to find someone else with the same problem on unraid, so it must be something I'm doing wrong (isn't it always). I have other things set up in my docker no problem... plex, homeassistant, mqtt, transmission, nodered.... they all work fine. I can't my head round what's going wrong with apache though, please someone, anyone, before...I....reeee..... anyway I'm sure you know how it is!  ::)

Link to comment

I haven't changed the container port, just the host port, it should be redirecting it I understand that. Do I have to do anything else, make a user other than the default root, or something???

It should be simple no? No different to any of the other apps I have installed. Make sure the port isn't in use for anything else, set it to something other than 80, start? When I click show advanced I see the port, and the ports of the other apps. It "should" be working.....

unraid.png.6eb0266a6727fe31ad322cd3fba0e800.png

Link to comment

Address already in use!

 

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

AH00015: Unable to open logs

Action '-D FOREGROUND' failed.

The Apache error log may have more information.

* Stopping web server apache2

Link to comment

Address already in use!

 

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

AH00015: Unable to open logs

Action '-D FOREGROUND' failed.

The Apache error log may have more information.

* Stopping web server apache2

 

That's illustrated a good reason to always post as much information as possible.  That error message is nothing to do with your docker config, but actually what is happening within the container.....

 

I've just tried a fresh pull here and it's working fine.

 

*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/04_set_timezone.sh...

Current default time zone: 'Europe/London'
Local time is now: Tue Nov 1 22:21:42 GMT 2016.
Universal Time is now: Tue Nov 1 22:21:42 UTC 2016.

*** Running /etc/my_init.d/10_add_user_abc.sh...

-------------------------------------
_ _ _
| |___| (_) ___
| / __| | |/ _ \
| \__ \ | | (_) |
|_|___/ |_|\___/
|_|

Brought to you by linuxserver.io
We do accept donations at:
https://www.linuxserver.io/donations
-------------------------------------
GID/UID
-------------------------------------
User uid: 99
User gid: 100
-------------------------------------

*** Running /etc/my_init.d/20_apt_update.sh...
finding fastest mirror
Getting list of mirrors...done.
Testing latency to mirror(s)
Getting list of launchpad URLs...done.
Looking up 3 status(es)
1. mirror.sov.uk.goscomb.net
Latency: 10.85 ms
Org: Goscomb Technologies Limited
Status: Up to date
Speed: 1 Gbps
2. archive.ubuntu.com (current)
Latency: 10.94 ms
Org: Canonical Ltd.
Status: Up to date
Speed: 100 Mbps
3. mirror.vorboss.net
Latency: 11.58 ms
Org: Vorboss Ltd
Status: Up to date
Speed: 10 Gbps
New config file saved to /defaults/sources.list
We are now refreshing packages from apt repositories, this *may* take a while
Ign http://mirror.sov.uk.goscomb.net trusty InRelease
Get:1 http://mirror.sov.uk.goscomb.net trusty-updates InRelease [65.9 kB]
Get:2 http://mirror.sov.uk.goscomb.net trusty-security InRelease [65.9 kB]
Get:3 http://mirror.sov.uk.goscomb.net trusty Release.gpg [933 B]
Get:4 http://mirror.sov.uk.goscomb.net trusty Release [58.5 kB]
Get:5 http://mirror.sov.uk.goscomb.net trusty-updates/main Sources [475 kB]
Get:6 http://mirror.sov.uk.goscomb.net trusty-updates/restricted Sources [5,247 B]
Get:7 http://mirror.sov.uk.goscomb.net trusty-updates/universe Sources [213 kB]
Get:8 http://mirror.sov.uk.goscomb.net trusty-updates/multiverse Sources [7,374 B]
Get:9 http://mirror.sov.uk.goscomb.net trusty-updates/main amd64 Packages [1,139 kB]
Get:10 http://mirror.sov.uk.goscomb.net trusty-updates/restricted amd64 Packages [23.5 kB]
Get:11 http://mirror.sov.uk.goscomb.net trusty-updates/universe amd64 Packages [501 kB]
Get:10 http://mirror.sov.uk.goscomb.net trusty-updates/restricted amd64 Packages [23.5 kB]
Get:11 http://mirror.sov.uk.goscomb.net trusty-updates/universe amd64 Packages [501 kB]
Get:12 http://mirror.sov.uk.goscomb.net trusty-updates/multiverse amd64 Packages [16.4 kB]
Get:13 http://mirror.sov.uk.goscomb.net trusty-security/main Sources [152 kB]
Get:14 http://mirror.sov.uk.goscomb.net trusty-security/restricted Sources [3,944 B]
Get:15 http://mirror.sov.uk.goscomb.net trusty-security/universe Sources [52.8 kB]
Get:16 http://mirror.sov.uk.goscomb.net trusty-security/multiverse Sources [3,021 B]
Get:17 http://mirror.sov.uk.goscomb.net trusty-security/main amd64 Packages [675 kB]
Get:18 http://mirror.sov.uk.goscomb.net trusty-security/restricted amd64 Packages [20.2 kB]
Get:19 http://mirror.sov.uk.goscomb.net trusty-security/universe amd64 Packages [185 kB]
Get:20 http://mirror.sov.uk.goscomb.net trusty-security/multiverse amd64 Packages [5,083 B]
Get:21 http://mirror.sov.uk.goscomb.net trusty/main Sources [1,335 kB]
Get:22 http://mirror.sov.uk.goscomb.net trusty/restricted Sources [5,335 B]
Get:23 http://mirror.sov.uk.goscomb.net trusty/universe Sources [7,926 kB]
Get:24 http://mirror.sov.uk.goscomb.net trusty/multiverse Sources [211 kB]
Get:25 http://mirror.sov.uk.goscomb.net trusty/main amd64 Packages [1,743 kB]
Get:26 http://mirror.sov.uk.goscomb.net trusty/restricted amd64 Packages [16.0 kB]
Get:27 http://mirror.sov.uk.goscomb.net trusty/universe amd64 Packages [7,589 kB]
Get:26 http://mirror.sov.uk.goscomb.net trusty/restricted amd64 Packages [16.0 kB]
Get:27 http://mirror.sov.uk.goscomb.net trusty/universe amd64 Packages [7,589 kB]
Get:28 http://mirror.sov.uk.goscomb.net trusty/multiverse amd64 Packages [169 kB]
Fetched 22.7 MB in 4s (5,112 kB/s)
Reading package lists...
(Reading database ... 15227 files and directories currently installed.)
Preparing to unpack .../openssl_1.0.1f-1ubuntu2.21_amd64.deb ...
Unpacking openssl (1.0.1f-1ubuntu2.21) over (1.0.1f-1ubuntu2.19) ...
Preparing to unpack .../apache2-mpm-worker_2.4.7-1ubuntu4.13_amd64.deb ...
Unpacking apache2-mpm-worker (2.4.7-1ubuntu4.13) over (2.4.7-1ubuntu4.9) ...
Preparing to unpack .../apache2_2.4.7-1ubuntu4.13_amd64.deb ...
Unpacking apache2 (2.4.7-1ubuntu4.13) over (2.4.7-1ubuntu4.9) ...
Preparing to unpack .../apache2-bin_2.4.7-1ubuntu4.13_amd64.deb ...
Preparing to unpack .../apache2_2.4.7-1ubuntu4.13_amd64.deb ...
Unpacking apache2 (2.4.7-1ubuntu4.13) over (2.4.7-1ubuntu4.9) ...
Preparing to unpack .../apache2-bin_2.4.7-1ubuntu4.13_amd64.deb ...
Unpacking apache2-bin (2.4.7-1ubuntu4.13) over (2.4.7-1ubuntu4.9) ...
Preparing to unpack .../apache2-data_2.4.7-1ubuntu4.13_all.deb ...
Unpacking apache2-data (2.4.7-1ubuntu4.13) over (2.4.7-1ubuntu4.9) ...
Preparing to unpack .../php5_5.5.9+dfsg-1ubuntu4.20_all.deb ...
Unpacking php5 (5.5.9+dfsg-1ubuntu4.20) over (5.5.9+dfsg-1ubuntu4.16) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up openssl (1.0.1f-1ubuntu2.21) ...
Setting up apache2-bin (2.4.7-1ubuntu4.13) ...
Setting up apache2-data (2.4.7-1ubuntu4.13) ...
Setting up apache2 (2.4.7-1ubuntu4.13) ...
Setting up apache2 (2.4.7-1ubuntu4.13) ...
Installing new version of config file /etc/apache2/mods-available/mpm_prefork.load ...

Installing new version of config file /etc/apache2/mods-available/mpm_worker.load ...

Installing new version of config file /etc/apache2/mods-available/mpm_worker.load ...

Installing new version of config file /etc/apache2/mods-available/mpm_event.load ...

Installing new version of config file /etc/apache2/mods-available/mpm_event.load ...

invoke-rc.d: policy-rc.d denied execution of restart.
Setting up apache2-mpm-worker (2.4.7-1ubuntu4.13) ...
Setting up php5 (5.5.9+dfsg-1ubuntu4.20) ...
*** Running /etc/my_init.d/30_set_base_config.sh...
*** Running /etc/my_init.d/40_gen_ssl_keys.sh...
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a 2048 bit RSA private key
...............................+++
...........................................+++
writing new private key to '/config/keys/cert.key'
-----
Subject Attribute /C has no known NID, skipped
*** Running /etc/my_init.d/999_advanced_script.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 272
Setting up watches.
Watches established.
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.26. Set the 'ServerName' directive globally to suppress this message
Nov 1 22:22:06 6e2c08e59bef syslog-ng[281]: syslog-ng starting up; version='3.5.3'

 

Have you attempted to edit the default.conf file in your appdata folder?  My suspicion is you've edited that and whatever edit you've done is causing Apache to crash.

Link to comment

<VirtualHost *:80>

    DocumentRoot /config/www/

 

    <Directory "/config/www/">

        Options Indexes FollowSymLinks MultiViews

        AllowOverride all

            Order allow,deny

        Allow from all

    </Directory>

</VirtualHost>

 

<VirtualHost *:443>

    ServerName www.example.com

    SSLEngine on

    SSLCertificateFile "/config/keys/cert.crt"

    SSLCertificateKeyFile "/config/keys/cert.key"

  DocumentRoot /config/www/

 

    <Directory "/config/www/">

        Options Indexes FollowSymLinks MultiViews

        AllowOverride all

            Order allow,deny

        Allow from all

    </Directory>

</VirtualHost>

 

That's default.conf (as you will know!)

I haven't altered any apache .conf files.

I knew it should be straightforward, what on earth could I have done? Everything else is absolutely fine, amazing in fact, considering I was on 5b14 with none of this cool stuff for years up until a month or so ago.

Link to comment

Yes I am using a cache so I did as you said, it all looks fine until:

 

Installing new version of config file /etc/apache2/mods-available/mpm_prefork.load ...

Installing new version of config file /etc/apache2/mods-available/mpm_worker.load ...

Installing new version of config file /etc/apache2/mods-available/mpm_event.load ...

invoke-rc.d: policy-rc.d denied execution of restart.

Setting up apache2-mpm-worker (2.4.7-1ubuntu4.13) ...

Setting up php5 (5.5.9+dfsg-1ubuntu4.20) ...

*** Running /etc/my_init.d/30_set_base_config.sh...

*** Running /etc/my_init.d/40_gen_ssl_keys.sh...

generating self-signed keys in /config/keys, you can replace these with your own keys if required

Generating a 2048 bit RSA private key

Setting up apache2-mpm-worker (2.4.7-1ubuntu4.13) ...

Setting up php5 (5.5.9+dfsg-1ubuntu4.20) ...

*** Running /etc/my_init.d/30_set_base_config.sh...

*** Running /etc/my_init.d/40_gen_ssl_keys.sh...

generating self-signed keys in /config/keys, you can replace these with your own keys if required

Generating a 2048 bit RSA private key

.....................................................................................+++

...................................................................................+++

writing new private key to '/config/keys/cert.key'

-----

Subject Attribute /C has no known NID, skipped

*** Running /etc/my_init.d/999_advanced_script.sh...

*** Running /etc/rc.local...

*** Booting runit daemon...

*** Runit started as PID 273

Setting up watches.

Watches established.

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

AH00015: Unable to open logs

Nov 1 23:47:33 Plex syslog-ng[285]: syslog-ng starting up; version='3.5.3'

Action '-D FOREGROUND' failed.

The Apache error log may have more information.

* Stopping web server apache2

 

 

 

Link to comment

OK, so that's helpful.  If you notice, my log states

 

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.26. Set the 'ServerName' directive globally to suppress this message

 

which is fine and expected, as 172.17.0.26 is an IP in the range expected for a docker container.

 

Yours however is

 

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

 

What I can't work out is why, but I'm starting to think that's the issue....

Link to comment

I need to set it to bridge?

 

Pretty sure I tried that before.

 

Crap, I didn't see you'd changed it to host.  Why'd you do that?! Yeah change it to bridge.....

Our templates come configured with the appropriate type of networking set.

 

When you set to host you can't map ports like you can with bridge, so that explains why you're getting port 80 error, that's the port the Unraid webui runs on...  :o

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.