LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-28-2008, 08:15 AM   #1
vwvr9
Member
 
Registered: Feb 2005
Distribution: OpenSuse 10.1 / Centos 4.4
Posts: 60

Rep: Reputation: 15
Access files outside the document root for Apache


I sorta stuck.

My main site is hosted out of /var/www/html/ . I have a user processing php file /home/user/scripts/process.php .

I am (actually my client) trying to setup sub-domains which will directly access the the process.php file without publishing that file.

Is this possible? mod_rewrite only handles the url namespace so I guess that won't work.

Any advice?
 
Old 07-28-2008, 09:21 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,537

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
If your intent is to have the 'process.php' file outside the standard /var/www/html you should have a public_html directory in your user directory: /home/vwvr9/public_html. You need to have 'public_html' listed under User Directory in your httpd.conf file for apache. If you don't have the public_html directory, create and put your 'process.php' file there. To access this in the browser you do the standard entry for localhost and add '~vwvr9/process.php' to the entry.

Not sure if this is what you want?
 
Old 07-28-2008, 03:23 PM   #3
vwvr9
Member
 
Registered: Feb 2005
Distribution: OpenSuse 10.1 / Centos 4.4
Posts: 60

Original Poster
Rep: Reputation: 15
Hi Yancek, I guess that will work but the process.php file is still published to the web right?

I was thinking of using "include" or "require" in my index.php file to call process.php from the non-document root.

What you think?
 
Old 07-28-2008, 05:28 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,537

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
I'm not really sure I understand what you are trying to achieve? If you don't want others to access limit permissions?
 
  


Reply

Tags
apache



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache - change document root? squall14716 Linux - Software 2 01-20-2010 10:16 AM
Apache 403 access denied outside of document root freedo5 Linux - Software 2 09-21-2005 08:06 PM
Apache 2: won't allow document root to be changed, plus more QtCoder Linux - Networking 1 11-06-2004 04:44 PM
Apache doesn't allow non-document-root access in default setup jenna_h Mandriva 1 10-28-2003 07:07 PM
Document Root in Apache Hal Linux - Newbie 2 10-28-2003 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:32 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