Possible for LCMS to server an entire website?

A place to discuss and receive support for LCMS (Little Content Management System)

Postby Aoirthoir » Sat Oct 07, 2006 6:59 pm

There are a couple of options to use LCMS for your entire website. If you place it in root, the root files get cluttered with your own files and the LCMS files. Further it may make it more difficult ot manage in future cases of LCMS updates. Finally, LCMS references a few ../ files. So if you place it in your domain's root, your CSS files may not work.

To resolve all of the issues I place LCMS in its own directory /lcms. Then I copy the original .htaccess file that comes with LCMS to my domain's root. I make the following modifications:

Changed line:
RewriteRule ^(.*)$ public.php?-path=$1

To now be:
RewriteRule ^(.*)$ /lcms/public.php?-path=$1

Changed line:
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]

To now be:
#RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
RewriteRule ^(.*) /lcms/admin.php

Obvioulsy this is just a simple commenting out then adding my own line. I am not sure if this will cause any security or other issues. Hopefully Mr. Steve will be able to comment on them as he has time.

While my site can be served from LCMS now, I still have an issue of the CSS not working from pages that use the include public.php method.

More to follow if I figure it out.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Tue Oct 10, 2006 2:48 pm

Ok well that above gives me some errors. For instance it still does not work for subdirectories down the line. But putting LCMS in root kept giving me no CSS styles. However I tried again and put it in root. Then I modified templates/MainTemplate.html.

Original File:





Changes:




Ok so this lets me put LCMS in the root and I have the styles. In addition I can access all files in lcms in any folder. And I get no error with admin.php.

However I dont know if there are other errors I might get, like not having a logo displayed..or such. Updates to follow.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Tue Oct 10, 2006 3:17 pm

Ok getting some errors with the graphics bar not being displayed. I will reinstall from scratch and let everyone know.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Wed Oct 11, 2006 5:46 am

Aparently I was getting that error even without the changes to CSS. Basically I would get a plain page, with no graphics. I did a complete reinstall on another domain to test. Anyhow I just went into the file templates/MainTemplate.html and commented out references to

{$ENV.DATAFACE_SITE_URL}

So that solved the problem. Of course I kept the original lines intact just in case. So I assume {$ENV.DATAFACE_SITE_URL} is not picking up its settings or something. Will peel that later on. For now though, it seems it is indeed easier to place lcms in root if I want it to access my entire site, rather than trying to muddle around in the .htaccess to create all sorts of redirects.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Wed Oct 11, 2006 8:42 am

Ok now I am getting an error on the directory structure. Let us say I have lcms in my root domain. If I go to something like say mydomain.com/myfiles/whatever.html it will display properly. If I do it as a php with the include ../public.php that will work as well. Then when I click the tabs it tries to access from /myfiles not from root. If I run from a subdirectory instead mydomain/lcms/myfiles it works fine. So its definitely a path thing.

So I think I just need to know where $ENV.DATAFACE_SITE_URL is set...perhaps it is not being picked up by LCMS's template/MainTemplate.html file? I assume it is supposed to apply to the current url for LCMS..and I would believe it should be set to the domain.com/lcms_directory but not 100%sure on that..will do some testing.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Wed Oct 11, 2006 11:10 am

Conclusion I think..

1. I placed the files all in the root directory. This way I can feed all my directories from LCMS if I want...encapsulate them around whatever file I want.

2. Modified conf.ini to have paths for the tabs. Thus index.php=Welcome becomes /index.php=Welcome. And so on down the line.

3. Removed references to $ENV.DATAFACE_SITE_URL in templates/MainTemplate.html.


Now LCMS has to be in the root otherwise I have to mess around with a .htaccess too much. If I dont have the changes to conf.ini listed above..when I go to a page in the domain but on a subdirectory, then my links for the tabs change to be that subdir. If I have the path listed in conf.ini for the tab it will pick it up from any subdir..even tabs that I have in a subdir.

Yes I did try changing the path in the DF database to /whatever.php but that did not resolve the issue. It seems the path is based on the current path somehow. So for instance if I want features.php to be accessed from domain/somedir/features.php then in the path field in the pages table I have to place somedir/features.php

So this works fine with the tabs if I just put /features.php or if I have pages db set to something else for features then I put /dirname/features.php and as long as they match..conf.ini and database it will work fine.

And since Ive removed references in MainTempalte to the datafacesiteurl field, then all of my CSS and images pick up fine as well.

So I think this is concluded and the only LCMS file that Ive really had to mess with is the MainTemplate.html. Thus on an update of LCMS I shouldnt have to worry too much about having to change a lot.

Dont know if this info will help anyone at least it is reference for the future.

Mr. Steve, thanks again for releasing this its a great program (now that I have the root stuff figured out I will be working on my app release now).
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm


Return to LCMS Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved