LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-12-2007, 05:58 PM   #1
lazybowel
LQ Newbie
 
Registered: Mar 2007
Posts: 10

Rep: Reputation: 0
Apache help...


Hi, im trying to run a cgi script i wrote that requires to load/save some files, my question is how can i load/save a file from the script from a location other than htdocs for example in the root directory /usr/local/apache/stuff. When i run $test = '../stuff/file.txt'; it wont find the file but when i put the file anywhere in the htdocs folder it finds it. The purpose being i don't want those files to be visible to everyone.
 
Old 06-12-2007, 06:07 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Aapche (the user that runs apache process) needs the ability to write to another directory (given it's full path in your script most likely).
 
Old 06-12-2007, 06:34 PM   #3
lazybowel
LQ Newbie
 
Registered: Mar 2007
Posts: 10

Original Poster
Rep: Reputation: 0
ok i just got that to work with chmod of the dir. however i have another question now once it loads the file and processes it the script outputs an image that is also saved in that folder outside of htdocs. now how can i get the script to display that picture in the browser <img src="../saved/pic.jpg"> it gives me an error and if i put the whole path it also gives me an error.
 
Old 06-12-2007, 08:29 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by lazybowel
ok i just got that to work with chmod of the dir. however i have another question now once it loads the file and processes it the script outputs an image that is also saved in that folder outside of htdocs. now how can i get the script to display that picture in the browser <img src="../saved/pic.jpg"> it gives me an error and if i put the whole path it also gives me an error.
That's where you need to setup apache to serve that directory. Easiest way most likely is to create a symlink to it and allow symlinks in the httpd.conf for your server or root directory for apache.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Developing Modules for Apache - The Apache Module Book LXer Syndicated Linux News 0 05-11-2007 09:01 PM
Mail from Apache being rejected - Cannot route to sender apache@localhost.localdomain jimwillsher Linux - Networking 2 01-19-2006 12:41 AM
Apache 1.3.33 (debian built) and Apache SSL does not respond to the proper ports lqorg_user Linux - Networking 0 11-06-2005 04:11 PM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration