Welcome Guest, Not a member yet? Register   Sign In
Installing CI server wide
#1

[eluser]mvdg27[/eluser]
Hi,

I've seen that my topic is already quite discussed on the forums, but to be honest I haven't been able to figure out how to solve my specific case. So by pointing out my specific setup I hope that someone can point me in the right direction of setting up CI server wide.

To start some basic info about my server:

I have a Virtual Private Server with full root access. The VPS has Direct Admin installed, which I use to set up hosting packages and manage domains for my clients. As far as I know, the current setup uses the default configuration.

Currently I have a few clients (seperate hosting packages) where I've build a website using CI. Each time I uploaded the complete CI folder and worked from there. For me it would be ideal if I could have CI functionality on each domain, without having to install the complete system. So I'm thinking of installing CI somewhere centrally on the server, and just have an application folder in each domain root, if I need it. So there you have my first question .. how is this best managed? Should I create a domain user and manage my CI (system) installations there? Do I upload and extract CI as a normal Linux user? And where should I put CI then, so that it is available for all domains?

Ok, to complicate things a bit more, I'm currently working on a CMS system based on CI as well. I also would like to make this CMS available for each domain, but then without having to install it on each domain and without revealing too much code to them. I'm looking for a centralized way too install this application, but be available to all of them by simply visiting www.theirdomain.com/cms/

For now, just the first question is really important, but I'd already want to put the second one here as well, in case that would have implications for the basic CI setup in the first place.

Thanks for reading through this long story Wink .. I hope someone can give me some advice on how to setup my server!

Cheers, Michiels
#2

[eluser]xwero[/eluser]
It's no problem to place CI above your root directories all you have to do is to change the application and system settings in the index.php file. You have to provide the full path if you want to put the directories above the domain roots. For your idea putting only the application directory is good but for security reasons it would be better you place it above the domain root too. Your clients don't need to change the code i guess.

For the cms it's no problem if all your clients use the same application with other configurations of course. If you create different applications i think you have to take a look at the matchbox or HMVC library.
#3

[eluser]mvdg27[/eluser]
Hi Xwero,

Thanks for you reply. Good to hear that at least my general idea is correct. One thing though, before I want to start trying this Smile

On my system there is a user created for each new hosting package. So all the files of each user reside in /home/*username*/public_html

Now you are suggesting I place the files in the home directory (as a new user), right? So let's assume I name this user CI, then I would change the variable "system_folder" to "/home/CI/system", correct? And use a similar approach for the application_folder. Would this immediately mean that I can access codeigniter from every user domain? Or do I need to fix some rights here?

Then finally, the easiest way is to create a new user through DirectAdmin .. or do you think it's prefered to create a regular user through Linux's user management?

Thanks for your help so far. Hope you can point these last things out, and then I'll give it a go!

Cheers, Michiel
#4

[eluser]xwero[/eluser]
I think your scenario only applies when you want your client to change the files manually. I think the most common approach it to have a /www directory and there you have /www/some.domain.com, /www/another.domain.com and the framework is located at /www/ci with /www/ci/system and/or /www/ci/application. You could make domain directories accessible for the user. I think this is easier than /www/ci and /home/*username*/public_html but if you think otherwise don't let me tell you otherwise Wink
#5

[eluser]mvdg27[/eluser]
Ok, I see .. the thing is that DirectAdmin automatically sets up the domains like this .. so I'd actually prefer to keep it like that.

Do you think this assumption is correct?

- I create a new user, called CI, which will result in a new user directory (/home/CI)
- In /home/CI I upload all the CodeIgniter Files (system and application)
- I grant access to the CI directory for other users (read and execute, I presume?)
- I change the system_folder and application_folder vars to : "../../CI/system" and "../../CI/application"

If you or anyone else has other suggestions, by all means .. I'd rather take a bit more time to come up with a good solution, than do it the quick and dirty way!

Just to provide some extra information: there is a www folder on my system (/var/www/). In that directory there are some files and folders, e.g. phpMyadmin, webmail, squirrelmail etc. Not sure though how to access them ..

Thanks so far anyway! Hope we can come up with a good solution!

Cheers, Michiel

EDIT: In principle my clients don't need to edit the application files. But in cases they do, I could just place the entire application folder in their domain, instead of the CI folder, I guess.
#6

[eluser]mvdg27[/eluser]
Ok .. just to let you guys know that I figured it out, and maybe help others that have similar problems:

- I created a new user through DirectAdmin (CI). This way I have a complete user and ftp access, without any hassles

- I uploaded the latest release in a seperate folder (keeping the release number). This way I can install a new release separate from the current

- The igniter index-file I uploaded to a user's webspace. And I've added the user-dir of my CI user to the include path:

Code:
$path = '/home/CI/public_html';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

Furthermore I changed the system_folder var to:

Code:
$system_folder = "CodeIgniter_1.6.1/system";

- Now depending on where I put the application folder (either on the user's webspace or on the CI webspace) the application_folder var is changed as follows:

Code:
$application_folder = "application1"; // aplication in user's webspace
$application_folder = "/home/CI/public_html/application1"; // application in CI's webspace

I haven't really figured out what's going to happen with uploading files etc., but so far it's working as desired!

Cheers, Michiel




Theme © iAndrew 2016 - Forum software by © MyBB