Hello all,
Im trying to restrict some websites hosted on my 17.10 Desktop with Apache to be internal on my network only while other sites are public. The sites currently are all accessible from anywhere which is the problem. I have enabled four configs. The default 000-default.conf, nagios.conf, jupiter.com.conf and one called Internal.conf The 000-default one is still default configuration and has not been touched. Jupiter.com is used for external sites, nagios is nagios, and internal is for internal websites.
Here is the config for Internal
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName jupiter/teampass
DocumentRoot /var/www/html/teampass
ErrorLog ${APACHE_LOG_DIR}/teampass-error.log
CustomLog ${APACHE_LOG_DIR}/teampass-access.log combined
<Directory /var/www/html/teampass>
Options Indexes FollowSymLinks
AllowOverride All
<IfModule mod_authz_core.c>
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require ip 192.168.8
</RequireAny>
</IfModule>
</Directory>
</VirtualHost>
One thing that comes off as odd is the RequireAny comes up as just white text like its not recognizing it. Require ip does show color so it looks like the module is loaded. I have also tried the following config setting with the same results.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName jupiter/teampass
DocumentRoot /var/www/html/teampass
ErrorLog ${APACHE_LOG_DIR}/teampass-error.log
CustomLog ${APACHE_LOG_DIR}/teampass-access.log combined
<Directory /var/www/html/teampass>
Options Indexes FollowSymLinks
AllowOverride All
Require ip 127.0.0.1
Require ip ::1
</Directory>
</VirtualHost>
Here is some information about my envirionment
@Jupiter:~$ apache2ctl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 is a NameVirtualHost
default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost jupiter/teampass (/etc/apache2/sites-enabled/internal.conf:31)
port 80 namevhost jupiter/phpmyadmin (/etc/apache2/sites-enabled/internal.conf:51)
port 80 namevhost redacted_url.net/minecraft (/etc/apache2/sites-enabled/jupiter.com.conf:35)
alias
www.redacted_url.net/minecraft
port 80 namevhost redacted_url.net/tametheark (/etc/apache2/sites-enabled/jupiter.com.conf:44)
alias
www.redacted_url.net/tametheark
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
In jupiter.com.conf config I am using AuthUserFile to require a site password so I know the configs are being read but cant seem to get require ip to work in any of my congfigs.
@Jupiter:~$ apache2 -version
Server version: Apache/2.4.27 (Ubuntu)
Server built: 2017-09-18T15:05:48
Any help would be greatly appreciated.