Serverwide installation of PHP framework

mvdg27

Verified User
Joined
Oct 25, 2006
Messages
20
Hi,

I'm not sure if I'm placing this in the correct forum, but this one seemed like the most appropriate one.

Ok, let's explain my situation: I have a Virtual Private Server with DirectAdmin installed on it. I use the VPS to host the website of my web design company. For my websites I often use a PHP framework called CodeIgniter (www.codeigniter.com). Currently I upload the entire system folder of the framework to the user's hosting account to be able to use it.

I'm thinking that there has to be a better way to do this. I'm thinking of a way to install the framework once, which is then available to all domains and users. In the configuration of each specific application, I would be able to point to the right CodeIgniter path.

My only question is what would be a good way to install this in a DirectAdmin server environment? I'm fairly new to server administration, so any help on this matter is greatly appreciated!

Thanks very much in advance!
 
I am not familiar with codeigniter, but your best bet is to emulate the setup that DA uses with phpadmin, squirrelmail, roundcube, et all. You will need to get your hands dirty with the Apache config and you will need to be careful separating the shared vs non shared parts of your framework.

On my system, those components are installed in /var/www/html and the magic that makes them available to all domains is located in /etc/httpd/conf/extra/httpd-alias.conf

The basic concept is that in an Apache configuration, a ServerAlias OUTSIDE any directory section applies to all domains - i.e. all domains are aliased to the same location. If you go this route, I suggest you do not change anything in httpd/conf/extra, but instead add your own alias directly to httpd.conf where it is less likely to be overwritten by a DA update. Note the webapps ownership is necessary if you are running with suphp - follow the method that DA uses and you will be OK.

That said, if you don't need things to be accessible via URLs, it is much less a PIA from a maintenance standpoint, to setup a library area outside of any document root (but still accessible via FTP) and change the php include path so the stuff can be fetched from anywhere. You will still need to play with Apache via a DA template change to make sure the library area is within everyones basedir restriction.

Hope that helps.
 
Back
Top