cakephp - apache - turn off directory browing of tmp folder - cakephp

It seems cake's tmp folder is browse-able (if you go to localhost/tmp it shows all the files I put there), how can I turn this off without breaking anything?
I tried adding .hacccess file to that folder with - Options -Indexes - didn't work
I tried adding index.html - didn't work.
I am afraid to mess with the apache config files because it was a nightmare to get cake & php and everything working properly....
Why would cake have this on by default, isnt it a security issue? (at least the scan tool my client ran flagged it).
thanks
Joel

Something is definitely wrong with your setup that has nothing to do with CakePHP. Your webroot (localhost) should be at this location: app/webroot and the tmp should be at app/tmp. In order for you do access http://localhost/tmp, tmp would have to be at app/webroot/tmp or you are redirecting it, which is not how CakePHP is designed to be setup.

Related

Production install cake 2.0 in mediatemple/plesk

I'm currently trying to install cake on a new site hosted on mediatemple/plesk on a shared ip. I have added the unzipped cake package to the httpdocs folder (../httpdocs/cake/), which is the server default for the site, as instructed in the cake documentation. It did not however bring me to the cake installation page, so as instructed in the cake documentation i reset the DocumentRoot for the site. The solution for document root that i found online for plesk was to set document root in vhost.conf and vhost_ssl.conf in the conf folder for the site i wanted to redirect. each of these files now has the following line of code (only code in the document):
DocumentRoot /var/www/vhosts/(mydomain.com)/httpdocs/cake/app/webroot/
As it still does not load to the cake homepage/installation page (instead i get the apache test page...) i have continued to search online and in these forums, but just keep coming up with reiterations of creating the vhost.conf and vhost_ssl.conf files as i did above (same line of code and everything)
manually directing my browser through the filepath to cake/app/webroot/ and cake/app/webroot/index.php returns only a blank page.
Is there any other way to get this to direct to the installation page correctly so that i can start to build?
DocumentRoot /var/www/vhosts/(mydomain.com)/httpdocs/cake/app/webroot/
i'd say this will not work.
Your index.php you'll need to access for cake is in "/var/www/vhosts/(mydomain.com)/httpdocs/cake/" if i'm correct.
You should remove the DocumentRoot and then browse to: mydomain.com/cake/index.php
there you should see the cake page
(this should be working before you try to set your DocumentRoot somewhere else)

Drupal 7 - Views.css and CTools.css not loaded

When using the Views admin panel, it appears completely mispresented. Looking at the files being accessed, it turns out that the needed css files are not loaded. My Drupal installation is within a /drupal/ subfolder, and when the module is trying to access domain.com/sites/all/modules/views/css/views.css a 404 is received.
I tried browsing manually to domain.com/drupal/sites/all/modules/views/css/views.css and it works, therefore the file is there and can be accessed from the web.
The strange thing is that for other folders there is no problem, for example both domain.com/modules/user/user.css and domain.com/drupal/modules/user/user.css work. It seems like a problem with sites/ only...
I do not have CSS optimization enabled, and all folders within sites/ have a 755 permission. Is there some configuration setting I'm missing?
Apparently, the domain I'm concerned about is a parked domain (or whatever this is called) for another one, and contained in a subfolder of public_html. Drupal installation, thus, is a subfolder of that subfolder (say, /home/user/public_html/my_domain/drupal) and all requests for my domain are redirected via an .htaccess and MOD_REWRITE, to the Drupal subfolder. For some reason, it didn't have the sites/ in its regexp (modules/ and themes/ were...).
You may have incorrect vhost configuration. In order to check if this is the reason, try accessing the site without the vhost i.e. localhost/drupal and see if this works.
If it loads correctly, then you need to set up the correct document root:
<VirtualHost *:80>
DocumentRoot /www/drupal
ServerName domain.com
</VirtualHost>
Then restart apache.
For more information about how to set up vhost, visit http://httpd.apache.org/docs/2.2/vhosts/examples.html

Using bake on shared hosting Cakephp

I'm trying to get bake working on my subdomain which is under shared hosting.
Is there a way we can get this working? I know how to connect to server via ssh shell but then what do I do after that?
First cd to the directory where the cake script is. On a Linux webserver, this would probably be something like ~/cake/console/, if you've put the CakePHP libs outside your web-accessible directories. If you've put everything into your web directory you'll probably have to go somewhere like ~/www/cake/console/.
Then simply type ./cake bake and take it from there.
You shouldn't have to do anything with environment variables. This is only necessary if you want to be able to run the cake console from any directory. I find it less of a hassle to just cd into the cake console's directory and run it using ./cake.
same as local machine cd <path_to_console> cake
if you do not know path_to_console ask for host support,
also path_to_console may be in environment path then just use cake in all dirs

why does apache forbid access via symbolic links?

I am trying to install typo3 as per the instructions but I have a bit of a puzzle to solve.
It seems apache denies access to any files I try to access via any symbolic link in the site root directory. I have changed permissions from SymLinksIfOwnerMatch to FollowSymLinks and no joy.
I'm working on mac OSX (SL) and installing in my user's "Sites" directory. I can access any files in this CMS directory via the web browser just not anything through symbolic links.
I hope konsolenfreddy's comment was helpful already. I am trying to round things up here:
First check if the symlinks work from terminal and/or the filesystem in general.
Also, if you use absolute paths, the whole path from root to the file in question must be readable by the Apache user. *
If yes, check if the AllowOverride option is set for your webserver (or if applyable for the virtual host) For debugging you can set AllowOverride All in either apache2.conf, httpd.conf or in sites-available/default
If yes, check if FollowSymlinks is aktivated in any of the files responsible for your webroot, starting with apache2 working yourself down to the .htaccess files.
Try changing file permissions on the symlink file and the target directory (or files)
Try creating your own symlink and see what happens when you call it in the browser.
* Check this answer at askubuntu.com for more hints.
Ok I eventually solved it. In OSX the final file that governs access of sites installed in user directories is the last Include line in the apache2/conf/extra/httpd-userdir.conffile. Once I changed that my problems went away.
Thanks to all the people that replied my questions.

Ushahidi No Input File Specified

I have been trying to install Ushahidi platform for weeks but without any luck. I recently started over using Ushahidi latest release ushahidi-Ushahidi_Web-2.0.1-140-g0991172.zip and extracted it to folder ushahidi under my root.
I am using godaddy Linux server. I have tried both the manual and wizard to setup Ushahidi. In all cases, after installation, I get the same error when I try to access admin page. The error reads:
No input file specified.
I have tried tried installing using the wizard and the manual process. My PHP version is as required.
Any help will be appreciated. I need it to work so I can move on and customize it. Very disappointing such a good open source tool has poor installation guides!
Thanks.
Sting
there are a few things that can trip up following the installation.
Make sure that:
mod_rewrite is turned on in apache "a2enmod rewrite"
AllowOverride All is set in your apache config for your site (/etc/apache2/sites-available/default)
your .htaccess file points to the correct webroot

Resources