dinsdag 17 juli 2012

Mount webdav in ubuntu 12.04 as regular user


If you want to connect to a remote webdav as a regular user then:

  • Install the package
    • sudo apt-get install davfs2
  • Alter the system like stated here
    • sudo chmod u+s /usr/sbin/mount.davfs
    • In /etc/fstab
      • https://myremoteserver/home/user/ /media/mount_point davfs user,noauto 0 0
    • sudo usermod -a -G davfs2 user
  • Then you can 'mount [mount-point]'

Remember the webdav username and password

Alter the file /etc/davfs2/secrets and put a line in there like
  • https://myremoteserver/home/user/ username password

maandag 16 juli 2012

Install nginx on ubuntu 12.04 and connect it to Tomcat


First install nginx like stated here.
  • sudo apt-get install nginx
  • sudo service nginx start
Next, configure nginx to connect to Tomcat like specified here and here

server {
    listen 80;
    server_name hostname.org;

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8080/;
    }
}

These two blogs do not mention the fact you'll have to tell tomcat you're using a proxy. So in [tomcat-home]/conf/server.xml make sure the Connector has a proxyName and proxyPort.
  • <Connector port="8080" protocol="HTTP/1.1" proxyPort="80" proxyName="hostname.org" ..... />
If you run into the problem that the browser got too many redirects then first make sure the Home URL in the Portal Settings is set to something useful. This can also be done in the portal-ext.properties file.
  • company.default.home.url=/web/guest/home



Some alterations to Liferay after the clean install


  • Goto Portal Settings and
    • Change the way users authenticate.
    • Replace logo and set correct timezone.
    • Remove the role Power User for newly created users.
  • Change the Site Settings so the site is active and private.
  • Change the domain name of the default portal, the webId
    • Before a clean install you can extend the property in the portal-ext.properties by setting company.default.web.id=<yourdomain.com>
    • After an install you can change this by UPDATE Company SET webId = 'new-web-id.com' WHERE webId = 'liferay.com';
  • Remove the pre population of the username in the sign-in portlet
    • company.login.prepopulate.domain=false
  • Remove the footer "Powered by Liferay"
    • /tomcat/webapps/ROOT/html/themes/classic/templates/portal_normal.vm
  • Remove the chat-portlet from web apps directory in Tomcat to remove the chat bar on the bottom of the page for signed in users.
  • Remove the top docbar for specific roles. See this blog.
    • ROOT/html/themes/classic/templates/portal_normal.vm
    • the part surrounding #dockbar()
  • In the portal-ext.properties, force that new users do not get public and private pages. See here.
    • layout.user.private.layouts.enabled=false
    • layout.user.public.layouts.enabled=false
  • Add sign-out option to the template
    • ROOT/html/themes/classic/templates/portal_normal.vm
    • #if ($is_signed_in)
      • <a href="$sign_out_url" id="sign-in" rel="nofollow">$sign_out_text</a>
    • #end

Changing default login behavior for Liferay

Portal properties

Somewhere in the property structure of liferay you can alter these settings. A good place would be the portal-ext.properties in your application server. The auth.login.url determines where you go when you click Sign-In. The landing page is the page a user is directed to after a correct login.

auth.login.url=/web/guest/home
auth.forward.by.last.path=true
default.landing.page.path=/web/guest/specific-page

vrijdag 13 juli 2012

Install Oracle Java JDK7 on Ubuntu 12.04

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

donderdag 12 juli 2012

Clean installation of Liferay 6.1 community edition.

Install Liferay.

The standard community edition provides Liferay with a memory database and a demonstration portal. For a clean installation we connect Liferay to the mysql database and remove the 7cogs demo portal.
  • Have an empty MySql database ready with a user account privileged for the creation of tables.
  • Download Liferay 6.1.0 community edition with Tomcat 7 directly from sourceforge. Unzip it.
  • In the webapps directory in Tomcat remove the 7cogs hook.
  • Startup liferay with bin/startup.sh (or bin/startup.bat on windows) in the tomcat directory of your Liferay distribution.
  • Goto http://localhost:8080/

Configuring Gmail as the default for liferay.

To use Gmail as the mail sender for your Liferay installation goto Server Administration and then Mail. Gmail uses smtp.gmail.com with 465 as the port to establish a secure connection. Use a existing user account for the username and password fields.