Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-13-2007, 09:23 AM   #1
LQ Newbie
Registered: Jun 2007
Posts: 7

Rep: Reputation: 0
Best file location for include files

We are developing in php on our linux server and want to put the include files outside the var/www/html structure for security reasons, what is the best location to put these files ?

Is this more secure ?

Is /usr/include a good location ?

Or /usr/src ?

Last edited by Flip69; 06-13-2007 at 09:35 AM.
Old 06-13-2007, 10:21 AM   #2
Registered: Jun 2007
Location: London, Athens
Distribution: Debian, Ubuntu
Posts: 36

Rep: Reputation: 15
It doesn't really matter where you have your include files, as long as the directory and files have the right permissions (right permissions = the minimum permissions needed for the application to be able to read them only and nobody else to access them).

If you want a suggestion, I would put it in /usr/local/include/

(the /local/ usually means that what follows is not part of the system, but to the local application(s)/service(s))

Or create something more tailor made like:

/usr/local/<your company's name>/include

Stick more to the permissions than the path...
Old 06-13-2007, 10:26 AM   #3
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
My tree looks something like
 +-- site1
       +-- web
       +-- include
Web is the document root for a site. In your situation, I would put it next to the html directory. For me, it gives the advantage that the include files 'stay' with the corresponding site (in case you host multiple sites like I do).

It's more secure as a browser can not access pages that are not under the document

Last edited by Wim Sturkenboom; 06-13-2007 at 11:00 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
X include files Gonto Linux - Software 8 01-22-2006 03:42 AM
tar.gz file did not include install file |Spec-ops Linux - Newbie 12 11-17-2005 08:25 AM
location of kernel /usr/src/linux/include ??????? Lord Lance Mandriva 7 12-13-2003 07:41 AM
X include files evian Linux - General 6 03-25-2003 03:53 PM
GTK-2.0 and include files Hubas Programming 2 03-15-2002 07:35 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:27 PM.

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