Username
Forgot password?
Welcome to our site!
Or Join with FTTF

How to correctly redirect site's root directory for mutile websites?

0

6845 views
The installation instruction for lampcms says "Configure your webserver to point your site's root directory to the www directory".
However, I have different directories inside /var/www corresponding to different websites. If I set:
DocumentRoot /var/www/lampcms/www
I won't be able to access other websites.

If I don't change the setting of DocumentRoot, i.e. "DocumentRoot /var/www", when I access my lampcms site at: server_ip/lampcms/www, the site has no css style at all.

Can some one please explain me what's the correct way to configure root directory to make lampcms works?

Thank you,
 
asked August 23, 2012 at 8:17 AM

 us

2 Answers

0
 
Thanks Dmitri. I think what I must change is the sites-available/default file with the content given from RewriteRules.txt. However, I got this error when restarting apache after that:

Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

In the RewriteRules.txt, it explains that I need to put the following lines somewhere before the rules:
RewriteEngine on
RewriteCond $1 !^(index\.php|(.+)\.(css|js|png|gif|jpg|jpeg)$|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

However, I don't really understand where to put those lines? in which files?
Can you comment on that?

Many thanks,
flag
answered August 26, 2012 at 11:15 PM
0
 
For multi-site you need to have directory structure similar to this:


/usr/local/sites/site1/config
/usr/local/sites/site1/www

/usr/local/sites/site2/config
/usr/local/sites/site2/www

Then copy contents of www directory from Lampcms distribution into each site's www directory
Copy contents of config into each sites's config directory. Rename !config.ini.dist to !config.ini and acl.ini.dist into acl.ini inside each sites' config directory. Edit each sites' !config.ini file to have own db connection credentials.

Inside each sites' www directory rename bootstrap.dist.php to bootstrap.php

Upload a single file lampcms.phar from the Lampcms distribution to any location on your server. Edit each bootstrap.php to point to location of lampcms.phar (read instructions on bootstrap.php for that)

Your webserver's configuration will then point to each sites' www directory as the root of that website.

Optionally create rewrite rules for each site and don't forget to edit [URI_PARTS] section - if you setup your own rewrite rules then you need to leave the value of FILE blank in the [URI_PARTS] section



flag
Edited Aug 23, 2012 07:11 PM
full path to sites
answered August 23, 2012 at 7:10 PM

Your answer

Join with account you already have

FTTF

Preview

Alert