Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6550033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:09:59+00:00 2026-05-25T12:09:59+00:00

I am on a Parallels/Plesk VPS host, and this is a really newbie question.

  • 0

I am on a Parallels/Plesk VPS host, and this is a really newbie question.

The webroot is at:

/var/www/vhosts/my-domain-name/httpdocs

There is also a path called:

/var/www/vhosts/my-domain-name/private/

But PHP scripts can’t seem to read files in there.

From my understanding any file placed within the webroot, is in danger of being served to the public if requested by its web-path/filename. I am vaguely aware of the use of .htaccess files to tell Apache not to serve certain files/dirs.

But can (or should) I place my sensitive file somewhere outside of the webroot, while still allowing it to be read by PHP scripts?

Thank you!

Here were my errors when trying to read a file within the “private” folder above:

Warning: file() [function.file]: open_basedir restriction in effect. File(../../private/test.txt) is not within the allowed path(s): (/var/www/vhosts/blah.com/httpdocs:/tmp) in /var/www/vhosts/blah.com/httpdocs/misc/testscript.php on line 8

Warning: file(../../private/test-dt.txt) [function.file]: failed to open stream: Operation not permitted in /var/www/vhosts/blah.com/httpdocs/misc/testscript.php on line 8

UPDATE: SOLVED

Picto at reddit/r/PHPHelp gave me what I needed, and it is specific to Plesk systems.
I had to write a file called vhost.conf placed in the conf folder which exists at the same level as httpdocs. And in the vhost.conf, I used:

<Directory /var/www/vhosts/my-domain-name/httpdocs>
php_admin_value open_basedir /var/www/vhosts/my-domain-name/httpdocs:/tmp:/var/www/vhosts/my-domain-name/myfolder
</Directory>

So I now place my sensitive files in “myfolder”, which is outside of the webroot (httpdocs).
After this, to make these settings take effect, (restarting Apache doesn’t work) there are some Plesk specific commands to give, see: http://www.gadberry.com/aaron/2006/02/09/plesk_vhost/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:10:00+00:00Added an answer on May 25, 2026 at 12:10 pm

    It’s a good practice store sensitive data outside apache document root.

    You need to allow PHP to access these folders adding or modifying the Virtual Host configuration.

    Look for
    php_value open_basedir

    and add your folders separated by a colon (:)

    More info at open_basedir

    Note: there is a few security issues with open_basedir, explained in

    http://www.hardened-php.net/advisory_012004.42.html

    EDIT:

    I use this tree structure for each domain:

    domain/            www-data permisions
    ├── etc            r-x
    ├── log            rwx
    ├── phpCache       rwx
    ├── phpFiler       rwx
    ├── phpInclude     r-x
    ├── phpLogs        rwx
    ├── phpSession     rwx
    ├── phpTmp         rwx
    ├── phpTrash       rwx
    ├── privat         --- 
    ├── www443         r-x
    └── www80          r-x
    

    etc: for application configuration files.

    log: for Apache or nginx log files

    phpCache: for Zend_Cache files

    phpFiler: for app’s files, a PHP script serves it if the user has privileges.

    phpInclude: php_value include_path

    phpLogs: for application logs

    phpSessions: for store this virtual host data sessions.

    phpTmp: for temporal files, like uploaded.

    phpTrash: a trash for phpFiler.

    privat: for my private pourposes

    www443: for https document root

    www80: for http document root

    In open_basedir clausule I put all folders except log and privat.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have registerd my own domain name and web hosting space too on parallels
I have Parallels Plesk 9.2.1, Debian 4 and 5.2.0-8+etch13 Is it safe to upgrade
Like described in the docs.. http://download1.parallels.net/Plesk/PP10/10.2.0/Doc/en-US/online/plesk-api-rpc/index.htm?fileName=53497.htm It should be possible to change the home-location
I don't know how to create a database into Parallels Plesk Panel, so I
I upgraded Parallels Plesk 10 yesterday using apt-get or aptitude. Now when I run
I've installed parallels desktop on my MacBook to be able to run Visual Studio
I'm running visual studio 2010 on Windows 7 through parallels on my mac. I
I have everything same in 10.04 LTS, local in parallels 7 On ec2 instances
I'm on Mac running parallels with windows XP and IE8 installed. The options I
We have a system built by Parallels, which is relying on a huge (800+)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.