Sponsored Content
Top Forums Web Development .htaccess allow at directory level Post 302738083 by molwiko on Friday 30th of November 2012 10:19:40 AM
Old 11-30-2012
Wrench .htaccess allow at directory level

Hi Guys

I have a web a site at the following directory
/var/www/
the website is containing a lot of sub directories.
/var/www/mywebsite/folder1
/var/www/mywebsite/folder2
/var/www/mywebsite/folder3
I would like to block all the website expect one user ex: user1 password1
who can see everything and another user who can see only folder2 ex: user2 password1

Code:
AuthType Basic
AuthName htaccess
AuthUserFile /var/www/.secret
AuthGroupFile /dev/null
#<Limit GET POST>
#order deny,allow
#deny from all
#require user Loylogic
#require user Ates
#</Limit>
require user user1
SetEnvIf Request_URI "(/var/www/mywebsite)$" allow
Order allow,deny
Allow from env=allow
Satisfy any
require user user2
SetEnvIf Request_URI "(/var/www/mywebsite/folder1)$" allow
Order allow,deny
Allow from env=allow
Satisfy any

the issue this code doesn't work can you please help to sort to this our thanks

Last edited by Corona688; 11-30-2012 at 11:30 AM..
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

htaccess

Something is wrong. I do everything right make the .htaccess file and stuff, but when I try the htpasswd command it says command not found. I use Putty SSH client and I think server is running RedHat 7.1 with Apache some version. HELP!!! (1 Reply)
Discussion started by: _hp_
1 Replies

2. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

3. Shell Programming and Scripting

How to exclude top level directory with find?

I'm using bash on cygwin/windows. I'm trying to use find and exclude the directory /cygdrive/c/System\ Volume\ Information. When I try to use the command below I get the error "rm: cannot remove `/cygdrive/c/System Volume Information': Is a directory. Can someone tell me what I am doing... (3 Replies)
Discussion started by: siegfried
3 Replies

4. Solaris

Difference between run level & init level

what are the major Difference Between run level & init level (2 Replies)
Discussion started by: rajaramrnb
2 Replies

5. Shell Programming and Scripting

How to parse filename and one level up directory name?

Hello Experts, I need little help with parsing. I want to parse filename and one level up directory name. sample $1 will consists of /home/username/ABC1/rstfiles4.log /home/username/ABC4/rstfiles2.log /home/username/EDC7/rstfiles23.log /home/username/EDC6/rstfiles55.log... (8 Replies)
Discussion started by: Shirisha
8 Replies

6. UNIX for Dummies Questions & Answers

Redirect with htaccess to upper level folder, how to?

Hello, Well I have a web with a very bad structure (a vBulletin forum) and I want it redirected to a newer folder in the same server but with a upper level folder. Current structure is: https://www.unix.com/vbulletin/upload/index.php And I want it to be:... (0 Replies)
Discussion started by: Rafaweb
0 Replies

7. Shell Programming and Scripting

How to get top level parent directory

Hi All, I have a directory like this: /u01/app/oracle/11gSE1/11gR203 How do i get the top level directory /u01 from this? Tried dirname and basename but dint help. I can this using echo $ORACLE_HOME | awk -F"/" '{print "/"$2}'. But I am trying to find out if there is a better way of doing it... (4 Replies)
Discussion started by: nilayasundar
4 Replies

8. Red Hat

SSL certificate generation on OS level or application level

We have a RHEL 5.8 server at the production level and we have a Java application on this server. I know of the SSL certificate generation at the OS (RHEL) level but it is implemented on the Java application by our development team using the Java keytool. My doubt is that is the SSL generation can... (3 Replies)
Discussion started by: RHCE
3 Replies

9. UNIX for Beginners Questions & Answers

Move all files one directory level up

I want to move all the files in a given directory up one level. For example: Dir1 Subdir1 I want to move all the files in Subdir1 up to Dir1 (then I want to ultimately delete Subdir1) Thanks, Ted (10 Replies)
Discussion started by: ftrobaugh
10 Replies
FCGIWRAP(8)						      System Manager's Manual						       FCGIWRAP(8)

NAME
fcgiwrap - serve CGI applications over FastCGI SYNOPSIS
fcgiwrap [OPTIONS] DESCRIPTION
fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it). OPTIONS
-c number Number of fcgiwrap processes to prefork. -s socket_url A URL for the listen socket to bind to. By default fcgiwrap expects a listen socket to be passed on file descriptor 0, matching the FastCGI convention. The recommended way to deploy fcgiwrap is to run it under a process manager that takes care of opening the socket. However, for simple configurations and one-off tests this option may be used. Valid socket_urls include unix:/path/to/unix/socket, tcp:dot.ted.qu.ad:port and tcp6:[ipv6_addr]:port. -h Show a help message and exit. ENVIRONMENT
When running, fcgiwrap evaluates these environment variables set by the web server calling an fcgi-script. The variables DOCUMENT_ROOT and SCRIPT_NAME will be concatenated and the resulting executable run as CGI script wrapped as FastCGI, with the remainder after the script name available as PATH_INFO. To disable PATH_INFO mangling, set up your web server to pass SCRIPT_FILENAME, which should contain the com- plete path to the script. Then PATH_INFO will not be modified. DOCUMENT_ROOT directory which the script resides in SCRIPT_NAME actual executable SCRIPT_FILENAME complete path to CGI script. When set, overrides DOCUMENT_ROOT and SCRIPT_NAME EXAMPLE
The fastest way to see fcgiwrap do something is to launch it at the command line like this: fcgiwrap -s unix:/var/run/fcgiwrap.sock Apart from potential permission problems etc., it should be ready to accept FastCGI requests and run CGI scripts. Most probably you will want to launch fcgiwrap by spawn-fcgi using a configuration like this: FCGI_SOCKET=/var/run/fcgiwrap.sock FCGI_PROGRAM=/usr/sbin/fcgiwrap FCGI_USER=nginx FCGI_GROUP=www FCGI_EXTRA_OPTIONS="-M 0700" ALLOWED_ENV="PATH" Nginx can be configured to have the arbitrary CGI cgit run as FastCGI as follows: location / { fastcgi_param DOCUMENT_ROOT /var/www/localhost/htdocs/cgit/; fastcgi_param SCRIPT_NAME cgit; fastcgi_pass unix:/var/run/fastcgi.sock; } AUTHOR
fcgiwrap was written by Grzegorz Nosek <root@localdomain.pl> with contributions by W-Mark Kubacki <wmark@hurrikane.de>. This manual page was written by Jordi Mallach <jordi@debian.org> (with contributions by Grzegorz Nosek) for the Debian project (and may be used by others). Jun 3, 2010 FCGIWRAP(8)
All times are GMT -4. The time now is 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy