LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   open_basedir enabling for exiting websites (https://www.linuxquestions.org/questions/programming-9/open_basedir-enabling-for-exiting-websites-915100/)

SAYGIN 11-23-2011 07:59 AM

open_basedir enabling for exiting websites
 
Hi, i want to add a open_basedir line to my apache configurations file.

I want to add this line.

php_admin_value open_basedir "/chroot/home/$USERNAME/:/usr/share/pear/:/tmp/:/var/lib/php/session/"

My configurations file located on : /etc/httpd/conf.d

Conf file prefix vhost_***.conf

Sample conf file.

Code:

<VirtualHost 77.79.92.21:80>

  SuexecUserGroup examplecomtr examplecomtr

  DocumentRoot /home/examplecomtr/example.com.tr/html
  ServerName example.com.tr

  ServerAlias www.example.com.tr ftp.example.com.tr mail.example.com.tr
  ServerAdmin webmaster@example.com.tr

  # subdomain logic
  RewriteEngine On
  RewriteOptions inherit
  RewriteCond %{HTTP_HOST} !^www\.example\.com\.tr [NC]
  RewriteCond %{HTTP_HOST} !^example\.com\.tr [NC]
  RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-.]+)\.example\.com\.tr [NC]
  RewriteCond %{DOCUMENT_ROOT}/%1 -d
  RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
  RewriteRule ^([0-9A-Za-z-.]+)\.example\.com\.tr/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]

  RewriteCond %{HTTP_HOST} ^www\.([A-Z0-9a-z-.]+)\.example\.com\.tr [NC]
  RewriteCond %{DOCUMENT_ROOT}/%1 -d
  RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
  RewriteRule ^www\.([0-9A-Za-z-.]+)\.example\.com\.tr/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]
  # end subdomain logic

  ErrorLog /home/examplecomtr/var/example.com.tr/logs/error.log
  CustomLog /home/examplecomtr/var/example.com.tr/logs/transfer.log combined

  # php: default  don't edit between this and the "end php" comment below
  <IfModule mod_suphp.c>
    suPHP_Engine On
    suPHP_UserGroup examplecomtr examplecomtr
    AddHandler x-httpd-php .php
    suPHP_AddHandler x-httpd-php .php
    suPHP_ConfigPath /home/examplecomtr/etc
  </IfModule>

  <IfModule !mod_suphp.c>
    <IfModule mod_php5.c>
      php_admin_flag engine On
    </IfModule>
    <IfModule mod_php4.c>
      php_admin_flag engine On
    </IfModule>
  </IfModule>
  # end php

  # cgi: 1 don't edit between this and the "end cgi" comment below
  <Directory /home/examplecomtr/example.com.tr/html>
    AllowOverride  All
  </Directory>

  <Location />
    Options +ExecCGI
  </Location>
  ScriptAlias /cgi-bin/ /home/examplecomtr/example.com.tr/html/cgi-bin/
  # end cgi

</VirtualHost>

How can i read username from this file and write a open_basedir ?

Thank you.


All times are GMT -5. The time now is 01:33 PM.