Solved

Permissions

Posted on 2004-04-19
15
225 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
 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

 
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 500 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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

617 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