Solved

Permissions

Posted on 2004-04-19
15
222 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
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can I get powershell to show the history of commands used ? 10 65
VMware Workstation 12 Player 16 125
000webhost.com default error log 1 40
linux 13 75
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

860 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