Change Local Path for CakePHP over II6 and windows 2003 - cakephp

I have followed this article to configure CakePHP over II6:
http://bakery.cakephp.org/articles/jamesmking/2008/04/12/cakephp-on-iis6-with-fastcgi-sql-server-2005-and-isapi_rewrite
But i want to change the "Local Path" from "C:\Inetpub\wwwroot\CakePHP\app\webroot" to "C:\Inetpub\wwwroot\" in order to be able to execute different web applications and not only the CakePHP one.
I have tried it changing the "local path" on the IIS manager but i doesn't work. I guess it should be something related with the ISAPI Rewrite and its conditions.
Do you know how could I make the needed changes in order to make it work?
Regards.

Move the .htaccess file in the root of the site's root folder.

Related

plesk use specific directory as root for website

I got used to have all my websites in /var/www so no matter which domain, each subdomain has its document root located in /var/www/
Plesk is trying to force me to use /var/www/vhosts/domain/ and I did not find a way to tell Plesk to just put everything into /var/www.
I don't want a whole new structure, I want to migrate my existing websites from my old server (without Plesk) to my new server running Plesk 17.8
Edit: Feel free to answer this question for future reference but I won't need it as I realized that no sane person would use Plesk. Server will be reinstalled.
This may help you:
In Plesk for Linux, transvhosts.pl utility can be used to change the location for all virtual hosts:
# /usr/local/psa/bin/transvhosts.pl --help
In the following example, the location is changed to /home directory:
# /usr/local/psa/bin/transvhosts.pl --dest-dir /home --correct-scripts
Note, that currently Plesk Onyx with SELinux enabled does not support custom vhosts directory.

IIS 6 weird behavior with Local Path over Windows 2003 Server

I have a site who needs to be pointed to: inetpub\wwwroot\cakephp\app\webroot\
If I point the "Default Web Site" to that directoy, my web application works perfectly.
Now, as I want to add more sites to that same computer, I am pointing the "Default Web Site" to inetpub\wwwroot\ and the concrete folder for my web application (cakephp) to the previous path inetpub\wwwroot\cakephp\app\webroot\.
When I do this I have noticed it doesn't even execute the index.php file located inside inetpub\wwwroot\cakephp\app\webroot\ contrary as it should. It only does it when accessing directly to the root of the site.
To clarify it:
www.myweb.com/cakephp/ executes inetpub\wwwroot\cakephp\app\webroot\index.php
www.myweb.com/cakephp/actionName/ does NOT executes inetpub\wwwroot\cakephp\app\webroot\index.php
Why is this happening? Why it doesn't recognize the given path when I add any parameter to the URL?
It tries to list the folder content instead...
Thanks.
Have you tried this:
http://www.myweb.com/cakephp/index.php/Controllername/
For example:
http://www.myweb.com/cakephp/index.php/pages/home/
if that is working, then 'URL rewriting' isn't working.
URL Rewriting doesn't work out-of-the-box on IIS, but can be configured with the instructions in the documentation:
http://book.cakephp.org/2.0/en/installation/advanced-installation.html#url-rewrites-on-iis7-windows-hosts
However, your setup may need to be slightly different than the documentation because you've installed your website in a subdirectory

Changing the host of my CakePHP site

I bought an application made in ​​Cakephp, everything was fine before, but once I wanted to host it on another server (with keeping the same database and folders), I find the links to the CSS, JavaScript and images do not work.
Please I have no knowledge in CakePHP.
Did you clean up the database?
I had to change some entries by hand once, because the servername/ip/url didn't change.
go to your db management system and search for your old IP/Path/domainname etc....
Did you copy over the (often hidden) .htaccess files when you moved to the new host?
There are three .htaccess files, one in the root of your site, on in the /app directory, and one in /app/webroot
Is mod_rewrite enabled on your new server?

Cake php host in server with multiple domain

I have a server with many domains/ applications on it. I need to host a cake php application on that server. When I uploaded, I get errors w.r.t urls.
for eg, www.xyz.com/aboutus. this url is working. there is a controller called Aboutus.
But when I take the url www.xyz.com/aboutus/add, it must go to the add method in Aboutus controller. It is working in my local system. But in live, it shows the error that 'add' controller is missing.
In my local, I have changed the document root in apache. But in live server I cant do this as there are multiple sites.
You need to make sure that the ROOT, APP_DIR, and CAKE_CORE_INCLUDE_PATH variables in each site's webroot/index.php have been updated to go to the right paths. [details here] (or see below where I list my settings) Other than that, just make sure your host has mod rewrite on and you should be good to go.
According the the CakePHP book for 2.0.x, it's easier to just change the include_path, but I haven't tried that yet: http://book.cakephp.org/2.0/en/deployment.html#multiple-cakephp-applications-using-the-same-core
The file-structure I use:
/cakephp
/cakephp_1_3
/cakephp_2_0_5
/public_html
/mysite1.com
/mysite2.com
/mysite3.com
//webroot/index.php (of one of my sites)
define('ROOT', DS.'home'.DS.'myusername'.DS.'public_html');
define('APP_DIR', DS.'mysite1.com');
define('CAKE_CORE_INCLUDE_PATH', DS.'home'.DS.'myusername'.DS.'cakephp'.DS.'cakephp_2_0_5'.DS.'lib');
(I just took the 3 lines that set the variables - they're not really three lines in a row like that)
Don't forget to make sure your database settings are still correct in app/Core/Config/database.php

Deploying CakePHP on sub domain redirects to wrong location

I am trying to deploy my locahost CakePHP website to a subdomain. I am able to view the website but it is not working correctly when I try to login or register.
It does not show me any validation error nor does it allow me to login or register and it is landing on the below URL:
subdomain.example.com/webroot/index.php?url=users/login
where it should be something like:
subdomain.example.com/users/login
I am using Go Daddy shared hosting.
The older settings defined at http://bakery.cakephp.org/articles/cguyer/2009/10/18/mod-rewrite-on-godaddy-shared-hosting has solved the issue.
Thank you every one for your help.
This sounds (and looks) like an Apache rewrite issue. There are a couple of things you need to look at:
Check to make sure the .htaccess files are were they are expected. You should have one in the app directory and another in the webroot directory. Sometimes when we compress and/or transfer files to the webserver, the .htaccess files get left behind.
Make sure that the server you are running the site on has rewrite turned on. This may require that you call support at Go Daddy. But my experience is they are always willing to help.
Good luck!

Resources