Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Permissions

Posted on 2004-04-19
15
Medium Priority
?
228 Views
Last Modified: 2010-04-20
Hi Experts,

I have some javascript files in /scripts directory and need to set permissions so that only webserver can read and execute them

Thank you.
0
Comment
Question by:fpoyavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
15 Comments
 

Expert Comment

by:zberke
ID: 10865250
chown -R apache.apache /scripts

or replace apache.apache with nobody.nogroup -- or www.www

depends on what user your web server runs as.

if you're running apache, look for the line in httpd.conf that looks like this:
User apache
Group apache

If it says the above, use "apache.apache"
If it says

User nobody
Group nogroup

then use nobody.nogroup...

etc.

Clear?
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10866673
then alter the perms of the files to
chmod 750 -R /scripts
Then just the apache.apache with nobody.nogroup -- or www.www
will be able to use them.

/Rob
0
 
LVL 3

Expert Comment

by:tolgadalkilic
ID: 10868215
chown -R username directory (use the user that is specified in the httpd.conf file, directory is the /scripts directory)
chmod 700 -R directory
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 1

Author Comment

by:fpoyavo
ID: 10870771
Still can download  scripts just typing path in browser ...What's next ?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10870791
Should I login as user or root to make it work ?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10870818
I ried both no luck :(
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10876396
You hve to make settings in the server not to download from that dir.
 <Directory "/script">
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
  </Directory>
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10882538
da99rmd,

I have added it to httpd.conf as:

<Directory "/opt/myapp/tomcat/webapps/mydir/script">
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
  </Directory>

Restarted server and No Luck. I still can download them :(.

Thank you.
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10886260
with run you mean run not download ?

Try puting just x on user and group on the scripts

/Rob

0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10892088
da99rmd,

Yep. You mean to assign execute only ?

Thank you.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10959728
Can anybody help ?
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10975448
chmod 111 (the file)
/Rob
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10978654
da99rmd,

The problem is that 111 actualy blocks from read access by application. Javascript has to be read
and then executed.

I doubt that there is any solution to it.

Anybody would argue ? :)

tHANK TO ALL. I am really confused ...why there is no way to make Javascript to be accesable by
web app only.
0
 
LVL 8

Accepted Solution

by:
da99rmd earned 2000 total points
ID: 10984198
When you have this on the dir
<Directory "/opt/myapp/tomcat/webapps/mydir/script">
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
  </Directory>

The server will not allow donload not on my server any way just running.

/Rob
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 11068376
da99rmd

It is not true for Javascript.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question