Ubuntu Servers :: Running Php Files Without Setting Read / Write Permission?
Jun 26, 2010
On an Apache2 server someone else setup, I have a folder with drwx--x--x permission and the php file can still write in the folder. But on my own setup, I need to set the same folder to drwx--x-wx. Inside the folder, I have a index.php that runs just by setting rwx--x--x but on my own setup, I need to allow read permission for others/group before it can run: rwxr-xr-x (or else I get a blank page). I tried changing the folder and files to root but it's the same.
View 5 Replies
ADVERTISEMENT
Jan 14, 2009
I am trying to setup my webserver and I am trying to make a website to run under suexec but somehow I cannot start my apache it directly fails and SELinux is giving me errors and don't really know what to do with it, it is giving me some command to type but not sure if this will make my server less secure. The SELinux error is as follow:
Code:
Summary:
SELinux prevented httpd reading and writing access to http files.
Detailed Description:
SELinux prevented httpd reading and writing access to http files. Ordinarily httpd is allowed full access to all files labeled with http file context. This machine has a tightened security policy with the httpd_unified turned off, this requires explicit labeling of all files. If a file is a cgi script it needs to be labeled with httpd_TYPE_script_exec_t in order to be executed. If it is read-only content, it needs to be labeled httpd_TYPE_content_t, it is writable content. it needs to be labeled httpd_TYPE_script_rw_t or httpd_TYPE_script_ra_t. You can use the chcon command to change these contexts. Please refer to the man page "man httpd_selinux" or FAQ [URL] "TYPE" refers to one of "sys", "user" or "staff" or potentially other script types.
Allowing Access:
Changing the "httpd_unified" boolean to true will allow this access: "setsebool
-P httpd_unified=1"
Fix Command:
setsebool -P httpd_unified=1
I will write down how I did setup my server so maybe you can see a mistake I did. First I changed my Apache httpd.conf I added the following to it:
Code:
NameVirtualHost 192.168.1.2:80
<VirtualHost 192.168.1.2:80>
ServerName localhost
DocumentRoot /var/www/html
DirectoryIndex index.html index.html index.shtml index.php
</VirtualHost>
<VirtualHost 192.168.1.2:80>
SuexecUserGroup ulyaoth ulyaoth
ServerAdmin webmaster@ulyaoth.org
ServerName test.ulyaoth.org
DocumentRoot /var/www/ulyaoth/www/html
ErrorLog /var/www/ulyaoth/logs/error_log
CustomLog /var/www/ulyaoth/logs/access_log common
DirectoryIndex index.html index.htm index.shtml index.php
ScriptAlias /cgi-bin/ /var/www/ulyaoth/www/cgi-bin/
<Directory /var/www/ulyaoth/www/cgi-bin/>
AllowOverride none
Order allow,deny
Allow from all
Options +execCGI
AddHandler cgi-script .cgi .pl
</Directory>
</VirtualHost>
Then I created the username "ulyaoth" with the group "ulyaoth" as I specified with my suexec, then I created all the directories as specified in my httpd.conf and "chown ulyaoth:ulyaoth (dirname)" them to the right group and username.
View 10 Replies
View Related
Feb 4, 2010
What are the possible problem when Windows access the file from Ubuntu got Read Only even though have a full permission to read, write and execute the file? Ubuntu to Ubuntu accessing the file there is no problem only Windows got a problem.
View 1 Replies
View Related
Dec 21, 2010
I have a file the owner is root:root ( mode is 644 ), I want to release read & write permission to a non root user ( eg. admin_usr ), I tried to create a specific group ( eg. ADM ) and release it to root user and admin_usr ( by adding this users to ADM in /etc/group ) , but it is not work, if preserve the file mode to 644 , is it ok? how to do it if I want to have read & write permission in my case ?
View 5 Replies
View Related
Feb 4, 2011
allow specific user permission to read/write my folder
I have a folder called /TAR/Sketch
I added a new user, named Snoopy, I want to grant this user the ability to add files & directories to this folder which is under the group Sketches and the owner is me.
How can I accomplish this ?
View 1 Replies
View Related
Aug 6, 2010
On one of my machines the DVD/DVDRW/CDROM drive appears as /dev/hdc and is not identified as an optical drive by HAL. It is owned by root: disk and thus no users get permission to read/write in the device (not even those in the cdrom group). This stops playing DVDs, ripping CDs, no notifications appear when a disk is inserted, etc. etc. When I set the permissions for all to read/write from the device then users can access but still no notifications are shown.
On all my other machines the optical drive is identified as /dev/sr0 and is owned by root:cdrom . All have Slack 13.1 . Previously with Slack 12.2 this machine still had the drive in /dev/hdc but the permissions were right (I think because I added it to /etc/fstab with options for users to access it). I believe the problem is down to HAL not setting this drive to the correct group, but how do I fix it? I hate HAL, it has a mind of its own, just like in the scifi movie
View 2 Replies
View Related
Apr 23, 2011
I Have Configure Samba server in Centos, I need give permission like for some user(5User) can able to read and write the particular folder, and again i need give some another user(6user) can only read permission for same folder.
View 1 Replies
View Related
Mar 31, 2010
I am using sun micro system. We have installed fedora in that. I want to know how to give R/W permission to a external hdd...
View 1 Replies
View Related
Jul 25, 2011
I just have installed Fedora 15 to use it for multimedia server. I have installed also samba. Now I'm trying to access it from another PC (Windows 7) and I have no write access.
Code:
[root@echo mnt]# ls -l
total 12
drwxr-xr-x. 2 root root 4096 Jan 1 2006 boot
[Code]....
i just read whole internet (i have spend over 6h for reading and testing a lot of options and nothing...)
View 9 Replies
View Related
Nov 9, 2010
I am having difficulties assigning permission for wordpress to write files. I am having problems with the permalink within wordpress and I think it might be because of the level of permission wordpress has. Currently on my system I need to set permission to 777 in order for wordpress to write to the .htaccess file.
I am running my website on a Ubuntu machine. Version 10.10 Apache2 2.2.4
However, when I leave the permission level set to 777 I still cannot get the permalink to point to the corrent page......See my discussion on this here. [URL]
I think what I need to do is change wordpress to use a user permission or a group permission and not "everyone". I would rather have wordpress setup to login as a specific user before it can write over a file.
View 5 Replies
View Related
Nov 26, 2010
Following the last update bringing kmail 2.0.89 it does not start any more. I get a popup signaling a fatal error : "no read/write permission to your inbox folder". But these permissions have not changed. And even if I move away the Mail folder and try to start kmail I get the same message.
[code]...
This kmail version given by YAST is : 4.5.80-261.1
View 3 Replies
View Related
Jan 12, 2010
i know that chmod +x makes a certain file executable but how do i make a file read and write.
View 3 Replies
View Related
Jul 13, 2010
I'm a new Ubuntu user, I just installed Ubuntu today and I'm loving it. But this issue has been driving me nuts all day, I've searched for hours for something like this and all posts were about external hard drives. I installed Ubuntu 10.04 on my MBP 13" then dual booted into Ubuntu. I can mount and access my MBP hard drive, but when it comes to the Mac home user files, I don't have permission to even READ.
How can I change that? I tried doing so by dual booting into Mac and changing the folder permissions and also making them shared folders but nothing worked.
View 1 Replies
View Related
Jun 14, 2011
I've extracted a few files through the archive manager through Ark (as well as through the command line) and some folders/files that were originally in Japanese are not properly displayed in the terminal or file browser. I can't delete them nor open them; I am informed that this file does not exist.I am running Kubuntu 11.04. I had a similar problem in Ubuntu 10.04 in that the text was not displayed properly, but the files were readable and writable.
View 2 Replies
View Related
Mar 23, 2010
i have setup a samba server and created samba shares on it, i have configured the samba server to authenticates users from a windows server 2003 DC,
i have 2 shares call IT and MYSHARE, I want to give read and write permissions to sevaral users to those two shares and read only permisson to all the other users.
i tried editing the smb.conf file with the following settings , but no one can write or modify the files in the shares including the users specified in the
write list = cweerasinghe,njayarathna.
[IT]
writeable = Yes
browseable = yes
public = no
comment = IT share
[Code]....
how can i give access to the write list = cweerasinghe,njayarathna users to
read, write and modify the files in the shares ??
View 4 Replies
View Related
Sep 8, 2009
Such as the title
View 2 Replies
View Related
Sep 23, 2009
I can't copy a few files from my pen drive. Got the files from a public computer, with windows. I use fedora 10.
cp gives the following error--->
cp const1.java /home/user1/Documents/scjp
cp: cannot open `const1.java' for reading: Permission denied
lsattr shows this--->
lsattr const1.java
lsattr: Permission denied While reading flags on const1.java
mount shows this--->
/dev/sdc1 on /media/disk type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
View 3 Replies
View Related
Jan 28, 2011
I have a file server running 10.04. I have a user that belongs to 2 groups (users is the primary and IT is the secondary). I have permissions set up so that this user and other users that belong to the IT groups can read/write files and others have no permissions whatsoever. I have also set the umask to 0007 so that any files created have the effective permissions. My concern is this: since my primary group is users, is it possible for me to create files with the owner group IT for only this specific folder?
View 2 Replies
View Related
May 2, 2011
Recently i formatted my HDD into 5 partition namely :-
1) Win Vista
2) Ubuntu /
3) Home
4) Swp
5) EXT4 (Purpose is to share files between ubuntu and vista)
I'm wondering if its possible to install Virtual Box on both OS but pointing only to 1 virtual machine.
Also if its possible to permanently mount the shared partition on both OS.
View 2 Replies
View Related
May 2, 2011
I had to reinstall Ubuntu (Natty) on a brand new computer and while installing I setup the datas partition to be mounted in /usr but now I can't have access to files I put in there even if I setup the group/user permission! I can accezz /usr/Music but all files are locked
View 5 Replies
View Related
Apr 8, 2011
So I finally managed to get my Samba file server working () but now I have a question. On the server I have 4 folders, each being used for a certain topic. How would I set the folders as read only but not the contents, so that way remote users can read/write to the folder but can't delete or rename the folder itself? Also, if I restart the Linux box it will cease to show on the Windows Network unless I delete the Samba share and remake.
View 1 Replies
View Related
Mar 21, 2011
i am using Ubuntu 10.10 and login using root on terminal but when i want to edit any file i get this error
"Warning: No write permission" Also see the result of dhcp restart
root@webmin:~# /etc/init.d/dhcp3-server restart
* Stopping DHCP server dhcpd3 [fail]
* Starting DHCP server dhcpd3 chown: changing ownership of `/var/lib/dhcp3': Read-only file system
chown: changing ownership of `/var/lib/dhcp3/dhcpd.leases': Read-only file system
chown: changing ownership of `/var/lib/dhcp3/dhcpd.leases~': Read-only file system
* check syslog for diagnostics.
My System was working fine in the morning..what happened i dont know and i m very confused about this situation
View 6 Replies
View Related
Mar 5, 2011
Me and 2 others are working on a website (Bob, Mike, and Joe). We made a group called developers and each of us are in the developers group. The Apache server runs as www-data. When we upload files, the file owner is the users name and the group is "developers".
/etc/group has the following
Code:
www-data:x:33:
bob:x:1000:
mike:x:1001:
[Code]....
I have always just set everything to 775 and just called it good. Well I don't want to wake up to a Russian political message plastered all over the site. It's time I do things properly.
View 3 Replies
View Related
Jan 2, 2010
I just set up an VPS with ubuntu. I made a user1 and gave it ownership
Code:
chown -R user1 /home/www
This user also have been given all the root privileges (I know it is not recommended!)
The problem is that each time I make new site, and user1 wants to upload (through ftp) files to /home/www/newsite I need to redo the the above command in order to be enable user1 to upload. Not only this, I need to rework permissions (744 for folders and 644 for files), otherwise the newsite throws permission errors message.
View 2 Replies
View Related
Jun 23, 2010
My server is not accessible any longer locally (192.168.0.2). If I attach a keyboard and login (I have done one pass of recovery from the Ubuntu live CD which helped) and check the IP address it seems to be set. However looking at the syslog file there is a line which says ext3-fs: info: recovery required on read only files system.
Is there a more extensive ext3 recovery facility I can use bearing in mind I will not (?) be able to install it?
I think I'm running 8.6 but not sure where to look to find it.
View 4 Replies
View Related
May 31, 2011
I know a guy who has a website setup where he can download files from Megaupload with his premium account without signing in. He takes the MU link's ID, eg: URL... adds it to the end of the URL (URL...) and it downloads using the premium account logged in on the computer he has his site hosted on. We don't get along well and I would rather not ask him how he does it.
How would I set this up on my own computer? I can see this being extremely useful for me if I need to download some of my artwork or projects from MU but I don't want to sign in because I'm on a public computer or something. I already have everything installed on my computer to host a site. I have a simple "Hello World" page running on my webserver right now. I don't need help getting that part set up, just the rest of it.
View 1 Replies
View Related
Jun 4, 2011
The original thread was closed because "Sounds as if you are trying to steal a service which you have not paid for. We do not support that kind of activity here on Ubuntu Forums." However, it's not stealing since I am only going to use this with accounts that I have legitimately paid for.This might not be the right place to post this... if that's the case, I apologize - please move it to the correct location.I know a guy who has a website setup where he can download files from Megaupload with his premium account without signing in. He takes the MU link's ID, eg: http://www.megaupload.com/?d=xxxxxxxxand adds it to the end of the URL (http://192.168.1.199/mu/?d=xxxxxxxx) and it downloads using his premium account logged in on the computer he has his site hosted on. We don't get along well and I would rather not ask him how he does it.
How would I set this up on my own computer to use my premium account? I can see this being extremely useful for me if I need to download some of my artwork or projects from MU but I don't want to sign in because I'm on a public computer or something or because the computer has MU blocked. I want this to be a private site that only I have access to since it's my premium account and my money. I am not asking how to circumvent megauploads download limit at all (I've already paid for it... no need to circumvent it).
I just need a nudge in the right direction. Thanks in advance for any help you can provide.I already have everything installed on my computer to host a site. I have a simple "Hello World" page running on my webserver right now. I don't need help getting that part set up, just the rest of it. I assume this has something to do with setting up a proxy server - I just don't know how to do that and make it work like I need it to.
View 3 Replies
View Related
May 31, 2010
Im having trouble setting my SAMBA server correctly. I have two Win machines, one with WIN7 and one with XP. I have one Ubuntu machine and Ubuntu Server 10.04. My problem is that I can only acess files from the Win 7 Machine. When I try to map out the shared dirs on my serverI get asked for user and password, when I enter my creditensials it dosent help.. What to do? I used the sample smb.conf file and open for no restrictions..
[Code]....
View 9 Replies
View Related
Sep 2, 2010
I have a few ubuntu servers which have samba shares on the network and for the most part have had little trouble with them. Recently we purchased a few iMac's for one of our deptartments and, while we're able to access the shares, all the files on them are read-only and we are unable to delete/modify files using the iMacs. This is not an issue with any of our windows machines (W2K, WinXP, Vista).
View 2 Replies
View Related
Apr 17, 2010
I have installed Fedora 12 x86_64 and vsftpd. I would like to set up an user for FTP so that he/she could only view/edit files in one certain folder (the one that I set up). How would I go about doing that?
View 2 Replies
View Related