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]


4

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 asking ...


3

How do I test .htaccess from the command line? Exactly the same way as if you were not on a command line, with an HTTP request. There are common tools useful for that such as (but not limited to) curl and wget. Both of these tools include options to get the header received, HTTP return code and the full output. If you need to integrate it in an ...


3

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.


3

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


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 set....


3

I suppose, you try something like zip /path/to/your/zipfile * but * doesn't match filenames starting with a dot. But ? matches a dot, so ?* matches all file names, including those starting with a dot. Unfortunally it also matches .., the parent directory, so do zip /path/to/your/zipfile ??* This will match everything in the current directory.


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

Instead of file directive try using location : <Location "path/to/folder-or-file"> Order Allow,Deny Deny from all </Location>


2

You are absolutely sure in the a pure config as proxypass fail2ban won't 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

Let the PHP script write the IP addresses to a database table. Separately, from cron, periodically execute a different script (recommendation? Python) that queries the values and writes them to the .htaccess file. Then you can keep the permissions on the .htaccess file tight, like 0640, root:www-user. We can set the SUID bit on a script; but, by default, ...


2

The default Apache settings for /var/www meet your requirements already. You can restrict access to /var/www/private using Require group team as you suggested, by adding the missing configuration as follows. Require directives default to RequireAny so it can usually be omitted unless you need to change it as shown in the configuration below. Create a ....


2

The easiest way is to tell your shell to include hidden files in globs. With bash this is done with shopt -s dotglob.


1

One thing to note is if you are using a wildcard such as tar -cvpzf your_zip.tgz * it will not include hidden files. However, if you specify the directory such as tar -cvpzf your_zip.tgz /path/to/dir it will work. Or moreover, if you would like to run in your current directory: tar -cvpfz your_zip.tgz --exclude=*.tgz .


1

In the root directory (for you shared hosting account) add Options -Indexes and its will be inherited subdirectories


1

I assume you want to redirect to HTTPS in all cases and the http:// is just a typo. RewriteCond %{HTTP_HOST} ^oldsite.com [OR] RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC] RewriteRule ^/services https://newsite.com/solutions/ [R=301,L] RewriteCond %{HTTP_HOST} ^oldsite.com [OR] RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC] RewriteRule ^/faq/faq1 https:...


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 says ...


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 mod_headers....


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 /etc/...


1

this did it: RewriteCond %{HTTP_HOST} ^sharpedge\.ourdomain\.com$ [NC] RewriteCond %{REQUEST_URI} !^/Internet_IE/ RewriteRule ^(.*)$ /Internet_IE/$1 [L] Thanks goes to: https://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 ...


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