LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-28-2005, 09:35 AM   #1
phuongbd
LQ Newbie
 
Registered: Mar 2005
Location: VietNam
Posts: 21

Rep: Reputation: 15
Help me!!


I made config apache 2 and tomcat 5 on fedora1 , after I make security for apache :
<Directory /myproc>
AuthName Security
..................
AuthUserFile /etc/pwapache
require user phuong
....................
</Directory>

Now , I want create 1 database with database:
phuong:folderX map with folderY
user2:folderA map with folderB
......................................
When I login with user phuong , folderX will map with folderY
I dont want use MySQL or database others , I want mydatabase is a file same file text on Windows
Please help me!! Help me !!
 
Old 05-28-2005, 04:37 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
please use useful thread titles in future, thanks.
 
Old 05-29-2005, 09:11 PM   #3
phuongbd
LQ Newbie
 
Registered: Mar 2005
Location: VietNam
Posts: 21

Original Poster
Rep: Reputation: 15
Who can help me? Please hepl me!! Please!
 
Old 05-30-2005, 05:08 AM   #4
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
Your scenario needs more elaboration for any one to help you please elaborate
 
Old 05-30-2005, 08:46 AM   #5
phuongbd
LQ Newbie
 
Registered: Mar 2005
Location: VietNam
Posts: 21

Original Poster
Rep: Reputation: 15
I want map folder with folder in linux when I login on apache , use JSP or servlet, example
When I login on apache http://localhost/myproc/ apache will require I enter username and password because I make config apache :
<Directory /myproc>
AuthType Basic
AuthName "Admin for Apahce security"
AuthUserFile /etc/pwapache
require user phuong
</Directory>
When I enter username and password , apache will search in mydatabase, example file database:
phuong:/var/www/html/folderA map with /var/www/html/folderB
user2:/var/www/html/folderC map with /var/www/html/folderD
user3:/var/www/html/folderE map with /var/www/html/folderF
....................................................................................................
Now, I want when I login with user phuong , apache will help me go to folderA or folderB, after I will copy folderA to folderB or folderB to folderA

Can you help me, please!!! Thanks
 
Old 05-30-2005, 08:51 AM   #6
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
fine u can write down a script which will do the mapping for u as needed as place the script to run after u login to apache
 
Old 05-30-2005, 08:53 AM   #7
phuongbd
LQ Newbie
 
Registered: Mar 2005
Location: VietNam
Posts: 21

Original Poster
Rep: Reputation: 15
Yes, I want write script with JSP or servlet, Can you help me , please?
 
Old 05-30-2005, 08:55 AM   #8
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
JSP or servlet script is fine but in case of linux you need to write down the scripts in C.

By the way which shell do you use
 
Old 05-30-2005, 08:58 AM   #9
phuongbd
LQ Newbie
 
Registered: Mar 2005
Location: VietNam
Posts: 21

Original Poster
Rep: Reputation: 15
Yes, thank you.
Can you write script in C ? Can you help me,now ? I needed it
 
Old 05-30-2005, 09:26 AM   #10
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
ok i will help you to write down a script in C but first of all I need to understand the whole scenario specially
Quote:
phuong:/var/www/html/folderA map with /var/www/html/folderB
What exactly is needed and why
 
Old 06-02-2005, 10:32 PM   #11
phuongbd
LQ Newbie
 
Registered: Mar 2005
Location: VietNam
Posts: 21

Original Poster
Rep: Reputation: 15
Yes, I needed it because I make programming about update web, I need map 2 folder, after I will copy folder1 to folder2. That all!!
Can you help me ? Bramhastra, please !!
 
Old 06-03-2005, 12:10 AM   #12
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
No scripting necessary (and JSP would be just fine ... what with it being a JSP server he's working on):

EDIT: This goes in your Apache config for the VirtualHost in question, in case it's not obvious.
Code:
RewriteEngine On
RewriteCond    %{REMOTE_USER} phuong
RewriteRule     /folderA/(.*)$      /folderB/$1 [L]

RewriteCond    %{REMOTE_USER} user2
RewriteRule     /folderC/(.*)$      /folderD/$1 [L]

RewriteCond    %{REMOTE_USER} user3
RewriteRule     /folderE/(.*)$      /folderF/$1 [L]
note that you might need [L,PT] on the end there, if it's passing off to a JSP page, and that (obviously) this would get out of hand pretty quickly for very many users. If that becomes an issue, look at rewritemap

HTH


Last edited by sigsegv; 06-03-2005 at 12:13 AM.
 
Old 06-03-2005, 05:20 AM   #13
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
Ok fine if the above description works for u will be glad to hear that else you are always welcome
 
Old 06-07-2005, 08:47 AM   #14
phuongbd
LQ Newbie
 
Registered: Mar 2005
Location: VietNam
Posts: 21

Original Poster
Rep: Reputation: 15
Thank you, I hope I will make good that
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration