Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

Permissions

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
fpoyavo
Asked:
fpoyavo
1 Solution
 
zberkeCommented:
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
 
da99rmdCommented:
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
 
tolgadalkilicCommented:
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
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

 
fpoyavoAuthor Commented:
Still can download  scripts just typing path in browser ...What's next ?
0
 
fpoyavoAuthor Commented:
Should I login as user or root to make it work ?
0
 
fpoyavoAuthor Commented:
I ried both no luck :(
0
 
da99rmdCommented:
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
 
fpoyavoAuthor Commented:
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
 
da99rmdCommented:
with run you mean run not download ?

Try puting just x on user and group on the scripts

/Rob

0
 
fpoyavoAuthor Commented:
da99rmd,

Yep. You mean to assign execute only ?

Thank you.
0
 
fpoyavoAuthor Commented:
Can anybody help ?
0
 
da99rmdCommented:
chmod 111 (the file)
/Rob
0
 
fpoyavoAuthor Commented:
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
 
da99rmdCommented:
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
 
fpoyavoAuthor Commented:
da99rmd

It is not true for Javascript.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now