473,651 Members | 2,750 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Baffling apache fopen/fputs permissions issue (not the typical question)

2 New Member
I have a new server RHE4 and I am having an issue I have never had before and it's kind of urgent.

Running Apache 2.0 I need the web server to have writable access and getting denied - I'm pretty sure my users/groups/permissions/etc are all good.

Apache is running as user apache group ftpusers.
server root for default server is at the top /export/home
chowned to apache and grped to ftpusers recursively.
Even so with permissions -777 on the whole tree I get permission denied. This simple script shows the error - this is a vhost under root in apache but again - the entire tree is currently set to 777 (obviously this will change when I figure out WTF)

This is a very basic script - lives at /export/home/sites/2point0/TPO-IP/html/simpletest.html chmod 777 owner apache group ftpusers.
Expand|Select|Wrap|Line Numbers
  1. .. if($_REQUEST['submit']){
  2.     $handle = fopen($_SERVER['DOCUMENT_ROOT']."/testfile.txt","w+");
  3.     fputs($handle,"test this out");
  4.     fclose($handle);
  5. }
  6. ..
http://2point0media.co m/simpletest.html

Warning: fopen(/export/home/sites/2point0/TPO-IP/html/testfile.txt): failed to open stream: Permission denied in /export/home/sites/2point0/TPO-IP/html/simpletest.html on line 2


Thanks to any and all - I searched for a while for a similar situation - mainly the posts are people having users and groups mismatched - helP!
Jun 13 '07 #1
3 3108
Motoma
3,237 Recognized Expert Specialist
Do you have SELinux enabled? I am not a big fan of it, it tends to alter the traditional way that Linux deals with security by adding another layer.

Get back and let us know.
Jun 13 '07 #2
bluedogsd
2 New Member
Sure enough - it's enabled - I was unfamiliar with that. Turned it of and I am good to go.

I can't thank you enough - seriously - you are my hero right now and I appreciate it beyond explanation! I knew I was about as knowledgable at least as the tier 2 people at my hosting place and they were spinning me in circles.

Thanks for the simple tip that saved my day!!!!!!
Jun 13 '07 #3
Motoma
3,237 Recognized Expert Specialist
Sure enough - it's enabled - I was unfamiliar with that. Turned it of and I am good to go.

I can't thank you enough - seriously - you are my hero right now and I appreciate it beyond explanation! I knew I was about as knowledgable at least as the tier 2 people at my hosting place and they were spinning me in circles.

Thanks for the simple tip that saved my day!!!!!!
Hey! Your post made my day! I'm glad you got everything working out. Come back any time you have a problem.
Jun 13 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2922
by: JDJones | last post by:
I'm trying to write a script that will read from a text list of songs that I burned onto my CD (Albums011.txt), then write to the database text the new text made ready for inserting into a database. The entries from the Albums011.txt look like this: Wayne Newton - Wild Cool & Swingin' - 03 - But Not For Me.mp3 Wayne Newton - Wild Cool & Swingin' - 04 - Wives And Lovers.mp3 etc. and I want to manipulate it them to look in the...
5
2963
by: Shaoyong Wang | last post by:
Dear All, I want to write a simple PHP code to verify whether a given list of URLs is broken or not. The URLs given have various formats, for example, http://www.afro.com/history/history.html http://www.worldhistorycompass.com/index.htm http://www.afup.org/article.php3?id_article=242 fsockopen(...) only accepts target format (like www.yahoo.com etc), so I
3
2046
by: theouimets | last post by:
Is there a limit to how long a URL can be with fopen? I have a very long URL as there are lots of things to be passed some variables and some XML. It seems to get to a certain point and then produce an error with no details and just cuts it off. <?php $url = 'http://test.com/Test.dll?API=test&XML='. '&lt;FromLastName&gt;FromLast&lt;/FromLastName&gt;'. '&lt;FromFirm&gt;FromFirm&lt;/FromFirm&gt;'.
12
3301
by: Bill | last post by:
For my personal use I am accessing a railway timetable page, parsing its contents and then sending brief relevant information as the subject line of an email to be read on a mobile phone. The problem comes when I try to parse a second page, the url of which, I have derived from an initial page. I cannot go directly to the second (target) page but from the initial page derive the url and put it in a string called $strTarget In one...
2
3583
by: gruddo | last post by:
Hi this is my first post. I have two webservers. I can run php code fine on one but not the other. Both webservers can read files only one can write. I have looked around at other posts and they point at not giving permissions to the apache user. I have chmod 777 the directory /var/www/html and the subdirectory test
14
4762
by: Aaron Couts | last post by:
I have a program that writes to a log file. It's compiled on RH Linux 7.3 (Kernel 2.4.18-18.7). It's using fopen in append mode. When the file reaches 51200000 bytes in size, the program will no longer write to the file. When this happens, fopen and fputs do not return an error. I've been researching large file support for Linux, and it all has to do with the regular 2-gig file size limit. If it's something obvious, sorry -- I'm a C...
28
33129
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
16
4680
by: Hans Fredrik Nordhaug | last post by:
I'm trying to write to a file in the current directory - no remote files. The subject says it all - I can add that both the directory and the file is wordwritable. This happens on a (quite good) free hoster in Norway which doesn't use safe mode, running PHP 5.1.6 as the PHP info below shows ... Test it at: http://home.no.net/moldevbk/fopen-test/?mode=w (write - fails) http://home.no.net/moldevbk/fopen-test/?mode=a (append - ok)...
3
1592
Jacotheron
by: Jacotheron | last post by:
I have a site that needs an enrollment form. I have made the form and it works without a fault on my Apache testing server, but I have to get it to work on an IIS server. the first page should take info and send it to the next page which should echo the inputted information for the viewer to make sure everything is correct. This page then sends the data to the handler which records the information into a .txt file and redirects the viewer to the...
0
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8697
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2699
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.