• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Adding a directory visible to php

F

Fildefer57

Guest
Hello,

I am almost an newbie in apache php configuration, and I need to add a directory visible to php but outside of web access on one site.

I have created a /var/www/vhosts/mydomain/conf/vhost.conf file with the following content :

<Directory /var/www/vhosts/mydomain/httpdocs/>
php_admin_value open_basedir "/var/www/vhosts/mydomain/httpdocs:/var/www/vhosts/mydomain/core"
</Directory>

I can't access the core content from the php even with 777 on the core directory.

Can you help ?

Thanks

Phil
 
Note that the Plesk Migration Manager will not migrate that custom directory, so your app would not get migrated completely if you ever wanted to migrate using PMM. It might be a good idea to just put all your files under httpdocs and protect the directories that you don't want to serve to the public via a Deny statement in either a .htaccess file or vhost.conf.
 
Thanks for your help,

As I said in my post, I HAVE to have the conf directory one level up the httpdocs, and more it will have to be accessible from both http and https...

But first thing first !
Let's start with http

I have done the vhost as previously mentionned, I have done both :
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=my-domain.com
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=my-domain.com

I may be wrong in my approach, but basically what I have to achieve is to php access (read/write) directories that are on the same level as httpdocs an hhpsdocs....


and here is the phpinfo() in an attached file, you will see no mention ofthe core directory

Philippe
 

Attachments

  • phpinfo.txt
    19.4 KB · Views: 1
Last edited by a moderator:
please note that I made a mistake in my hush work on domain name sometime I put mydomain, sometime my-domain, it is just a post processing man error, everything is coherent in the real site. ;-)
 
Let's start at the beginning. Did websrvmng add an Include statement for the vhost.conf in /var/www/vhosts/mydomain/conf/httpd.include?
 
I have absolutly no idea how to know that !

What I know is that vhost.conf and vhost_ssl.conf does change things...

I finally manage to have read and write access to the directories with the following directives :

AddHandler fcgid-script .php
SuexecUserGroup arrive psacln
<Directory /var/www/vhosts/my-domain.com/httpsdocs>
FCGIWrapper /var/www/vhosts/my-domain.com/bin/php-cgi .php
Options +ExecCGI +FollowSymLinks +Includes
allow from all
</Directory>
<Directory /var/www/vhosts/my-domain.com/core>
FCGIWrapper /var/www/vhosts/my-domain.com/bin/php-cgi .php
Options +ExecCGI +FollowSymLinks +Includes
allow from all
</Directory>
The problem I have now is that I have a warning the php shells can't include files in the core directory
As I said, I am not an expert in apache/php configuration...

Thanks for your help.
 
Back
Top