Linux: Generate SSL CSR Key with Apache Linux

Oops.. It is been a while MGe disappeared and here I come back again after long holiday for blogging. ūüôā

This article used to guide you to create the CSR(Certificate Signing Request) from your Apache machine.

Web Server: Linux
Web Service: Apache

1. First of all, you will need to create a key pair.

openssl genrsa -out www.yourdomain-example.com.key 2048

– Replace the mickgenie.com with your domain name.
– The number of 2048 used to determined the bit-length of your certificate, where you are advise to have 2048 and above.

2. You will be asking for the pass phrase and you may enter any strong password.

3.  Next, you will need to generate the CSR.

openssl req -new -key www.mickgenie.com.key -out www.mickgenie.com.csr

Next, you will be asking for Country Name, State or Province, Locality or City, Company, Organizational Unit, Common Name and Email Address.

4. Get your CSR and purchase the SSL from SSL provider.

How to Disable directory listing

Some web hosting server setting allow the directory listing by default and you wish to disable it as you might not use the hosting space for web purpose but storage purpose.

There are several ways to disable it through your space as steps below.

Apache Linux with cPanel
If your hosting company provide cPanel, it will be great it allow you easily to disable it through the control panel.

In this guide, Mick Genie guide you how to disable it through cPanel 11.25(x3 themes).
1. Log into the cPanel control panel.
2. Look for Advance box and click on Index Manager.
3. A pop up box show and select the domain name that you wish to disable it.
4. Select the folder.
5. From the radio button, select No Indexing and save it.

Apache Linux without cPanel
If you do not come with cPanel, it isn’t a hard step to disable it.

1. Log into the SSH console.
2. Change directory to the public_html path(assume your root path is /home/mickgenie/public_html/)

cd /home/mickgenie/public_html

3. Edit/create the .htaccess file

vi .htaccess

4. Add the line as below to the .htaccess file by click on Insert button and insert,

Options -Indexes

5. Save it by type in :wq!.

Understand and read core.xxxx files

With Apache Linux box, sometimes you might get lots of file named core.xxxx where xxxx is some number. You might wonder what is these file.

Normally core.xxxx file was generated from Linux box and holds the current state of a process working memory when a process is crashed. To read the file, run the command as below from your shell.

strings core.1234

From the strings reading, each line represent different state of a process.