CodeIgniter Forums
CI Installation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: CI Installation (/showthread.php?tid=22873)



CI Installation - El Forum - 09-22-2009

[eluser]RecoilUK[/eluser]
Hi guys

Just about to install CI to play around with on my test server, and to be honest, i,m slightly worried about the default folder layout.

You get two folders and an index.php and license.txt file, which implies that everything should be installed in the document root, which as far as i,m concerned is a security nightmare.

Basically, I guess i,m asking what the best method for installing CI?

Ideally, I would only want the index.php accessible through mod rewrite, just a bit unsure as to what I need to set my include path to for it to work properly.

Thanks guys


CI Installation - El Forum - 09-22-2009

[eluser]InsiteFX[/eluser]
Take the CodeIgniter application folder out of your CodeIgniter system folder.
place these two folders up one level for your public_html or what erver it is called.
copy the index.php file to you web site root and then edit it for the system and
application folders path.

Enjoy
InsiteFX


CI Installation - El Forum - 09-22-2009

[eluser]RecoilUK[/eluser]
Hey

Thanks for the quick reply.

In the end, I left the application in place and just put the whole system folder one up from the web root.

Thanks again.


CI Installation - El Forum - 09-26-2009

[eluser]LovinItAll[/eluser]
Hey,

I was following the alternate installation example of CodeIgniter outlined by Michael Wales in his blog (renaming /application to _base, for example). His blog also deals with CSRF and his solution, so I was interested in implementing it. Since this thread deals with installing system files above the web root, I'm posting my question here.

For whatever reason, I'm having a difficult time getting CI to recognize the system files when I install them above the web root on my (Windows Vista - Admin - No UAC) local machine. I think I've tried almost every possible modification of the bootstrap index.php's lines 26 ($system_folder = '/ci-1.7.0'Wink and 43 ($application_folder = '..'Wink but to no avail (I've also tried not renaming the various folders as he recommends).

My htdocs folder is under c:\xampp, so I was trying to install the system files under c:\xampp (but above htdocs obviously), but I get error messages every time (file not found, or if I do get the system to recognize a change like ../, I'll receive an error message that a file was not found in the next calling module).

If anyone can recommend a change to the vars $system_folder and $application_folder that they know works given my installation, I'd really apprciate it.

Thanks in advance.


CI Installation - El Forum - 09-26-2009

[eluser]InsiteFX[/eluser]
Hi LovinItAll,

1) Create a directory under your htdocs with the name you want, htdocs is your root folder.
2) Under that directory copy your CodeIgniter files.
3) I create a directory under #1 called public_html because thats how my real server is setup.
4) Copy the CodeIgniter index.php to the public_html directory, or whatever you name it.
5) Edit your config.php file and your index.php file for where the system and application directories are.
6) editing index.php - system = ../system - application = ../application

Directory Structure for xampp
| htdocs - root directory
| all CodeIgniter system / application directories
| public_html directory - or whatever you want to name it
| assets directory - js | css | images etc, or whatever you want to name it
| CodeIgniter - index.php

I hope this helps, any problem let me know.

Enjoy
InsiteFX


CI Installation - El Forum - 09-26-2009

[eluser]LovinItAll[/eluser]
Ah, of course....

I really appreciate it. I guess I went brain dead - I wasn't considering that /htdocs actually represented the structure above the web root(public_html). For whatever reason, I was treating /htdocs as /www (public_html), but it's clear now.

Thank you for taking the time to reply, and have a great weekend!


CI Installation - El Forum - 09-26-2009

[eluser]Natebot[/eluser]
In addition to placing both the system and application directories outside the web root, I like to use a symbolic links in my dev environment so I can easily point to a different system and application folders.

For example, I have have two application directories each with a different version of the app, app_1.0 and app_2.0, and I have a symbolic link 'application' point to the application I want to run. This also allows me to toggle between CI system directories too, in case I want to test my app with the most recent svn release.


| htdocs - root directory
| CodeIgniter systems
| application directories
| app_data directory
| CodeIgniter system symbolic link
| application symbolic link
| public_html directory - or whatever you want to name it


Lastly I create a directory named 'app_data' where I put the system logs, all CI file caches, and all user file uploads. This allows me to replace system directories without fear of loosing that data.