I have setup Apache 2.2+php 5.3.3 on CentOS 6.6 and are running virtual hosts with their document roots setup like /var/www/domainFoldername and their virtual hosts configuration in httpd.conf like:
<VirtualHost IP:80> ServerName www.example.com:80 ServerAdmin [email protected] DocumentRoot /var/www/ExampleFolder/web ServerAlias example.com ServerAlias *.example.com RewriteEngine on RewriteCond %{HTTP_HOST} !^www.example.com$ RewriteCond %{HTTP_HOST} ^(.*).example.com$ DirectoryIndex index.html index.htm index.php ErrorLog /var/www/ExampleFolder/log/error.log TransferLog /var/www/ExampleFolder/log/access.log AddType application/x-httpd-php .php php_admin_flag safe_mode Off ErrorDocument 400 /error/invalidSyntax.html ErrorDocument 401 /error/authorizationRequired.html ErrorDocument 402 /error/forbidden.html ErrorDocument 403 /error/forbidden.html ErrorDocument 404 /404.php ErrorDocument 405 /error/methodNotAllowed.html ErrorDocument 500 /error/internalServerError.html ErrorDocument 503 /error/overloaded.html </VirtualHost>
I am also using ACLs and have given apache write access to /var/www for file uploading permission issues through script. Problem I am facing is of security. I can run a script from the domain example.com
and have it access files that exist in another domain's directory. I would think that scripts belonging to the domain example.com
should only be able to access files within /var/www/example/
, not within /var/www/someotherdomain
. So, currently its very insecure and I want to secure these things.
RewriteCond
but no RewriteRule, so there is no rewrite happening at all here.