• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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