I'm thinking about moving one of my clients mysql db to Rackspace could databases. Application is using Cakephp.. I would like to know if someone has experience doing so or will this work just by editing host/user/pass in the database.php file?
I havn't done so but Rackspace has a tutorial about doing so :
http://www.rackspace.com/knowledge_center/article/installing-cakephp-on-cloud-sites
It seems pretty simple, so you should not have any problems
Steps for cake
Locate the .htaccess file in the content directory. After "RewriteEngine on", add a new line with "RewriteBase /" to the .htaccess file and save the file back to the site. You will need to repeat this step for the rewrite rules in the .htaccess files in the app and app/webroot directories.
Load the site in your browser. You will notice several warnings concerning the installation. The first warning will be the following: Notice (1024): Please change the value of Security.salt in app/config/core.php to a salt value specific to your application [CORE/cake/libs/debugger.php, line 556].
Open app/config/core.php file and search for Security.salt. Change its value to whatever characters or string you would like, then save and close the file.
In the app/config/directory in FTP, rename the database.php.default file to be database.php.
Open app/config/database.php and scroll down to the bottom of the page to find the database connection information. Enter your database host name, user name, password and hostname, then save and close the file.
Reload your site in your browser.
Related
I am trying to up-grade my website 7.22 to 7.26 and i was follow all the steps which is defined in Drupal forum.
The steps are:
Log in as a user with the permission "Administer software updates".
Go to Administration > Configuration > Development > Maintenance mode. Enable the "Put site into maintenance mode" checkbox and save the configuration.
Remove all old core files and directories, except for the 'sites' directory, the original install profile in the 'profiles' directory and any custom files you added elsewhere.
If you made modifications to files like .htaccess or robots.txt, you will need to re-apply them from your backup, after the new files are in place.
Sometimes an update includes changes to settings.php (this will be noted in the release announcement). If that's the case, replace your old settings.php with the new one, and copy the site-specific entries (especially the lines giving the database name, user, and password) from the old settings.php to the new settings.php.
Download the latest Drupal 7.x release from http://drupal.org/project/drupal to a directory outside of your web root. Extract the archive and copy the files into your Drupal directory.
Re-apply any modifications to files such as .htaccess or robots.txt.
Run update.php by visiting http://www.example.com/update.php (replace www.example.com with your domain name). This will update the core database tables.
If you are unable to access update.php do the following:
Open settings.php with a text editor.
Find the line that says:
$update_free_access = FALSE;
Change it into:
$update_free_access = TRUE;
.
But it is stuck on Overview line at the time of drupal database update.
I click continue and nothing moves forward. There are no errors or anything, I'm not sure how to proceed.
Please suggest me what can i do .
Thank you in advance.
I want to protect some files in my server from download but my site needs to have access in them. I want to protect some subtitles files, which are needed to be accessed by site, but I don't want anybody to download them. The site is hosted.
For example some sites use some strange strings that are connected with user, video and IP. Can be used something like this for my case.
http://www11.some-site.com:182/d/qygiatnqvsulzrqmk7n6nbhddbcscvyguy4auc3fn4nvf23jp64tjcpa/File-needed.mp4?start=0
If you are using Apache, You have to use rewrite rules in your .htaccess file. IF you are using other HTTP Server brand, you should use almost the same logic that I will show here, so check your HTTP server manual in that case.
Explain:
When you type www.me.com/index.php the PHP system puts the content generated by the echo commands you use inside your code.
When you type www.me.com/myfiles/iou345yo13i2u4ybo34ybu3/passwords.txt your server will put the file contents to the client browser, which will ask you to download it as a file or show as a page, depending of the file extension.
Now, if you do something like this in your .htaccess file:
RewriteEngine On
RewriteRule ^myfiles/([^/]*)^.pdf$ /index.php?file=$1& [L]
# avoit direct access to your server directories file listing
Options All -Indexes
You will type www.me.com/myfiles/file123.pdf but the server will execute index.php with the file name as content of the "file" parameter, and there in the code, you will be able to check the session to see if the user has the authorization to download this file.
If the user has the authorization, you then use the readfile() function to send the file to the user and he will not recognize where it came from (I mean the real path).
Look on how to do this here:
PHP - send file to user
Change to 644 permissions in your content.
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?
I'm working on a College Application project.
I want to ask how to download the files that previously uploaded by user.
Here's the clear view :
User will upload the files.
Controller will handle the request and save the name of the files into database.
How admin can download the file ???
I try to access the localhost/system/files/upload.doc but doesn't got any luck.
Consider using Media views: http://book.cakephp.org/1.3/view/1094/Media-Views
These will allow you to go to a path and load the database information about the file and then present the file with necessary download headers to the user.
yes use media views. They are the best way to keep your files from being publically accessible. So an admin can be "Served" the file and others can not get to them .
You can rename the file and things like that as you serve it to the user as well. Very nice feature of cake.
I developed a small cakephp website on local machine. When I upload to my host server, I realize that I must use their prefix for the database name and database user. So, I go and create new database name and new user. When I visit the site, it has this:
Warning (2): mysql_connect() [function.mysql-connect]: Access denied for user 'old_name'#'localhost' (using password: YES) [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php, line 552]
I am 100% sure, I already change the name to "new_name", it runs on my local machine, but I dont know why it still load the old name. I go to ftp, and download the database config file, it clearly stated that, the database user is "new_name", i dont understand why when I go to the site, it loads the old database config. I am new to cakephp, please help.
try to clear the files from your app/tmp directory and tripple check the configuration.
Sometimes it can take a while for files to become live. One host I use has a folder for upload and then they transfer to the live folder from there automatically. Could it be something like this?
You possibly need to specify an IP for the database instead of localhost. Often the database is hosted on a different server to the code.