Tuesday, November 17, 2009

create csr for apache

Useful information found

1. Install OpenSSL, if not found on your server.

2. Create a RSA key for your Apache server:

cd /apacheserverroot/conf/ssl.key (ssl.key is the default key directory.)

If you have a different path, cd to your server’s private key directory
3. Type the following command to generate a private key that is file encrypted. You will be prompted for the password to access the file and also when starting your webserver: Warning: If you lose or forget the passphrase, you must purchase another certificate.

openssl genrsa -des3 -out domainname.key 1024

You could also create a private key without file encryption if you do not want to enter the passphrase when starting your webserver:

openssl genrsa -out domainname.key 1024

Note: We recommend that you name the private key using the domain name that you are purchasing the certificate for ie domainname.key

4. Type the following command to create a CSR with the RSA private key (output will be PEM format):

openssl req -new -key domainname.key -out domainname.csr

* Note: You will be prompted for your PEM passphrase if you included the "-des3" switch in step 3.

5. When creating a CSR you must follow these conventions. Enter the information to be displayed in the certificate. The following characters can not be accepted: < > ~ ! @ # $ % ^ * / \ ( ) ?.,&

DN Field

Explanation

Example
Common Name The fully qualified domain name for your web server. This must be an exact match. If you intend to secure the URL https://www.yourdomain.com, then your CSR's common name must be www.yourdomain.com.
Organization The exact legal name of your organization. Do not abbreviate your organization name. RapidSSL.com
Organization Unit Section of the organization Marketing
City or Locality The city where your organization is legally located. Wellesley Hills
State or Province The state or province where your organization is legally located. Can not be abbreviated. Massachusetts
Country The two-letter ISO abbreviation for your country. US

6. Do not enter extra attributes at the prompt.

Warning: Leave the challenge password blank (press enter)

Note: If you would like to verify the contents of the CSR, use the following command:

openssl req -noout -text -in domainname.csr

7. Submit your CSR to versign using the online application pages.

Create a backup of your private key!

Make a copy of the private key file (domainname.key) generated in step 3 and store it in a safe place! If you lose this file, you must purchase a new certificate.

* The private key file should begin with (when using a text editor)

-----BEGIN RSA PRIVATE KEY----- and end with -----END RSA PRIVATE KEY-----.

To view the contents of the private key, use the following command:

openssl rsa -noout -text -in domainname.key

Monday, October 12, 2009

Netbeans deployment error Caused by: java.lang.IllegalStateException: Delegate is not set yet

You need to delete

~/.netbeans/6.7/config/J2EE/TargetModules/* from my home dir

Thursday, September 3, 2009

multiple realms on a tomcat server.

  1. "localhost" appBase="webapps"
  2. unpackWARs="true" autoDeploy="true"
  3. xmlValidation="false" xmlNamespaceAware="false">
  4. "/TestRealm" debug="0" privileged="true" docBase="TestRealm">
  5. "org.apache.catalina.realm.JDBCRealm"
  6. driverName="oracle.jdbc.driver.OracleDriver"
  7. connectionURL="jdbc:oracle:thin:@moasrv07:1521:ccbuat"
  8. connectionName="cisadm" connectionPassword="cisadm"
  9. userTable="cm_BillSys_Users" userNameCol="user_name" userCredCol="user_pass"
  10. userRoleTable="cm_BillSys_Users_roles " roleNameCol="role_name" />

Tuesday, July 28, 2009

Good settings for netbeans 6.7 on osx

Here are some good settings I have used for netbeans 6.7 on osx 1.5.7

netbeans_default_options="-J-Dorg.glassfish.v3.installRoot=/Applications/NetBeans/sges-v3-prelude -J-Dcom.sun.aas.installRoot=/Applications/NetBeans/SUNWappserver -J-Dorg.glassfish.v3.installRoot=/Applications/NetBeans/sges-v3-prelude -J-Dcom.sun.aas.installRoot=/Applications/N\
etBeans/SUNWappserver -J-Xms512m -J-Xmx1024m -J-XX:NewRatio=20 -J-XX:PermSize=96m -J-XX:MaxPermSize=128m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-XX:+UseConcMarkSweepGC -J-XX:+UseParNewGC -J-XX:+CMSPermGenSweepingEnabled -J-XX:+CMSCl\
assUnloadingEnabled -J-XX:+CMSPermGenPrecleaningEnabled"

Tuesday, February 17, 2009

Problems building the uportal calender portlet

Uportal calender portlet


http://www.jasig.org/portlets/calendar-portlet

When building this seems to require

jakarta-slide-webdavlib version 2.2pre1-httpclient-3.0

as noted by maven.


ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) slide:jakarta-slide-webdavlib:jar:2.2pre1-httpclient-3.0

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=slide -DartifactId=jakarta-slide-webdavlib \
-Dversion=2.2pre1-httpclient-3.0 -Dpackaging=jar -Dfile=/path/to/file

Path to dependency:
1) org.jasig.portlet:CalendarPortlet:war:1.0.0-M2-SNAPSHOT
2) slide:jakarta-slide-webdavlib:jar:2.2pre1-httpclient-3.0

----------
1 required artifact is missing.

for artifact:
org.jasig.portlet:CalendarPortlet:war:1.0.0-M2-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2),
jasig-repository (http://developer.ja-sig.org/maven2),
jasig-snapshot (http://developer.ja-sig.org/maven2-snapshot),
Codehaus Snapshots (http://snapshots.repository.codehaus.org/)




Solution

Add this to your in your pom.xml file


caldav4j.repo
CalDav4J Repository
http://caldav4j.googlecode.com/svn/trunk/maven/

Wednesday, January 21, 2009

Consuming uPortal User Attributes as JSR-168 User Attributes

You need to add to your portlet.xml something like


User Family Name
user.name.family


where the attribute is the Key mapped within your PersonDirectory.xml or personDirs.xml (see manual chapter on user attributes).

Then from within your Portlet code you can access the values like this


Map userInfo = (Map)request.getAttribute(PortletRequest.USER_INFO);
String surname = (String)userInfo.get("user.name.family");

Using Two Databases with Hibernate

Found this little bit of code on the internet

Properties databaseAProperties = // get properties however you like
Properties databaseBProperties = // get properties however you like

SessionFactory databaseA
= new Configuration().configure("databaseA.cfg.xml")
.setProperties(databaseAProperties)
.buildSessionFactory();
SessionFactory databaseB
= new Configuration().configure("databaseB.cfg.xml")
.setProperties(databaseBProperties)
.buildSessionFactory();

Tuesday, January 20, 2009

Problems with Uportal giving a PermGen space error while using a hibernate portlet.

Apparently

PermGen space is controlled by a different java option:

So I wound recommend using

CATALINA_OPTS "-Xms1024m -Xmx2048m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"

as options for your tomcat server.