Welcome Guest, Not a member yet? Register   Sign In
Cross system installation
#1

I have multiple codeigniter websites and I would like to centralize the system folder to facilitate the update proces and avoid filesystem redundancy.   

Instead of stucking the files stystem into some random home directory I would prefere to follow Linux Filesystem Hierarchy and I am hesitating between /opt/.. and /usr/local/. My doubt is related after I have seen different deployment approaches for Pear, Zend and other thrid part libraries.
 
For ex: In Freebsd system I can see that pear is deploying the php files '/usr/local/share/app-name' ex => “/usr/local/share/pear/SOAP/Base.php”.

In Debian system are the php files stored in '/usr/share/' directory ex => '/usr/share/phpmyadmin'.

When it commes to Zend, the Framework files may be found under /usr/local/zend/share/ZendFramework .

What whould be the best practise to deploy the codeigniter so it can be reused accross all system.
 
I am thinking about  '/usr/local/codeigniter-version-number/system/' ?
Reply
#2

One thing you need to consider is that the user that apache runs as has access to the location you want to place the system folder.
I usually just stay with the Apache standard /var/www/* folder with Apache virtual hosts and base everything off that so Apache isn't running all over my system.

So for example I end up with multiple applications as:

/var/www/www.foo.com/app/public
/var/www/www.bar.com/app/public

The app folder is where the git clone is deployed to ie. git clone https://github.com/foobar/example.git app

That of course has the application, composer vendor, and system folders among others. The public folder has index.php.
In your case you could put system in /var/www/system or something and just have all of your installs point to that.

Since I install CodeIgniter using composer thou updating it is pretty easy since I get the updates automatically anytime I run composer update.

In your case you could do that in /var/www/system and it would give you /var/www/system/vendor/codeigniter/framework/system and you could run composer update to update it.

DMyers
Reply
#3

(This post was last modified: 04-22-2016, 12:55 PM by ronlin.)

Firstly thank your for your input.

Yes I agree that the composer is the best option for managing and maintaining a php installation, however the package codeigniter/framework is available since 3.0 and we are runing the version 2 so I can not consider this solution.  

Now I would like to go to some constructive criticism:

I put here the links for linux regular releases for a reason to not discuss the accuracy of file system hierarchy standards. That's to says you can put the php file where ever you want as far as you follow a correct file permission and ownership approach.

This is an output of phpmyadmin files system installed by debian package manager :
/usr/local# ls -l /usr/share/phpmyadmin/ | grep index
-rw-r--r--  1 root root   6701 Aug 12  2012 index.php

Here is another output of php files installed by Freebsd package manager:
ls -l /usr/local/share/pear/SOAP/Base.php
-r--r--r--  1 root  wheel  40045 May 15  2009 /usr/local/share/pear/SOAP/Base.php

Should we say that Linux designers have no clue how to manage file system ?

I believe that apache should have read only access to system folders and such folders should be located from /var/www/ so far as possible and this is exactly how the guys from Debian, Ubuntu-Server or Freebsd handle the things.
That is why I think that moving the codeigniter system folder to '/usr/local/codeigniter-version-number/system/' or /usr/local/share/codeigniter-version-number/system/ with root owner ship and 644 file permissions is more accurate than storing it under '/var/www'.
Reply
#4

Sounds great, I just like to keep my public web setups a little more locked down and monitor my apache .conf files for such directory access openings. but, it sounds like you have security already locked up so apache/php getting access to and reading a file it shouldn't doesn't seem like it will be a problem for you.

DMyers
Reply




Theme © iAndrew 2016 - Forum software by © MyBB