Forum Moderators: phranque
SuexecUserGroup "#1006" "#1007"
ServerName myapps.domain.com
ServerAlias www.myapps.domain.com
ServerAlias webmail.myapps.domain.com
ServerAlias admin.myapps.domain.com
DocumentRoot /home/domain.com/domains/myapps.domain.com/public_html
ErrorLog /var/log/virtualmin/myapps.domain.com_error_log
CustomLog /var/log/virtualmin/myapps.domain.com_access_log combined
ScriptAlias /cgi-bin/ /home/domain.com/domains/myapps.domain.com/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/domain.com/domains/myapps.domain.com/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All
Action application/x-httpd-php5 /cgi-bin/php5.cgi
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php
</Directory>
<Directory /home/domain.com/domains/myapps.domain.com/cgi-bin>
allow from all
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.myapps.domain.com
RewriteRule ^(.*) http://myapps.domain.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.myapps.domain.com
RewriteRule ^(.*) https://myapps.domain.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
Options +FollowSymLinks +ExecCGI
AddDefaultCharset utf-8
<IfModule mod_authz_host.c>
<FilesMatch "\.(lock|conf)$">
Order deny,allow
Deny from all
</FilesMatch>
<FilesMatch "pre_.+\.php">
Order deny,allow
Deny from all
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
myapps.domain.com/index.php/mywebapps http://myapps.domain.com/cgi-bin/php5.cgi/mywebapps
[Mon Oct 17 08:52:45 2011] [error] [client 110.139.177.53] Premature end of script headers: php5.cgi, referer: http://myapps.domain.com/mywebapps
all request made to mywebapps, are request made to the "index.php"
file. so mywebapps trusts the apache rewriting system to transform any "/<mywebapps>"
to "/index.php/<mywebapps>".
<IfModule mod_rewrite.c>
RewriteEngine On
But those rewrite doesnt works
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.myapps.domain.com
RewriteRule ^(.*) http://myapps.domain.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.myapps.domain.com
RewriteRule ^(.*) https://myapps.domain.com:10000/ [R] SuexecUserGroup "#1006" "#1007"
ServerName myapps.domain.com
ServerAlias www.myapps.domain.com
ServerAlias webmail.myapps.domain.com
ServerAlias admin.myapps.domain.com
DocumentRoot /home/domain.com/domains/myapps.domain.com/public_html
ErrorLog /var/log/virtualmin/myapps.domain.com_error_log
CustomLog /var/log/virtualmin/myapps.domain.com_access_log combined
ScriptAlias /cgi-bin/ /home/domain.com/domains/myapps.domain.com/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/domain.com/domains/myapps.domain.com/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All
Action application/x-httpd-php5 /cgi-bin/php5.cgi
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php
</Directory>
<Directory /home/domain.com/domains/myapps.domain.com/cgi-bin>
allow from all
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.myapps.domain.com
RewriteRule ^(.*) http://myapps.domain.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.myapps.domain.com
RewriteRule ^(.*) https://myapps.domain.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5 DirectoryIndex index.html index.htm index.php index.php4 index.php5
Options +FollowSymLinks +ExecCGI
AddDefaultCharset utf-8
<IfModule mod_authz_host.c>
<FilesMatch "\.(lock|conf)$">
Order deny,allow
Deny from all
</FilesMatch>
<FilesMatch "pre_.+\.php">
Order deny,allow
Deny from all
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase /
# we skip all files with .something
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
Make sure there are no blank lines after any of the RewriteCond lines.
Blank lines and white space occurring before a directive are ignored, so you may indent directives for clarity.