Hot answers tagged

6

For this you need to download/clone, compile and install nginx-auth-ldap You can download the zip file: wget https://github.com/kvspb/nginx-auth-ldap/archive/master.zip unzip master.zip then cd to your nginx source folder and do: ./configure --add-module=~-/nginx-auth-ldap-master sudo make install After that you can configure nginx: http { ...


4

Assuming the HTTPD is apache: RewriteEngine on RewriteCond %{HTTP_HOST} ^demo\.* [NC] RewriteRule .* http://domain.com/ [L]


3

The second error message seems to squarely point to it being a file permissions problem so here's a quick test to see where the problem might be. First switch to the correct user that apache is running as. I'm assuming it's www-data, but it may also be either apache, www, or something else. To find out for sure, you can try running ps -ef | grep apache or ...


3

I suspect your VirtualHost is not getting processed correctly, which would then not set AllowOverride for the get requests. First your /etc/hosts file should look like this.. 127.0.0.1 localhost localhost.localdomain 127.0.1.1 nibble.local Second, You must have that interface set for namebased vhosts. You did not specify if you have it currently ...


2

HTTP is stateless; cookies are used by web pages not by web servers. When your browser makes a request to such a page, it gets back an error response saying authentication is needed. Then, it'll prompt you for your user name and password, store that in memory, and then make the request again. From there on, every request that your browser makes to that ...


2

I believe you can drop this into an .htaccess where ever you don't want to allow scripts to execute: <Files *.*> Options -ExecCGI </Files> If you know all the "bad" files are named a certain way you could also disable their being associated to a given handler with this: <Files *.*> RemoveHandler cgi-script .php .pl .py .jsp .asp .htm ...


2

Are you by any chance missing a / in your RewriteRule ^0.02/ping/$, between ^ and 0.02/ping/? What would happen if you remove ^ or replace it with a ^/?


2

I have no history or knowledge how the .htpasswd file was created. You're probably looking for the htpasswd command. Read the man page for more details: man htpasswd How may I distinguish which encryption my .htpasswd file uses? Why do you need to know that? I don't think it's important to know that if you just want to edit the file. I'm ...


2

This is one possibility using the mod_rewrite: RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://graymind.ir/.* [NC] RewriteRule .* - [F] Basically it's checking if the referer starts with http://graymind.ir/ (non case sensitive), if so then it just rewrites any URL to a 403 Forbidden


2

You are absolutely sure in the a pure config as proxypass fail2ban wont work here because of several reasons. fail2ban actually works looking at logs, and blocking failed authenticated tries ; you have none as the one doing the authentication as the authentications logs are on the backend. fail2ban as a serie of definitions for known protocols; it maybe ...


2

You can also use the auth_pam module. It has for example been included in the last two stable Debian releases. It supports LDAP authentication (and a lot more) through PAM.


1

The DirectoryIndex directive does not control access to the directory's contents. Access/permissions are usually specified in the Directory items. If you look at the error-log, e.g., /var/log/httpd/error.log (different with different systems), you might see an error with this message: attempt to invoke directory as script for which the documentation ...


1

I monitored fail2ban log to watch for entries for banned IP's. By not seeing my IP I knew something was wrong. To monitor log: tail -f /var/log/fail2ban.log I monitored the log fail2ban was supposed to be watching to confirm failed logins were being logged. To monitor Apache Log: tail -f /var/log/apache2/error.log In the end I Re-created jail.local ...


1

I'm going to put my head above the parapet with this answer - after all, an answer is deletable! Apache processes it's modules in a not very well defined order. You can view the processing order by enabling the mod_info module. On a Fedora 22 installation, this came up with the following (extact): Post-Read Request: -10 mod_http2.c 00 ...


1

TL;DR .htaccess aren't made for that, and TS3 wouldn't understand Apache's HTTP traffic (for many protocol-related reasons). The best solution is probably to make ts.example.com an alias to example.com (in your domain's DNS configuration), and to ask your clients to connect to ts.example.com:x where x is your Teamspeak connection port. .htaccess files are ...


1

You should use <Location> instead of <Directory>. <Location /my_folder/> Order Deny,Allow Deny from all Allow from 1.1.1.1 </Location> See document on sections for Apache 2.2, Apache 2.4.


1

Never mind. I figured it out. Got it to work by moving the css file to public_html (not really necessary), changing the htaccess code to RewriteEngine on RewriteCond %{QUERY_STRING} action=mymail_form_css RewriteRule ^(.*)$ /mymail_form.css? [L,R=301] and moving the code to the document root's .htaccess Carry on~


1

You can use the following Rewrite Rule: RewriteRule r.info\/blogs\/st\/?(.*)$ r.info/blogs/th/st/$1 [L] Make sure no rule before this rule which has the [L] option gets triggered, because if it does, htaccess will never reach this rule.


1

Take a look in the directory /var/www/jekins. I'd do a find /var/www/jekins -name '.htaccess' to locate the file if there is one. If there isn't a.htaccess` fiel the authentication might be coming from the apache configuration itself. Did you not create a config file, perhaps jenkins.conf under Apache's conf.d directory? This is often times under ...


1

this did it: RewriteCond %{HTTP_HOST} ^sharpedge\.ourdomain\.com$ [NC] RewriteCond %{REQUEST_URI} !^/Internet_IE/ RewriteRule ^(.*)$ /Internet_IE/$1 [L] Thanks goes to: http://stackoverflow.com/a/11744085/530006


1

Assuming we want the IP address 12.34.56.78 to go to /var/www/client1/* and we want the IP address 87.65.43.21 to go to /var/www/client2/* RewriteEngine On RewriteCond %{REMOTE_ADDR} ^12\.34\.56\.78$ RewriteRule (.*) /client1/$1 RewriteCond %{REMOTE_ADDR} ^87\.65\.43\.21$ RewriteRule (.*) /client2/$1 Make a set of "RewriteCond" and "RewriteRule" for each ...


1

It depends on how your address was configured in the first place. You can configure a static address if you don't want it to change. If you use DHCPv6 then it depends a lot on the DHCP server. If you use plain SLAAC (stateless autoconf) then it should remain stable as long as your MAC address of your network adapter is stable, and it you use SLAAC with ...


1

Specify AccessFileName directive to use .htaccess file. AccessFileName .htaccess Enable the rewrite engine and then restart the service. sudo a2enmod rewrite



Only top voted, non community-wiki answers of a minimum length are eligible