Sunday, August 14, 2016

How to configure gmail SMTP in Joomla?

Configure Gmail SMTP details

  • Login as "Administrator", click on "System" → "Global Configuration" menu. Click on "Server" submenu.

  • Fill in the details as shown below
  1. Send Mail: YES
  2. Disable Mass Mail: YES
  3. From email: [Your Gmail Accout]
  4. From Name: [Your Name]
  5. Mailer: SMTP
  6. SMTP Host: smtp.gmail.com
  7. SMTP Port 465
  8. SMTP Security: SSL/TLS
  9. SMTP Authentiation: YES
  10. SMTP Username: [Your Gmail Username]
  11. SMTP Password: [Your Gmail Password]
  • Make sure the extension=php_openssl.dll is enabled at php.ini
  • Click on "Send Test Mail" button to test the mail is delivered.

Saturday, August 13, 2016

How to hide and show menu based on user group in Joomla?

In order to show restricted menus to logged in user, below are the steps and configuration required

Create new "User Group"
  • Login as "Administrator", click on "Users" → "Groups" → "Add New Groups" menu. Add a new group with the name as "Custom".


  • Add user to the user group, for example, "user1" to "Custom" group.
  • Click on "System" → "Global Configuration" menu. Select "Permissions" tab, ensure "Custom" group "Site Login" action is set to "Allowed".



Create New Access Level

  • Click on "Users" → "Access Levels" → "Add New Access Level" menu. Add new level details as "Custom Level", select "Custom" user group.

Configure "Menu" access control
  • Click on "Menus" → "All Menu Items" menu, select a menu item "About Us" and assign the "Access" value to "Custom Level".

     
  • Assign 2 menu items as "Custom Level"

Verify the behaviour
  • Before login as "user1", launch the page, 2 menu items are displayed
  • Login as "user1", 4 menu items are displayed

Thursday, October 8, 2015

How to solve "SEVERE: One or more listener failed to start" error message in Tomcat startup log" when deploy and run OLAT application?

Startup the OpenOlat application on Tomcat server, encounter the error as described below. No clue of what could be the reason.
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
SEVERE: Context [/openolat] startup failed due to previous errors 
Solution
Please refer to http://blog.trifork.com/2011/03/18/debugging-the-dreaded-severe-error-listenerstart-and-severe-error-filterstart-tomcat-error-messages/ for solution After follow the steps as described in the blog, error message as shown below is displayed

org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of clas
s org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanInitializationException: Could not load pr
operties; nested exception is java.io.FileNotFoundException: class path resource
 [olat.local.properties] cannot be opened because it does not exist
        at org.springframework.beans.factory.config.PropertyResourceConfigurer.p
ostProcessBeanFactory(PropertyResourceConfigurer.java:87)
        at org.springframework.context.support.AbstractApplicationContext.invoke
BeanFactoryPostProcessors(AbstractApplicationContext.java:696)
        at org.springframework.context.support.AbstractApplicationContext.invoke
BeanFactoryPostProcessors(AbstractApplicationContext.java:671)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:461)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebA
pplicationContext(ContextLoader.java:410)
        at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:5003)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5517)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
7)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095
)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
1930)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: class path resource [olat.local.proper
ties] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPat
hResource.java:171)
        at org.springframework.core.io.support.EncodedResource.getInputStream(En
codedResource.java:143)
        at org.springframework.core.io.support.PropertiesLoaderUtils.fillPropert
ies(PropertiesLoaderUtils.java:98)
        at org.springframework.core.io.support.PropertiesLoaderSupport.loadPrope
rties(PropertiesLoaderSupport.java:175)
        at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProp
erties(PropertiesLoaderSupport.java:156)
        at org.springframework.beans.factory.config.PropertyResourceConfigurer.p
ostProcessBeanFactory(PropertyResourceConfigurer.java:78)
        ... 19 more

Tuesday, September 15, 2015

How to resolve MojoExecutionException error when build the OpenOlat project?

Try to download the OpenOlat version 10.3 source code as a gzip file from its portal, unzip the source code and build the project in maven. MojoExecutionException error message as shown below is displayed when "mvn clean package" command is executed.

[ERROR] Failed to execute goal org.openolat.mojo:buildnumber-maven-plugin:1.2.0:
hgchangeset (default) on project openolat-lms: Command failed.
[ERROR] EXECUTION FAILED
[ERROR] Execution of cmd : id failed with exit code: 255.
[ERROR] Working directory was:
[ERROR] D:\Projects\OpenOlat\openolat103
[ERROR] Your Hg installation seems to be valid and complete.
[ERROR] Hg version: 3.5+5 (OK)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.openolat.mojo:buildnumber-maven-plugin:1.2.0:hgchangeset (default) on project
 openolat-lms: Command failed.
EXECUTION FAILED
  Execution of cmd : id failed with exit code: 255.
  Working directory was:
    D:\Projects\OpenOlat\openolat103
  Your Hg installation seems to be valid and complete.
    Hg version: 3.5+5 (OK)

Reason

The OpenOlet mojo plugin can't be found, please refer to pom.xml

<plugin> 
     <groupid>org.openolat.mojo</groupid>
     <artifactid>buildnumber-maven-plugin</artifactid>
     <version>1.2.0</version>
     <executions>
          <execution>
               <phase>validate</phase>
	       <goals>
	            <goal>hgchangeset</goal>
	       </goals>
	  </execution>
     </executions>
     <configuration>
          <docheck>true</docheck>
	  <doupdate>true</doupdate>
     </configuration>
</plugin>

The proper way to build OpenOlat should be
  • Install TortoiseHg version 3.5
  • Clone the OpenOlat source code from http://hg.openolat.org/openolat103
  • Rebuild the project with "mvn clean package" command, you should be able to build the war file.



Sunday, September 6, 2015

How to shutdown the Apache web server process running at the background in Mac machine?

Run the command below to shutdown Apache Web Server background process in your mac machine

sudo killall httpd
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist

Monday, August 17, 2015

How to reset your first installed mysql database password?

  • For newly installed mysql database, the default database password is empty
  • In order to reset the password, type in the "mysql" command at terminal window. 
  • Type in the command below to reset the password
mysql > UPDATE mysql.user SET password=password('password') WHERE user='root' AND host='localhost';
  • If the error message as shown below is displayed
ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
  • Add the 2 parameter to my.cnf file
[mysqld]
skip-grant-tables
skip-networking
  • Restart mysql services
  • Type in command "mysql" to login into mysql, rerun the command below, you should be able to reset your root password
mysql > UPDATE mysql.user SET password=password('password') WHERE user='root' AND host='localhost';
mysql > FLUSH PRIVILEGES; 

Tuesday, August 11, 2015

How to delete external app from LaunchPad?

  • For external application that displayed at LaunchPad, long click doesn't called up the cross symbol to allow the user to delete away the app.
  • Below are some alternative way that I have come across from internet that might be useful
  • Launch the "Terminal" window
# cd ~/Library/Application\ Support/Dock
# ls
  • By listing the files in the folder, you will be able to find the database file
  • Run the command below to delete away the application from LaunchPad
# sqlite3 [DATABASENAME].db "DELETE from apps WHERE title='[APPNAME]';"

[DATABASENAME] represent the database name that we discovered at previous steps
[APPNAME] represent the name of the app
  • Run the command below to restart the launchpad. Voila, the external application is removed from LaunchPad.
# killall Dock