[BlueOnyx:07986] Re: Apache Rewrite Conditions

Darrell D. Mobley dmobley at uhostme.com
Thu Aug 4 09:40:05 -05 2011


> -----Original Message-----
> From: blueonyx-bounces at mail.blueonyx.it [mailto:blueonyx-
> bounces at mail.blueonyx.it] On Behalf Of MuntadaNet Webmaster
> Sent: Wednesday, August 03, 2011 4:49 PM
> To: BlueOnyx General Mailing List
> Subject: [BlueOnyx:07983] Re: Apache Rewrite Conditions
> 
> Any takers or at least point me in a good directioN?

Create a separate file called /etc/httpd/conf/vhosts/site.includes and put
"Include /etc/httpd/conf/vhosts/site.includes" in your
/etc/httpd/conf/httpd.conf file just above where the includes are for the
vsites.

In that file insert:

<VirtualHost 208.80.9.51:80>
ServerName www.cecisportmodeling.com
ServerAdmin admin
DocumentRoot /home/.sites/85/site23/web/modeling
ErrorDocument 401 /error/401-authorization.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /error/404-file-not-found.html
ErrorDocument 500 /error/500-internal-server-error.html
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^208.80.9.51(:80)?$
RewriteCond %{HTTP_HOST}                !^www.cecisportmodeling.com(:80)?$
[NC]
RewriteRule ^/(.*)                      http://www.cecisportmodeling.com/$1
[L,R=301]
RewriteOptions inherit
#AliasMatch ^/~([^/]+)(/(.*))?
/home/.sites/85/site23/users/$1/web/$3
# BEGIN Bandwidth SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
# END Bandwidth SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
# BEGIN WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
AddHandler cgi-wrapper .cgi 			
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml

#Enable this to turn off shPHP
#AddType application/x-httpd-php .php5				
#Enable this to turn off shPHP 
#AddType application/x-httpd-php .php4
#Enable this to turn off shPHP 
#AddType application/x-httpd-php .php

#Enable this to turn on shPHP 
suPHP_Engine on
#Enable this to turn on shPHP 
suPHP_ConfigPath /home/sites/www.cecicleary.com/modeling
#Enable this to turn on shPHP 
suPHP_AddHandler x-httpd-suphp
#Enable this to turn on shPHP
AddHandler x-httpd-suphp .php

# END WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
# BEGIN PHP SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
php_admin_flag safe_mode Off
php_admin_flag safe_mode_gid Off
php_admin_value safe_mode_allowed_env_vars PHP_
php_admin_value safe_mode_exec_dir .
php_admin_value safe_mode_include_dir .
php_admin_value safe_mode_protected_env_vars LD_LIBRARY_PATH
php_admin_flag register_globals Off
php_admin_flag allow_url_fopen Off
php_admin_flag allow_url_include Off
php_admin_value open_basedir
/tmp:/var/lib/php/session:/home/.sites/85/site23/
php_admin_value post_max_size 8M
php_admin_value upload_max_filesize 10M
php_admin_value max_execution_time 30
php_admin_value max_input_time 60
php_admin_value memory_limit 16M
</VirtualHost>

You will have to manually edit the PHP settings to suit your needs.  If you
want don't suPHP enabled, comment out the four lines starting with "suPHP
Engine On" and uncomment the three AddType handlers above that.

Restart http:

# service httpd restart

The open_basedir directory line may need to add the "modeling/" directory to
the end if you get open_basedir errors.

The important part is you have designated a vsite in doing this by extending
the document root to go into the modeling directory and most importantly
this will also give you a domain name without 'modeling/' being in it.

You will use a site admin from your main site.

Good luck.




More information about the Blueonyx mailing list