How to create pfx (PKCS12) file using openssl

If you have a certificate file and private key and need to move that to a Windows server you can easily create a pfx file that can be imported on the Windows server.

Here’s how:

openssl pkcs12 -export -in {cer_filename}.cer -inkey {key_filename}.key -out {pfx_filename}.pfx

You will be asked to provide a password. You’ll need to use this password when you import the certificate on the Windows server.

Configure Magento to store session data in the database

I’ve had some problems on a Magento installation where all inodes are used up to store the session data. To fix this I had to configure Magento to store the sessions in the database instead of the file system. This is how I didi it:

1. Edit the local.xml configuration file and locate this line: (pico app/etc/local.xml)

<session_save><![CDATA[files]]></session_save>

Continue reading

How to measure web site’s response time with wget

This may be useful when doing tests of a web site’s response time. You can add “time” before any command to measure the time it takes.

time wget http://www.aip.im -q --output-document=/dev/null

Results

real    0m0.349s
user    0m0.000s
sys     0m0.004s

The “real” value indicates the time it took to receive http://www.aip.im.

How to solve URL scheme mismatch when running Jira behind a reverse proxy

I’m running Jira behind a Nginx proxy with SSL enabled. Jira was giving me this error message in the login:

We've detected a potential problem with JIRA's Dashboard configuration that your administrator can correct. Click here to learn more
 
We've detected a potential problem with JIRA's Dashboard configuration that your administrator can correct. Hide
Dashboard Diagnostics: Mismatched URL Scheme
 
JIRA is reporting that it is using the URL scheme 'http', which does not match the scheme used to run these diagnostics, 'https'. This is known to cause JIRA to construct URLs using an incorrect hostname, which will result in errors in the dashboard, among other issues.
 
The most common cause of this is the use of a reverse-proxy HTTP(S) server (often Apache or IIS) in front of the application server running JIRA. While this configuration is supported, some additional setup might be necessary in order to ensure that JIRA detects the correct scheme.
 
The following articles describe the issue and the steps you should take to ensure that your web server and app server are configured correctly:
 
    Gadgets do not display correctly after upgrade to JIRA 4.0
    Integrating JIRA with Apache
    Integrating JIRA with Apache using SSL
 
If you believe this diagnosis is in error, or you have any other questions, please contact Atlassian Support.
 
Detailed Error
 
com.atlassian.gadgets.dashboard.internal.diagnostics.UrlSchemeMismatchException: Detected URL scheme, 'http', does not match expected scheme 'https'

To solve it you need to edit the server.xml config file located in the Jira “installation directory”, by default: /usr/local/atlassian/jira.

Open the config file with a text editor and add these three lines in the Connector node (pico /usr/local/atlassian/jira/conf/server.xml):

...
    <Service name="Catalina">
        <Connector port="8103"
                   maxThreads="150"
                   minSpareThreads="25"
                   maxSpareThreads="75"
                   connectionTimeout="20000"
                   enableLookups="false"
                   maxHttpHeaderSize="8192"
                   protocol="HTTP/1.1"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   acceptCount="100"
                   disableUploadTimeout="true"
 
<!-- Lines added to solve the URL scheme mismatch -->
        scheme="https"
        proxyName="example.org"
        proxyPort="443"
/>
...

Replace proxyName and proxyPort with the hostname and port of your reverse proxy.