Saturday, November 9, 2013

My answer to "Mongo DB question in Config"

This is my answer to a Question on Support site for LampCMS project


OK, the replica set is a bit tricky, but not all that difficult.
First rule to remember - do not point to server by IP address - always use the domain name of member of replica set. If you don't have your own DNS server then just add the name to ip mappings to your hosts file

Then use this type of mongo connection string in your !config.ini

mongodb://rs1.example.com:27017,rs2.example.com:27017/?replicaSet=myReplSetName

I took this example from php.net documentation here:
http://php.net/manual/en/mongo.connecting.rs.php

There are other ways to connect to replica set but for Lampcms the easiest way it to just have this connection string in !config.ini in MONGO section as value of 'server'

Again - its very important to use domain names and not ip addresses. We learned this the hard way when we first started using mongo replica set at our project at my job. Yes, I work with mongo replicate set from php and node.js every day. I am not a server admin or DBA so I don't really touch the servers. I am a developer and write programs that use MongoDB in production at a pretty large scale. We use sharding and replica sets.

My answer to "WAMP + Mongo"

This is my answer to a Question on Support site for LampCMS project


You need to download the mongo extension .dll file for windows
Here are basic instructions:
http://www.php.net/manual/en/mongo.installation.php#mongo.installation.windows

Another source for these dll files is here
https://github.com/mongodb/mongo-php-driver/downloads

Make sure you download the right version - 32bit or 64bit version depending on your system. If one does not work try another one.

It took me awhile to find the driver that actually worked on my PC and now I don't even remember which one I ended up using. The point is - you may try several different .dll files

Just try one, restart your Apache and launch the file that only has phpinfo(); like it it
Look for the output of that file in browser to see if Mongo section is present. If not then the dll file did not work, try another one, restart Apache and repeat.

Wednesday, November 6, 2013

My answer to "WAMP + Mongo"

This is my answer to a Question on Support site for LampCMS project


I have wamp + mongo running on my local PC. That's basically my development environment.
You install them separately.
Download Mongodb for Windows, install it, then start it from command line by just launching the mongod from bin directory from the command prompt. Do not just click on mongod file - you must instead open command prompt, cd into the directory where mongod file is located and start it by just typing mongod
Do not close the prompt - just keep it opened for as long as you want your mongo server to run.

You may need to pre-create the c:/data/db directory on your computer. That's where mongo stores database files by default.

Read instructions just to be sure:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/


Then configure your WAMP server using sample config file in Lampcms distribution. In Lampcms in config/!config.ini edit the 'server' setting in MONGO section, like this:
server = "mongodb://127.0.0.1:27017"

That should work for your local mongodb server.

Tuesday, November 5, 2013

My answer to "Mongo DB question in Config"

This is my answer to a Question on Support site for LampCMS project


I will look into that. What I can suggest is to add the 3rd server to your replica set.
From what I understand about mongo replication is that the members of replicate set vote to elect the new primary when old primary goes down.

Read this documentation.

http://docs.mongodb.org/manual/core/replica-set-elections/

From the documentation:

"If you have a three-member replica set, where every member has one vote, the set can elect a primary as long as two members can connect to each other. If two members are unavailable, the remaining member remains a secondary because it cannot connect to a majority of the set's members. If the remaining member is a primary and two members become unavailable, the primary steps down and becomes and secondary."



Friday, October 25, 2013

My answer to "SMF Import"

This is my answer to a Question on Support site for LampCMS project


What do you mean by mergin profile with facebook/twitter? Lampcms already has option for users to connect their FB and Twitter accounts so Questions can be posted to FB/Twitter at the same time you ask a question.

Also links to user's Facebook, Twitter, LinkedIn, Blogger are added to user's profile when they connect their social accounts to Lampcms account.

And of cause once connected you can login with Twitter/FB, Google, LinkedIn login.

Friday, September 27, 2013

My answer to "How to Start the Forum ?"

This is my answer to a Question on Support site for LampCMS project


This means your php installation does not have the 'gd' extension. Do you know how to install or enable the 'gd' extension? It's used for creating the "captcha" image which is used on the registration page.

Friday, September 20, 2013

My answer to "Search Doesn't appear to be searching Titles"

This is my answer to a Question on Support site for LampCMS project


Fist about title search: try searching "searching titles" on this site. You will find this question, confirming that searching by title works.

Second: comments are not added to search index, so searching in comment does not work. This can be changed but will require tweaking indexer and search.

At this time search is powered by MySQL Full text search feature. One thing about MySQL full text search is that it will exclude documents from search results if the results are not unique enough. For example if you have just 3 questions in your new database and 2 of the questiosn have "building widgets" in the title, then searching for 'building widgets' will not return any results because MySQL will consider the results to be too common. I think document must appear in the index in less than 50% of documents to be returned in results.

Read this document:
http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html

Especially this paragraph:
"The search result is empty because the word "MySQL" is present in at least 50% of the rows. As such, it is effectively treated as a stopword. "

My answer to "lighttpd subdirectory example"

This is my answer to a Question on Support site for LampCMS project


I use lighttpd for hosting this support site and for development I use WAMP at home. So I know it works on Apache and Lighttpd. I have not tried on Nginx myself, just never had time to setup Nginx.

The lighttpd.conf sample file is included with Lampcms distribution, just give it a try. Of cause you must setup php using FPM

Here are some details about FPM
http://php.net/manual/en/install.fpm.php

Saturday, September 7, 2013

My answer to "ACL file for disabling anonymous users to see content"

This is my answer to a Question on Support site for LampCMS project


The viewing of questions and answers is not currently protected by ACL.

What will not logged in user see on the home page? Is user suppose to see list of questions but then clicking on a questions will show some sort of permission error?

If that's what you want you can add this line to the Lampcms/controllers/Viewquestion.php
right about the "protected function main()" line


protected $membersOnly = true;

Tuesday, August 27, 2013

My answer to "Sorting to see just unread"

This is my answer to a Question on Support site for LampCMS project


Currently unread (new) questions or questions that have new items are represented by the closed envelope icons. The logic to keep track of new items is actually implemented on client-side using html5 local storage feature.

In order to be able to have a tab where only new questions and questions with new items are shown per-user
we need to keep track on per-user 'read' activity on the server. It's a good suggestion for a new feature but it may take awhile for something like that to be added.

Tuesday, August 13, 2013

My answer to "Character Limit Questions/Answers"

This is my answer to a Question on Support site for LampCMS project




Did you look in !config.ini (in !confiig.dist.ini which of cause should be renamed to !config.ini before the install)

There are a few lines there (with comments above the config parameters)


So for Question and Answers there are way to set minimum chars, minimum words and only minimum length of title of the question.

There are no maximum limit for Questions and Answers.

;
; Minimum length of question in chars
MIN_QUESTION_CHARS = 10
;
; Minimum required length of question title
MIN_TITLE_CHARS = 10
;
; Minimum required length of comment
MIN_COMMENT_CHARS = 10
;
; Maximum length of comment
MAX_COMMENT_CHARS = 600
;
; Minimum number of words required in question
MIN_QUESTION_WORDS = 3
;
; Minimum length of answer in chars
MIN_ANSWER_CHARS = 10
;
; Minimum number of words required for answer
MIN_ANSWER_WORDS = 3

Sunday, August 11, 2013

My answer to "Comments ignoring MAX_COMMENT_CHARS"

This is my answer to a Question on Support site for LampCMS project


Basically the minimum of 10 and maximum of 600 chars were hard-coded in the javascript file and anything in between could be configured by changing these 2 values on !config.ini, so you were not allowed to set values outside of 10 - 600 chars.

I removed these hard coded strings from javascript and pushed commit to github. It's only in the qa.js file - so if you need this change for production you will have to minify this js file yourself and same with the same name as your current minified js file.

Tuesday, August 6, 2013

My answer to "Cannot ask a question using Internet Explorer"

This is my answer to a Question on Support site for LampCMS project


LampCMS was designed to handle multiple templating packages. I would rather create a second templating based on bootstrap. The idea is that end-user can select different 'theme' in which to view LampCMS.

That's why the structure of the style folder in www directory is
www/style/1/www

The idea is that you can have another theme under
www/style/2/www
theme can include own css file and own set of templates.

Also the reason for www folder under the theme id is that you can also have a mobile folder next to it.

The template loader was designed to handle inheritence-like loading of templates in the modile directory.

For example you may put a template in the
www/style/1/mobile and when viewing the site in mobile phone browser the loader will look in the
www/style/1/mobile directory but if template is not found there that it will load the template of the same name from the www/style/1/www directory.

This way you can create a more specific mobile-version template only for the templates that you want to be specific to mobile browsers while some other templates can be reused in all browsers.

I have not implemented this feature but the logic is there, all is left to do is for someone to create a different 'theme'

My answer to "Cannot ask a question using Internet Explorer"

This is my answer to a Question on Support site for LampCMS project


It's not a bad idea to upgrade YUI, but the problem is - the rich text editor that we use is actually from YUI 2.x, not even from YUI 3. It works really well with Chrome and Firefox.

I don't know if upgrading YUI will help in this situation if we still using the same version of editor.

As for using bootstrap for css it's a great idea. I would like to create bootstrap-based templating package for Lampcms. I even think we should use LESS for creating CSS files and then convert less files to css during build time for production release and use javascript-based less parser in debug mode.

Sunday, August 4, 2013

My answer to "Error when requesting password after joining with oAuth"

This is my answer to a Question on Support site for LampCMS project


I think it may be better to just allow underscores and dots in username so these created usernames will validate.

Try to make username() function in Lampcms\Validate look like this, let me know if this will allow underscores and dots in generated usernames.

public static function username($string)
    {
        d('$string: ' . $string);
        $ret = (0 !== \preg_match('/([a-zA-Z0-9@])([a-zA-Z0-9\-_.]{1,18})([a-zA-Z0-9])$/A', $string, $m));

        d('ret ' . $ret);

        return $ret;
    }


My answer to "Difference between revokeFacebookConnect and revokeOauthToken"

This is my answer to a Question on Support site for LampCMS project


These methods just remove the oauth token from their account (document in USERS collection)
These methods are used internally to unset the Twitter, Facebook details when the APIs return authorization errors.

So basically if script is trying to post to Twitter on behalf of user but Twitter API returns some type of authentication error we realize that user probably removed our app from their Twitter account. We then remove the Twitter token from user's account so that next time we don't waste time trying to post to Twitter API again, essentially will treat that user as someone who has not added Twitter to their account.

If you want you can write a script that will call these methods manually allowing user to remove the Twitter or Facebook credentials from their account.

Saturday, August 3, 2013

My answer to "Edited question/summary doesn't change"

This is my answer to a Question on Support site for LampCMS project


This was a bug, thank you for finding it. I pushed the updated code to github. It will also be included in the official release, but it will take awhile before the next build is released, so for now use github if you want this update.

Tuesday, July 30, 2013

My answer to "question on links"

This is my answer to a Question on Support site for LampCMS project


1) Write your answer in the editor, highlight the word you want to link, then the icon is not grayed out anymore. 2) Click on link icon, insert your link
3) Enjoy.

Saturday, July 27, 2013

My answer to "How do I generate a sitemap"

This is my answer to a Question on Support site for LampCMS project


First in your www/w directory create subdirectory called 'sitemap'
Make it writable.

Second - from command like issue this command

/path/to/your/php /path/to/your/lampcms/sitemap.php
Here /path/to/your/php is the path to your executable php (cgi version of php) file - usually it is not the same php as used by your web server.
On Windows it will be php.exe file, on Linux it is an executable php file installed with your php installation.

If it does not work look in your logs/cli-php.log file

It should generate the sitemap and index file in the www/w/sitemap/ directory

It will also ping Google, Bing and Yahoo with the locations of you sitemap

If it works then you may want to add this command to your cron file to be executed every day or every week.

You may also add the location of your w/sitemap/index.xml to your robots.txt file

Just add something like this to your robots.txt


Sitemap: http://yoursite.com/w/sitemap/index.xml


Thursday, July 25, 2013

My answer to "LOCALE and LANG problems"

This is my answer to a Question on Support site for LampCMS project


No need to remove database. All you need to do is login to your site as administrator, click on settings and then click on "Clear Cache" link

That will remove all cached translation objects from cache. Translation objects are cached to improve performance because you don't want to parse the xml file on every page load to load translation strings. These are parsed once and then created object is stored in C_Cache mongo collection. It's alot faster to get the object from Mongo then re-create it from xml files on every page load.

Anyway, there is a "Clear Cache" link in settings but it is only visible when you logged in with admin account.

You must clear cache after you change anything in your translation files which are basically xml files with the .xlf extension - in /config/translations/ directory

Wednesday, July 24, 2013

My answer to "What is twitter API_KEY?"

This is my answer to a Question on Support site for LampCMS project


There could be other reasons why twitter login does not appear on your site.
First of all this feature requires the php oauth extension.

If you don't have this extension installed then twitter button will not appear even you you add TWITTER_OAUTH_KEY and TWITTER_OAUTH_SECRET Second - the login block is cached for the duration of the session to optimize performance. You may need to login, then log back out in order to see the changes after you add values forTWITTER_OAUTH_SECRET and TWITTER_OAUTH_KEY

Monday, July 22, 2013

My answer to "Mongo DB in Auth mode"

This is my answer to a Question on Support site for LampCMS project


How does your server config option look like in !config.ini?
Mine is like this: server = "mongodb://127.0.0.1:27017"
To support authentication try something like this:
"mongodb://username:password@127.0.0.1:27017"
If this does not work try replacing this:
in file Lampcms\Mongo\DB.php around line 153
replace $this->conn = new \Mongo($server, $aOptions);
with $this->conn = new \MongoClient($server, $aOptions);

MongoClient was introduced in php mongo driver 1.3.0, so make sure you have at least the 1.3.0 version.

Let me know how it works our for you.

Wednesday, July 10, 2013

Server was down today due to power supply failure

My Question on Support site for LampCMS project

I noticed that this support site was down this morning, so I opened a ticket with iweb.com and they replied very fast and said that the power supply needed to be replaced.
As you can see they have replaced it really fast.

The only thing I had to do was to manually start one process: php-fpm which for some reasons did not start automatically. I was away from my computer for most of the day, that's why it took long.

This is just another proof to me that iweb.com is a pretty good host, seeing how quickly they fixed a server.

Click here to post your reply


My answer to "RSS Feeds Possible?"

This is my answer to a Question on Support site for LampCMS project


What do you want to be included in rss feed?

There is a REST api available for Lampcms, it's part of LampCMS actually, so you can request list of questions and do things like sort by, etc, can even add questions and answers via API using basic authentication.

Sunday, July 7, 2013

Decent hosting for Lampcms

My Question on Support site for LampCMS project

Hello everybody.

Sometimes people ask me to recommend a good hosting options to host Lampcms.
Just want to share my personal experience with the iweb.com hosting.

About 7 months ago I switched from softlayer to iweb.com because iweb had a much better deal on a dedicated server. I got a dedicated server for $89.00 a month. It has 8Gigs ram and 2 hard drivers about 300 gigs each.

This is enough to a very high traffic Q&A site including having MongoDB installed and Nginx or Lighttpd or Apache server. Since support.lampcms.com gets very low traffic, I can also host other sites on the same server. I actually let my son host minecraft server on it too, so he does not have to pay for any minecraft hosting.

Anyway, I was skeptical at first about iweb, the reviews were mixed - some good, some bad. But now after 7 months of continues uptime I can honestly say that iweb is a pretty good host.

Recently I had an issue where I could not get extra ip addresses to work on the server. I mean they gave me 1 primary and 4 additional addresses when I signed up. I only was using one, but when I tried to start using other ips they were just now working. So I opened a support ticket and turns out they gave me wrong ip address blocks. After some investigation they just gave me different ips and they work.

I was surprised when I was a charge of $18 for their 15 minutes of support time. I thought I did not have to pay for this since the issue was entirely their fault.

So I emailed them and they replied the next day saying that they are agreeing with me and credited my account.

I think they did the right thing.

So now I can feel good about recommending iweb as a good choice for hosting lampcms sites. You get dedicated server, you have to install everything yourself - it only comes with CentOS linux. Make sure you get 64 bit Linux. Then use YUM installer to quickly install MongoDB, Lighttpd.

Then use yum to install libxml and any other library you may need to build your php. Then download the php source and build it yourself using the usual configure, make, make install.

The bottom line is you can get a really nice server for under $100/month. They are running specials from time to time so you can get a server for like $59/month

It is cheaper that Amazon cloud EC2

By the way, the www.lampcms.com is hosted on Google App Engine and it written in JSP and some custom Java Servlet that I wrote. The reason for that is because App Engine is free for small low-traffic sites and it case I have to move supportl.lampcms.com to another server again at least I will not have to move the www.lampcms.com site - it sits comfortably on GAE.
The small custom servlet I wrote just reads the contents of the lampcms.zip file and reads the version file to figure out what is the latest release date and release version to show on download pages.
Another servlet is for streaming the phptest.php so it is downloaded by browser as a file and not just show the source code in the browser.

The rest of the pages are just basic JSP pages, basically just html, no dynamic logic there at all.

PS. I plan to try to install Lampcms on AWS EC2 (the free version of cause), and also I like the OpenShift cloud options, they have a free version of small instance that I think will be enough for hosting a small Q&A site. I'll share my experience with these after I make Lampcms site to run on these cloud hosts.


What about you? Do you have any hosting company that you can recommend for inexpensive dedicated server that can be used for hosting LampCMS site?

Click here to post your reply


My answer to "Adding/changing categories on existing questions"

This is my answer to a Question on Support site for LampCMS project


This feature is now available. I added the ability to change category when editing the question. The changes are in the github and also in the latest release on http://www.lampcms.com/download.htm

Thursday, July 4, 2013

My answer to "Adding/changing categories on existing questions"

This is my answer to a Question on Support site for LampCMS project


Currently no way to change category. I added the support for categories much later than other features were already written. I guess I just overlooked that one possibility that category may need to be changed.

I''ll add it to feature request now and will work on it shortly.

Saturday, June 29, 2013

My answer to "Adding/replacing Logo in the header"

This is my answer to a Question on Support site for LampCMS project


First thing I would recommend is to run your site in debug mode.
When running in debug mode the names of all the templates used in generation of the page are added to html source as html comments.
So just run the site in debug mode, open a page and view source html in the browser. You will see the full path to template files. Then just open the template file and you will be able to edit it.

My answer to "How to completely delete a user"

This is my answer to a Question on Support site for LampCMS project


Completely deleting user in production is a really bad idea.
First of all if you delete a user from the database the questions and answers from that user will still be in the database, the name of user and possibly an avatar will still be shown next to user's posts but link to profile will point to deleted account.
Link to a deleted account is not really a problem.

The problem is that you don't want someone else to later register with the same username that used to belong to deleted user.

This will just create confusion. Imagine you had a user that was so annoying that you deleted his or her account. First of all you don't want the same user to be able to just re-register with the same account.

Second you don't want someone else to just register with the account that used to belong to some really bad user.

Having said that, I agree that sometimes there could be a case when a user really wants his or her information to be completely removed from your database. I have not yet designed a way to completely delete a user in such a way that noone can re-register with the same email address or same username.

I think there should be a feature like this where user can be completely deleted but the hash of the email address will remain in the database. This way the user is deleted but same email address cannot be used again to just re-register. We can also store the timestamp where the email address was deleted. We will also need to keep the username in the database so than noone else can register with the same username.

I think this can be a good feature.

Right now if you want to completely delete user the best way is to manually delete from Mongo database using either mongo shell or some tool like robomongo or mongoVUE.

Tuesday, June 18, 2013

My answer to "Most Voted and Most Active questions doesn't work"

This is my answer to a Question on Support site for LampCMS project


The thing about these "Most votes" tabs is that the results are calculated from "the last 7 days"
This basically means "Most voted in the last 7 days"
I just voted up one of the questions and it started appearing in the "Most voted" tabs.

The reason for using the results from 7 days is because if you use the "all time" most voted, then usually there will be several very higly voted questions that will end up always appearing at the top of most voted, even if the questions are from a year ago.

On a fairly popular website with decent amount of voting activity the 7-days period is a good thing but if it's not what you want then you will need to tweak the code because I did not make this period configurable.

I will try to add this configuration to the next version.

Tuesday, June 11, 2013

My answer to "Is Registry->Viewer->save() calling \Lampcms\Mongo\Doc save()?"

This is my answer to a Question on Support site for LampCMS project


Yes, Viewer is the User object.
We call it Viewer to indicate that it represents the User who is currently viewing the page. It can be logged in user or a non-logged in guest user.

The reason for calling the user "Viewer" is to differentiate it from just any registered user. For example when you viewing someone's profile or when you following/unfollowing another user we would refer to that other user as "User" but you are a "Viewer" which is also a user.

I did not invent this terminology. I first saw it on some Google's API and I liked the idea.


Anyway, a Viewer is a User and User extends MongoDoc.

If you need help in debugging something you can always add new logging line anywhere in the script.

For example
d("new password is: ".$this->newPassword);

The d() function means debug-level logging. It will work only in debug mode and only when you configured the logging (path to log) in !config.ini properly.

Tuesday, June 4, 2013

MongoDB NYC Conference

My Question on Support site for LampCMS project

Hi everybody! Just wondering if anyone lives in or near NYC and will be going to the MongoDB 2013 conference on June 21?

I'll be there. I'm lucky because my employer is sending several people from our team, myself included.

If you are going just let me know. I'll be there.



Click here to post your reply


My answer to "Responsive design"

This is my answer to a Question on Support site for LampCMS project


I will look into that. I think responsive design has to do with css and templates, not so much with the javascript.
Anyway, I will be upgrading to the latest YUI library in about 30 days or so when I have more free time.

Wednesday, May 29, 2013

My answer to "Do I get points for asking questions"

This is my answer to a Question on Support site for LampCMS project


You don't get points for posting questions. You get points when someone upvotes your question or your answer or more points when someone accepts your answer as a correct answer. You also get 2 points when you accept someone's answer.

Sunday, May 26, 2013

My answer to "Any news on ad network integration?"

This is my answer to a Question on Support site for LampCMS project


What exactly is required in order to insert ads? I mean you can just modify a template an insert a piece of code like javascript or some static link to an ad.

As for inserting ads in search results that would require some additional code to be written, but for inserting ads in side bar or any other part of the site you can just insert the code in the template.

If you are running Lampcms in debug mode (configurable in !config.ini) then template names are added to the html code, just view the source code on the page and you will see exactly what templates are being used for assembling the page.

You can then find these templates and modify them.

Friday, May 24, 2013

My answer to "What value for POSTFIX_PATH?"

This is my answer to a Question on Support site for LampCMS project


Usually when you have postfix installed on linux the path to /usr/sbin/sendmail is actually pointing to postfix because postfix is installed in such a way that it replaces sendmail seamlessly.

I would leave it as default and only if you are having problems with sending out emails you can try to modify that path.

Saturday, May 18, 2013

My answer to "Can I change the name of the www folder?"

This is my answer to a Question on Support site for LampCMS project


Try this: do not alias www as something else, instead just rename the www to something else.
For example, rename the www directory to 'myforum'
then just access your lampcms installation as yourdomain.com/myforum/index.php

I'm pretty sure it will work. Aliasing does not work because the script has no way of knowing that you are accessing the www directory by a different name.

But if you actually rename the www to something else then script will pick up the real path.

Thursday, May 9, 2013

My answer to "is lampcms php 5.4 ready?"

This is my answer to a Question on Support site for LampCMS project


I have not tried it, so the best advice I can give is to try and report any errors you may be getting.
I am not planning to run in on 5.4 because I specifically want Lampcms to run on 5.3 because most web hosts will not be upgrading to 5.4 or 5.5 soon and having min version requirement of 5.3 is a good thing for now.

Again, I don't see any problems with running it on 5.4

Thursday, April 18, 2013

My answer to "Sign up issue"

This is my answer to a Question on Support site for LampCMS project


Basically this directory:
/Users/zhenbing/WebServer/lampcmsold/www/w/
must be writable. Hint: directory name is 'w' which stands for writable.

I'm pretty sure it's in the installation instructions.
http://www.lampcms.com/documentation.htm#installation

Sunday, April 14, 2013

My answer to "Subdirectory installation problems"

This is my answer to a Question on Support site for LampCMS project


This is possible now.
Look for the DIR setting in then
[URI_PARTS] section in !config.ini
For example you can set
DIR = "/forum"
then your Lampcms program will be accessible from the yoursite.com/forum/ url

Saturday, April 13, 2013

My answer to "Installation give me a blank index.php and I can't launch website"

This is my answer to a Question on Support site for LampCMS project


Have you tried launching the phptest.php from the browser? What does the output say?

Try this:
In !config.ini
change
DEBUG = false
to
DEBUG = true

You may want to setup the full path to your log directory
by providing value for
LOG_DIR

Make sure that directory is writable.

Then you should see some log message in the php.log
There may be some clues about the error in the log.

And of cause make sure that the 'w' directory under the 'www' is writable.

Wednesday, March 27, 2013

My answer to "Integration social accaunts"

This is my answer to a Question on Support site for LampCMS project


Read instructions in !config.ini in sections [FACEBOOK], [TWITTER] and [GOOGLE_API]

Sunday, March 24, 2013

My answer to "category and tag issue - after social linking"

This is my answer to a Question on Support site for LampCMS project


Thanks again.
I fixed the remembering of selected category. Could not fix the small bug with remembered tag being shown twice. This is not really a big deal because submitted values of tags are still filtered for duplicates on the server.

It's a bit annoying but this tags widget is pretty complicated. It will take more time for me to dig into the code to fix a fix.

Anyway, the category is being remembered now. The update is on github and in the new zipped download on www.lampcms.com

Friday, March 22, 2013

My answer to "Exception on main page when moving from Windows dev machine to linux production server"

This is my answer to a Question on Support site for LampCMS project


I've never seen this type of error, so I Googled it.

It looks like someone was having the same error with Symfony2 project, and I know Symfony2 uses XLIFF for translation, just like Lampcms.

Here is the discussion on StackOverflow

http://stackoverflow.com/questio...not-determinist

Basically they say to upgrade or downgrade your libxml2

Saturday, March 16, 2013

My answer to "tags filter does not work for unanswered tab"

This is my answer to a Question on Support site for LampCMS project


This has been fixed and is available in the latest download package (zip file from www.lampcms.com) and also in the latest github version.

Sunday, February 17, 2013

Possible ways to use MongoDB in next Servlet based project


Hibernate OGM
No JPQL query support,
must use raw Mongo query language directly and as a result
getting back Mongo Objects, not entities

To solve this the project integrates with Hibernate Search which uses
Lucene as a search engine.

When you insert/update an entity the data is also added to the search engine
This is pretty good for a full text search capabilities
and later can use JPQL against the Lucene instead of against MongoDB
This means that must install/configure and depend on Lucene

Upside: relatively easy to setup without upgrading anything on Application server
Can find entity by _id easily

Downside: either depend on Lucene OR use only native MongoDB queries

====================

EclipseLink NoSQL
Support for JPQL
Mongo document will be a normal entity
Can also use native MongoDB queries if JPQL just cannot do certain queries

Overall this is the most convenient way and pretty sweet
The downside is that Application Server may not include the latest version of the
EclipseLink jpa libriries and as a result must update the jar files directly in the
application server, which may not be possible in case of cloud hosting

===========

No dependencies on anything - just use MongoDB drivers
directly - no entities.
Get cursor back, iterate over results manually, add to collection,
then return collection
Write classes that know how to deal with BasicDBObject from mongo
For example when creating new Question a class QuestionParser will
take the request object, generate SubmittedQuestgionWWW, get all
data from it, put data into BasicObject
and then save BasicObject into DB

Must create indexes using "EnsureIndex" or something like that.

https://openshift.redhat.com/community/blogs/spatial-jee6-jax-rs-cdi-mongodb-on-paas
Something like this: (Requires CDI support)
@Named
@ApplicationScoped
public class DBConnection {

  private DB mongoDB;

  @PostConstruct
  public void afterCreate() {
    …
  }

  …
}

Most likely no JEE server is required, so Tomcat with CDI support
is all it takes

=========================

Mongo JEE
https://github.com/angelozerr/mongo-jee
Has good support for pagination
and integration with JAX RS
Also maps mongo cursor directly to
output stream json - no need to
create List from mongo cursor manually

Looks like will work on just about any server
that has CDI, most likely
inside tomcat container, no JEE application server
required.

============================



Saturday, February 16, 2013

MongoDB in EJB project with EclipseLink


First you need to update persistense related jar files
in Glassfish modules folder

Update 7 persistence related jar files
in glassfish/modules
This folder in my PC is located
in c:\Program Files\glassfish-3.1.2.2\glassfish\modules

first backup current files just in case - create a new sub-folder _backup

move the files from modules to this new folder:
org.eclipse.persistence.antlr.jar
org.eclipse.persistence.jpa.jar
org.eclipse.persistence.asm.jar
org.eclipse.persistence.jpa.modelgen.jar
org.eclipse.persistence.core.jar
org.eclipse.persistence.oracle.jar
javax.persistence.jar

Then from eclipselink website download new zip file,
look for OSGI bundle:
http://www.eclipse.org/eclipselink/downloads/index.php#2.4

unzip that downloaded zip into some directory like
c:\javalibs

Then copy the updated versions on the same 7 .jar files
to
glassfish\modules directory
In case here:
c:\Program Files\glassfish-3.1.2.2\glassfish\modules
and then rename each of these .jar files to remove the versioning part of
file name, for example
org.eclipse.persistence.asm_3.3.1.v201206041142.jar
should be renamed to
org.eclipse.persistence.asm.jar

Do the same of the other updated files

Finally add these 2 .jar files to your project libs via NetBeans:
org.eclipse.persistense.nosql_xxxxxxx.jar (xxxxx is a version string like _2.4.1.v20121003-ad44345.jar
and also download the java client .jar from mongodb download site
and also add the mongo-java-driver-2.6.2.jar to your project library (the actual latest version may
be greater than 2.6.2 by now)



Restart Glassfish server, this can be done from inside NetBeans

The mongodb can be used now, so a regular @Entity annotation can be used
to persist data to mongo

So far so good.

Mongodb does not have transaction support so you will be use translation-type="RESOURCE_LOCAL"
in the persistence-unit section in persistence.xml

Then you have to provide your own transaction support in the classes

Some examples and basic documentation
is here

http://wiki.eclipse.org/EclipseLink/Examples/JPA/NoSQL

Sunday, January 27, 2013

My answer to "linking linkedin accounts"

This is my answer to a Question on Support site for LampCMS project


I know. I just found yesterday about changes to LinkedIN API. I wrote an answer about that, here:
http://support.lampcms.com/viewquestion/quest2274/LinkedIn-posts-do-not-work

Basically LinkedIN did not provide email address when user connects with LInkedIN API, but after the recent changes to their API they started providing email address.

I am making changes to the logic so that we can detect (using email address) when existing user is adding a LinkedIn account.

Saturday, January 26, 2013

My answer to "Search AutoComplete Behavior Broken?, Inconsistant with Code Comments"

This is my answer to a Question on Support site for LampCMS project


OK, I just looked at the javascript in qa.js again and it looks like it's not a bug
The behavior that you described (in the comments) applies only to autocomplete in the "title" of the questions form.
When you asking a new questions there is another auto-complete form that searches for similar questions as you typing the title of your question. That autocomplete will take you to the question when you click on one of the suggested results.

The search form's autocomplete just enters the suggested results into the search form. It was always working like that, it's not a bug.

There is a third autocomplete - for the tags form on the "ask question" form. That one inserts suggested tags into the tags field.

My answer to "LinkedIn posts do not work"

This is my answer to a Question on Support site for LampCMS project


So it turned out that LinkedIn has updated their oauth based authentication/authorization API
It now requires to ask for specific permissions. I am already working on updating our LinkedIN integration script.

The one good news about this is that now LinkedIN shares user's email address with the API client. So basically the popup permission window tells user that the Applications wants to access their profile, get their email address and post to LinkedIN on their behalf. User can agree or decline.

Having email address provided by the API makes it easier to register new user - we no longer need to use the extra step that we used before to ask user for their email address right after the Join with LinkedIN was completed.

Also knowing the email address during the Sign In with Linked IN can help determine if the user with this email address already registered on our site, in which case we will just connect their existing account with their LinkedIN account.

I'm working on having the updates ready. Will probably take about a week to make changes and test them.

Friday, January 25, 2013

My answer to "LinkedIn posts do not work"

This is my answer to a Question on Support site for LampCMS project


Thank you for this update. I will test this fix and if it works will push changes to github

Sunday, January 13, 2013

My answer to "Can't login with ID/PWD and can't change password"

This is my answer to a Question on Support site for LampCMS project


The fixed version has been pushed to github