Hosting on the server |
[eluser]vindhyareddy[/eluser]
I have built a restful web services API successfully using wamp server. But now I need to host it on to the server of the organization. I am not able to do this. Can someone help me out!? Using WinSCP, I have put the folder on wamp's www into the <root>/var/www/html In config.php I had done this change: $config['base_url'] = "http://<<alloc machine>>/foldername/"; changed localhost to <<alloc machine>> But this has been giving me a database error. Saying database not configured or something like that. There was this line in autoload.php: $autoload['libraries'] = array('database','xmlrpc'); So I changed this to $autoload['libraries'] = array('xmlrpc'); Now I get a new error. It is throwing a 404 Page Not Found error.. Can someone help me out... need help asap
[eluser]bretticus[/eluser]
If you are loading 'database' in autoload and do not have a working configuration in application/config/database.php, you will get database errors. Sounds like you solved that problem already. Please give examples of URL's that work on your developer machine (localhost) and not in production. Have you setup an .htaccess file on your production server if you are removing index.php from your URL's?
[eluser]vindhyareddy[/eluser]
yes i have a .htaccess set up My links will be like http://localhost/folder/controller/param...format/xml
[eluser]bretticus[/eluser]
[quote author="vindhyareddy" date="1282341168"] yes i have a .htaccess set up My links will be like http://localhost/folder/controller/param...format/xml[/quote] So, on your production server, you have the same type of URL? Quote:http://domain.tld/folder/controller/para...format/xml ...folder and all? By the way, unless you have routing configured specifically for a parameter approach... Quote:controller/param1/ will always be interpreted as controller/method/ Perhaps, you need to try... Quote:controller/index/param1/
[eluser]vindhyareddy[/eluser]
Oh yes! It worked when I did : http://domain.tld/folder/index.php/contr...format/xml but now how do I again make changes to d htaccess to remove that index.php
[eluser]bretticus[/eluser]
[quote author="vindhyareddy" date="1282341673"]Oh yes! It worked when I did : http://domain.tld/folder/index.php/contr...format/xml but now how do I again make changes to d htaccess to remove that index.php[/quote] Okay, I'll just accept that param1 in: http://domain.tld/folder/index.php/contr...format/xml ...is just an example and move on. Show us your .htaccess file. Also, I don't believe you answered my question about whether your production server also employs the folder path just like your localhost URL.
[eluser]vindhyareddy[/eluser]
oopsie sorry missed out the question. yes it is the same file structure.. in my localhost its on C:\wamp\www\folder and on the production it is on var\www\html\folder
[eluser]bretticus[/eluser]
Cool. thanks. In your .htaccess file do you have the following line: RewriteBase /folder/ ?
[eluser]bretticus[/eluser]
[quote author="vindhyareddy" date="1282342143"]oopsie sorry missed out the question. yes it is the same file structure.. in my localhost its on C:\wamp\www\folder and on the production it is on var\www\html\folder[/quote] Make sure your .htaccess file is even enabled on your production server. You can do this by writing gibberish (khjh*(%(*&^ouihsdf or whatever ) in your .htaccess file. If it's enabled, you'll get a lovely server error! This link is a great source for debugging .htaccess. Follow this wiki post for CodeIgniter specifics.
[eluser]vindhyareddy[/eluser]
my htaccess file is as : <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /<<foldername>>/index.php/$1 [L] </IfModule> <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> |
Welcome Guest, Not a member yet? Register Sign In |