... h2. httpd.conf * Make your Apache config for all your domains, so they both point to the same directory {panel} ServerName one.com ServerAlias two.com ServerAlias *.cmshoster.com {panel} h2. directory layout * [Install Flux CMS|Installation_of_Flux_CMS ] with the installer, and then do the following {panel} mkdir hosts/ #in BX PROJECT_DIR {panel} h2. config files copy everything from install/conf-shared/ to conf/ {code} cp install/conf-shared/* conf/ {code} adjust the mysql parameters in config.xml: {code} vi conf/config.xml {code} The adjustments are for the "global access", not for one single-installation. All hosts are later running under the same mysql-user. So the tableprefix-parameter is not being used but gets fetched from the master-table (see below). {code} <db type="dsn"> <phptype>mysql</phptype> <username>foo</username> <password>bar</password> <hostspec>localhost</hostspec> <database>schnickschnack</database> <tableprefix>bxcms_</tableprefix> </db> {code} To have immediate success later, comment out the whole block "<permm type="permm">" Now do the following: {code} cp install/properties-shared.xml-dist install/properties-shared.xml vi install/properties-shared.xml {code} The important parameters are: {code} <property name="database.name" value="schnickschnack">Name of the database for the cms</property> <property name="database.user" value="foo">Name of the database user</property> <property name="database.password" value="bar">Password of the database user </property> {code} If you want to create new databases "on the fly", you also have to set the root-parameters, else, you have to comment them out! h2. .htaccess {code} mv .htaccess .htaccess-dist cp install/conf-shared/_htaccess_shared .htaccess {code} and make adjustements, if it needs them h3. RewriteMap We also use RewriteMap from mod_rewrite. See [http://blog.var.cc/blog/archive/virtual_hosts_with_mod_rewrite.html] for some overview. I added the following to our .htaccess: {code} RewriteCond %{REQUEST_URI} /*files/ RewriteCond ${lc:%{HTTP_HOST}|NONE} ^(.+)$ RewriteCond ${hostdir:%1} ^(.*)$ RewriteRule ^/*files/(.+)$ ./%1/files/$1 [L] {code} The Map {{hostdir}} contains the following: {panel} one.com hosts/one/ two.com hosts/two/ {panel} (this file is automatically created with the installer explained below) and the RewriteMap definition go into httpd.conf in the VirtualHost directives (they can't be put into .htaccess): {panel} RewriteMap hostdir txt:/www-data/kunden/bitflux/free/cms/conf/rewrite_hosts.map RewriteMap lc int:tolower {panel} h2. The Master-DB in /install there is a sql-dump called "master.sql". Create a database called freeflux_master and use the dump to create the table in there: {panel} mysql freeflux_master < ./install/master.sql {panel} h2. Using the installer In install/, there's a file called "installAll.sh" which should be used to install all hosts in the pipeline. The "master" table is per default in a separate database freeflux_master, you have to change the scripts, if you want to use something else for that. The "pipeline" is an SQL table called "master", the sql dump can be found in install/master.sql. The important fields are: * host: The hostname. * db: The database. you can put all hosts into one db or use different ones, they should just all be accessible by the same mysql-user. * prefix: the table prefix is in the standard bxcms installation. If you use one db for more than one host, you have to use different prefixes here * active: If it's active or not, 0 means to be installed, 1 is installed, 2 is inactive/closed * email: The adress the installation mail is sent to. This mail is important, it contains the password. * hostsdir: Where the directory for this host is. something like hosts/example_org/. different for each. Then call "installAll.sh" and all new instances not yet installed are to be installed. The install script then copies the necessary files to hosts/domainname_org/ and does the needed tables. To be able to use the installer as it is, also create a file ~/.my.cnf which containes something like this: {code} [client] user = foo password = bar {code} h2. Further adjustments * The mail which is sent can be adjusted in ~/install/index-shared.php * Be sure the LogFormat in your httpd.conf contains the %V-parameter ("UseCanonicalName" has to be Off in order to work properly with ServerAlias) * you can split the main logfile with the [split-logfile|http://httpd.apache.org/docs/2.0/programs/other.html] * installed themes get copied from the ~/themes-Folder * adjustments to the installation are done in the "makefile" ~/install/build-shared.xml h2. Documentation Todo's * Explanation of different params in the db (e.g. webalizer, ads) and how to use them * add some more basic-stuff :)
|