Pages

Monday, October 12, 2009

Blog - Liferay

Steps to Create Blogs in liferay

-->After login choose Add application button from the welcome menu.


--> Now choose Blogs from collaboration menu.

--> Now click on Add Blog Entry button for adding blog content




--> Enter the title and content details as you want. Then click on publish button.

--> You can give tags also to your posted blog content. After publishing you will get the blog list as follows. As a posted user you will have edit option to modify the content.


--> Now get the bloggers details, who are blogging on our site.

Add Applications >> Collaboration >> Recent Bloggers -- Add

--> Now you have completed the blog creation successfully.

--> best example of liferay Blog is














Liferay - Dynamic Virtual Hosting

Steps to use Virtual Hosting feature from Life ray

  1. Create virtual hosts in /windows/system32/drivers/etc/hosts file

127.0.0.1 localhost

127.0.0.1 localhost1

127.0.0.1 raj.com

  1. open control panel >> server >> Portal Instances

Add virtual hosts here



























Now open http://www.raj.com:8080/

Database Sharding:

To create database for each virtual Hosting:

Create three database schemas,Run minimal sql script for each database.

Restart liferay server, nowu are able to use three applications in same liferay server.

At present, sharding exists in Liferay from version 5.2.3+ for handling data across multiple portal instances. Here's what you do to get it up.

After you have a normally working development environment, make sure your hosts file is setup to allow virtual hosting (for our convenience, I will call the hosts abc1.com, abc2.com, abc3.com, etc.).

Use the create-minimal SQL script (from our Downloads section) to create three database schemas: lportal, lportal1, and lportal2.

Be careful and use the scripts for your liferay portal version, otherwise, it won't work. By default, the configuration files are setup for three schemas called default, one and two, but you can configure it for more.

All this configuration is set up in the file portal-impl/src/META-INF/shard-data-source-spring.xml .

As you will see, we will include this file in the property spring.configs in the next step. In case we want to modify it we just should write our own file in the Extension Environment and include it in this property instead of the default one.

In your portal-ext.properties, you will need to set the following:

Enable META-INF/shard-data-source-spring.xml under spring.configs.

Configure the jdbc schema settings for jdbc.default.*, jdbc.one.*, and jdbc.two.*.

Enable the shard names: shard.available.names=default,one,two

Don't forget to set the appropriate username and password for each schema.

Startup the server and create several (2-3) portal instances (e.g., abc1.com, abc2.com, abc3.com).

Using your favorite database browser, do a query on each of your schemas for the User_ table, and you will notice that the data is now distributed across different schemas. That's it!

Additional Settings

Remember that default, one, and two are default values defined in portal-impl/src/META-INF/shard-data-source-spring.xml and portal-ext.properties. If you want to change it, make sure to propagate the changes to the spring XML file as well as portal-ext.properties.

If you want to manually select the shard (via the GUI when creating portal instances), you need to enable in your portal-ext.properties file: shard.selector=com.liferay.portal.dao.shard.ManualShardSelector. Otherwise, the shard for the data will be chosen using a round robin technique.