Taille du texte: +

Configure open_basedir for subdomains

Follow the 3 steps to fix open_basedir restriction for subdomains.

We assume that the domain name is $domain.com, the name of the subdomain is $subDomName. You have to replace these values with the appropriate values.

Our goal is to open access to the public website directory and the /tmp directory for the special subdirectory. The directories are mentioned in the php_admin_value open_basedir

Create vhost.conf file for subdomain

Create /srv/www/vhosts/$domain.com/subdomains/$subDomName/conf/vhost.conf with the following content:
<Directory /srv/www/vhosts/$domain.com/subdomains/$subDomName/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/$domain.com/httpdocs:/srv/www/vhosts/$domain.com/subdomains/$subDomName/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/$domain.com/httpdocs:/srv/www/vhosts/$domain.com/subdomains/$subDomName/httpdocs:/tmp"
</IfModule>
</Directory>

Apply the configuration

The next step is to apply the created configuration and recreate the apache configuration.
Execute the following command on the command line to update the Plesk configuration:
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.tld

Restart apache

Final and last step is to restart apache:
apache2ctl  restart

That’s all, now your open_basedir restriction is gone.

Tags: 
0
Mise à jour de sécurité Joomla 2.5.2
Erreur de construction des menus de l'administrati...
 

joomla-conseil.com n'est ni affilié à Open Source Matters ou au projet Joomla!® ni approuvé par eux. Le nom Joomla! et le logo sont utilisé sous licence limitée accordée par Open Source Matters, propriétaire de la marque aux États-Unis et autres pays. joomla-conseil.com is not affiliated with or endorsed by The Joomla! Project™. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.