Welcome Guest, Not a member yet? Register   Sign In
Hiding Core System Folders in root of server instead of www folder?????
#1

[eluser]ceej[/eluser]
Hi there,

is it possible using htaccess or some other way to hide all the core system folders in the root of the server instead of the www folder. So all you have to have in the www part is your application folder so you could use the codeigniter on multiple sites without having to keep re-uploading the core files?

Many thanks
#2

[eluser]coolfactor[/eluser]
That's the *only* way I build my sites. I rarely put my /system/ or /application/ folders inside the webroot. Just move your folders and adjust the paths inside index.php. That should do it.
#3

[eluser]coolfactor[/eluser]
Also, if you're on a Linux (ie. Ubuntu) or UNIX-based operating system (ie. Mac OS X), then symlinks (not aliases or shortcuts) are invaluable in a web-development environment. I use them extensively to avoid duplicate files all over my file system.
#4

[eluser]ceej[/eluser]
Thank you for that Smile

So what do you normally put in your www folder?
#5

[eluser]Michael Wales[/eluser]
Everything within your application folder (as long as your index.php is correctly configured). You can also place your assets (images, css, javascript) in the root folder if you would like.
#6

[eluser]coolfactor[/eluser]
My setup looks like this:
Code:
/application/
    /config/
    /controllers/
    ...
    /views/
/CodeIgniter-1.5.4/
    /system/
/webroot/
    index.php

As long as the $application_folder and $system_folder variables are set correctly in index.php, you can put your folders anywhere you want.

I keep the CodeIgniter-1.5.4 folder there so I know which version I have installed. Really helps when you manage 12+ sites at a time.
#7

[eluser]FrankieShakes[/eluser]
[quote author="coolfactor" date="1186464702"]My setup looks like this:
Code:
/application/
    /config/
    /controllers/
    ...
    /views/
/CodeIgniter-1.5.4/
    /system/
/webroot/
    index.php

As long as the $application_folder and $system_folder variables are set correctly in index.php, you can put your folders anywhere you want.

I keep the CodeIgniter-1.5.4 folder there so I know which version I have installed. Really helps when you manage 12+ sites at a time.[/quote]

coolfactor,

Are you able to run multiple sites off of the same "CodeIgniter-1.5.4" directory? Or did I mis-read your post?
#8

[eluser]coolfactor[/eluser]
[quote author="FrankieShakes" date="1186468752"][quote author="coolfactor" date="1186464702"]My setup looks like this:
Code:
/application/
    /config/
    /controllers/
    ...
    /views/
/CodeIgniter-1.5.4/
    /system/
/webroot/
    index.php

As long as the $application_folder and $system_folder variables are set correctly in index.php, you can put your folders anywhere you want.

I keep the CodeIgniter-1.5.4 folder there so I know which version I have installed. Really helps when you manage 12+ sites at a time.[/quote]

coolfactor,

Are you able to run multiple sites off of the same "CodeIgniter-1.5.4" directory? Or did I mis-read your post?[/quote]

I do run multiple sites off a single installation of CodeIgniter, but each site has a symlink to that single installation, so it appears each site has its own installation. Does that make sense? You need to know how symlinks work to get that.

What I described is how I do it. You can still keep your single installation of CodeIgniter in an entirely different place as long as you have filesystem access to it and set the $system_folder path correctly in index.php. That's the key to this.
#9

[eluser]FrankieShakes[/eluser]
[quote author="coolfactor" date="1186469126"][quote author="FrankieShakes" date="1186468752"]
I do run multiple sites off a single installation of CodeIgniter, but each site has a symlink to that single installation, so it appears each site has its own installation. Does that make sense? You need to know how symlinks work to get that.

What I described is how I do it. You can still keep your single installation of CodeIgniter in an entirely different place as long as you have filesystem access to it and set the $system_folder path correctly in index.php. That's the key to this.[/quote]

Would you mind sharing how your symlink is setup? I'm running on a Mac, not sure what OS you're running.

I'd prefer to share the same "core" between apps and save on disk usage.

Also, I'm assuming in this case, that each application has its own "application" directory... stupid question, but I thought I'd clarify before I drive myself nuts. Wink
#10

[eluser]coolfactor[/eluser]
I'm on a Mac, as well. I have a Contextual Menu Item installed called "SymbolicLinker" that gives you the ability to create symlinks from right-click menus. Google it. Very handy thing to have.

Once you have that installed, Put your CodeIgniter system folder where you want it to live, and then when you create a new website, simply right-click on the system folder and choose "Make Symbolic Link". You'll get a file called something like "system symlink". Then just drag that file to where you want it in your new website. Remove the " symlink" off the end, and then just treat it as if it were the real thing. Apache doesn't know any different.

When you go to FTP your files up the server, the real files get uploaded for you. It's almost magical.

(Note: you can not use regular Mac aliases for this. You must use symlinks.)




Theme © iAndrew 2016 - Forum software by © MyBB