1# http.conf used for testing auth-test 2 3ServerName 127.0.0.1 4Listen 127.0.0.1:47524 5 6DocumentRoot . 7 8# The tests shut down apache with "graceful-stop", because that makes 9# it close its listening socket right away. But it seems to sometimes 10# result in apache never fully exiting. This fixes that. 11GracefulShutdownTimeout 1 12 13# Change this to "./error.log" if it's failing and you don't know why 14ErrorLog /dev/null 15 16LoadModule mpm_prefork_module @APACHE_MODULE_DIR@/mod_mpm_prefork.so 17LoadModule alias_module @APACHE_MODULE_DIR@/mod_alias.so 18LoadModule auth_basic_module @APACHE_MODULE_DIR@/mod_auth_basic.so 19LoadModule auth_digest_module @APACHE_MODULE_DIR@/mod_auth_digest.so 20LoadModule authn_core_module @APACHE_MODULE_DIR@/mod_authn_core.so 21LoadModule authn_file_module @APACHE_MODULE_DIR@/mod_authn_file.so 22LoadModule authz_core_module @APACHE_MODULE_DIR@/mod_authz_core.so 23LoadModule authz_host_module @APACHE_MODULE_DIR@/mod_authz_host.so 24LoadModule authz_user_module @APACHE_MODULE_DIR@/mod_authz_user.so 25LoadModule dir_module @APACHE_MODULE_DIR@/mod_dir.so 26LoadModule mime_module @APACHE_MODULE_DIR@/mod_mime.so 27@IF_HAVE_PHP@LoadModule php7_module @APACHE_PHP_MODULE_FILE@ 28LoadModule proxy_module @APACHE_MODULE_DIR@/mod_proxy.so 29LoadModule proxy_http_module @APACHE_MODULE_DIR@/mod_proxy_http.so 30LoadModule proxy_connect_module @APACHE_MODULE_DIR@/mod_proxy_connect.so 31LoadModule ssl_module @APACHE_SSL_MODULE_DIR@/mod_ssl.so 32@IF_HAVE_MOD_UNIXD@LoadModule unixd_module @APACHE_SSL_MODULE_DIR@/mod_unixd.so 33 34@IF_HAVE_PHP@PHPIniDir . 35 36DirectoryIndex index.txt 37TypesConfig /dev/null 38AddType application/x-httpd-php .php 39Redirect permanent /redirected /index.txt 40 41# Proxy #1: unauthenticated 42Listen 127.0.0.1:47526 43<VirtualHost 127.0.0.1:47526> 44 ProxyRequests On 45 AllowCONNECT 47525 46 47 # Deny proxying by default 48 <Proxy *> 49 Require all denied 50 </Proxy> 51 52 # Allow local http connections 53 <Proxy http://127.0.0.1*> 54 Require all granted 55 </Proxy> 56 57 # Allow CONNECT to local https port 58 <Proxy 127.0.0.1:47525> 59 Require all granted 60 </Proxy> 61 62 # Deny non-proxy requests 63 <Directory /> 64 Require all denied 65 </Directory> 66</VirtualHost> 67 68# Proxy #2: authenticated 69Listen 127.0.0.1:47527 70<VirtualHost 127.0.0.1:47527> 71 ProxyRequests On 72 AllowCONNECT 47525 73 74 # Deny proxying by default 75 <Proxy *> 76 Require all denied 77 </Proxy> 78 79 # Allow local http connections with authentication 80 <Proxy http://127.0.0.1:47524*> 81 AuthType Basic 82 AuthName realm1 83 AuthUserFile ./htpasswd 84 Require valid-user 85 </Proxy> 86 87 # Allow CONNECT to local https port with authentication 88 <Proxy 127.0.0.1:47525> 89 AuthType Basic 90 AuthName realm1 91 AuthUserFile ./htpasswd 92 Require valid-user 93 </Proxy> 94 95 # Fail non-proxy requests 96 <Directory /> 97 Require all denied 98 </Directory> 99</VirtualHost> 100 101# Proxy #3: unauthenticatable-to 102Listen 127.0.0.1:47528 103<VirtualHost 127.0.0.1:47528> 104 ProxyRequests On 105 AllowCONNECT 47525 106 107 # Deny proxying by default 108 <Proxy *> 109 Require all denied 110 </Proxy> 111 112 # Allow local http connections with authentication 113 <Proxy http://127.0.0.1:47524*> 114 AuthType Basic 115 AuthName realm1 116 AuthUserFile ./htpasswd 117 Require user no-such-user 118 </Proxy> 119 120 # Allow CONNECT to local https port with authentication 121 <Proxy 127.0.0.1:47525> 122 AuthType Basic 123 AuthName realm1 124 AuthUserFile ./htpasswd 125 Require user no-such-user 126 </Proxy> 127 128 # Fail non-proxy requests 129 <Directory /> 130 Require all denied 131 </Directory> 132</VirtualHost> 133 134 135# SSL setup 136<IfModule mod_ssl.c> 137 Listen 127.0.0.1:47525 138 139 <VirtualHost 127.0.0.1:47525> 140 SSLEngine on 141 142 SSLCertificateFile ./test-cert.pem 143 SSLCertificateKeyFile ./test-key.pem 144 145 </VirtualHost> 146</IfModule> 147 148 149# Basic auth tests 150Alias /Basic/realm1/realm2/realm1 . 151Alias /Basic/realm1/realm2 . 152Alias /Basic/realm1/subdir . 153Alias /Basic/realm1/not . 154Alias /Basic/realm1 . 155Alias /Basic/realm12/subdir . 156Alias /Basic/realm12 . 157Alias /Basic/realm2 . 158Alias /Basic/realm3 . 159Alias /Basic . 160Alias /BasicRoot . 161 162<Location /Basic/realm1> 163 AuthType Basic 164 AuthName realm1 165 AuthUserFile ./htpasswd 166 Require user user1 167</Location> 168 169<Location /Basic/realm1/not> 170 AuthType Basic 171 AuthName realm1 172 AuthUserFile ./htpasswd 173 Require user user2 174</Location> 175 176<Location /Basic/realm12> 177 AuthType Basic 178 AuthName realm12 179 AuthUserFile ./htpasswd 180 Require user user1 user2 181</Location> 182 183<Location /Basic/realm1/realm2> 184 AuthType Basic 185 AuthName realm2 186 AuthUserFile ./htpasswd 187 Require user user2 188</Location> 189 190<Location /Basic/realm1/realm2/realm1> 191 AuthType Basic 192 AuthName realm1 193 AuthUserFile ./htpasswd 194 Require user user1 195</Location> 196 197<Location /Basic/realm2> 198 AuthType Basic 199 AuthName realm2 200 AuthUserFile ./htpasswd 201 Require user user2 202</Location> 203 204<Location /Basic/realm3> 205 AuthType Basic 206 AuthName realm3 207 AuthUserFile ./htpasswd 208 Require user user3 209</Location> 210 211<Location /BasicRoot> 212 AuthType Basic 213 AuthName realm1 214 AuthUserFile ./htpasswd 215 Require user user1 216</Location> 217 218# Digest auth tests 219Alias /Digest/realm1/realm2/realm1 . 220Alias /Digest/realm1/realm2 . 221Alias /Digest/realm1/subdir . 222Alias /Digest/realm1/expire . 223Alias /Digest/realm1/not . 224Alias /Digest/realm1 . 225Alias /Digest/realm2 . 226Alias /Digest/realm3 . 227Alias /Digest . 228 229<Location /Digest/realm1> 230 AuthType Digest 231 AuthName realm1 232 AuthUserFile ./htdigest 233 AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1 234 Require valid-user 235</Location> 236 237<Location /Digest/realm1/expire> 238 AuthType Digest 239 AuthName realm1 240 AuthUserFile ./htdigest 241 AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1 242 AuthDigestNonceLifetime 2 243 Require valid-user 244</Location> 245 246<Location /Digest/realm1/not> 247 AuthType Digest 248 AuthName realm1 249 AuthUserFile ./htdigest 250 AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1 251 Require user user2 252</Location> 253 254<Location /Digest/realm1/realm2> 255 AuthType Digest 256 AuthName realm2 257 AuthUserFile ./htdigest 258 AuthDigestDomain /Digest/realm2 /Digest/realm1/realm2 259 Require valid-user 260</Location> 261 262<Location /Digest/realm1/realm2/realm1> 263 AuthType Digest 264 AuthName realm1 265 AuthUserFile ./htdigest 266 AuthDigestDomain /Digest/realm1 /Digest/realm1/realm2/realm1 267 Require valid-user 268</Location> 269 270<Location /Digest/realm2> 271 AuthType Digest 272 AuthName realm2 273 AuthUserFile ./htdigest 274 AuthDigestDomain /Digest/realm2 /Digest/realm1/realm2 275 Require valid-user 276</Location> 277 278<Location /Digest/realm3> 279 AuthType Digest 280 AuthName realm3 281 AuthUserFile ./htdigest 282 AuthDigestDomain /Digest/realm3 283 Require valid-user 284 # test RFC2069-style Digest 285 AuthDigestQop none 286</Location> 287