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.

Understand ASP.Net custom error

It is very normal when you design your script in ASP.Net and getting some runtime error as attached below when you are designing your script from your local PC and uploaded to the web server.

With the above error, some programmer not even know what to do :S .

Today, MGe will guide you on what is the custom Error type and how to make it work when you are hosted to the web server that do not have the administrator privilege.

Basically custom error used to hide the real error from the script from the visitor, where it might be the sensitive information from your website such as connection string.

The ASP.Net <customErrors /> do have 3 types, such as On, Off and RemoteOnly. In short, may refer to the table as below.

Off Show everyone the detailed error message.  This is rarely a good idea.
On Don’t show anyone the detailed error message.
RemoteOnly Only show the detailed error message if you are testing from the local server where the site resides.

To set it, just open your web.config file and set it from the <system.web>.

Eg.

<customErrors mode="RemoteOnly" />

Install FrontPage Server Extension to IIS 7.x

Although Microsoft FrontPage Server Extension (FPSE) 2002 will be discontinue by 18 December 2010 on Windows Vista and Windows Server 2008 RTM,  but it is quite important for some web designer to design and publish their website.

To install Microsoft FrontPage Server Extension (FPSE) 2002 on your server with IIS 7.x, you may need to install the following Roles and Features.

  • Web Server (IIS) Role Services:
    • Web Server
      • Common HTTP Features
        • Static Content
        • Default Document
        • Directory Browsing
        • HTTP Errors
      • Application Development
        • ISAPI Extensions
        • ISAPI Filters
      • Health and Diagnostics
        • HTTP Logging
        • Request Monitor 
      • Security
        • Windows Authentication or Basic Authentication (See note 2)
        • Request Filtering
      • Performance
        • Static Content Compression
    • Management Tools
      • IIS Management Console
      • IIS 6 Management Compatibility
        • IIS 6 Metabase Compatibility
  • Features:
    • Windows Process Activation Service
      • Process Model

1. Next, you may download the Installer as URL below.
Download here.
2. Then Install it to your server/computer.
3. You have done it. 🙂

Fixed DotNetPanel ASP.Net 4.0 not installed

Recently I found out when you have ASP.Net 4.0 installed from your server but your DotNetPanel do not show it is installed. To fix it, simply modify your MSSQL database data.

1. you should backup your MSSQL database.
2. Open table ServiceDefaultProperties.
3. Check for the ProviderID of 2 and 101 if contain AspNet40Path(32 bits server) or AspNet40x64Path(64 bits server).
4. If not, add them to the MSSQL and point to the path as below.
AspNet40Path -> %SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30128\aspnet_isapi.dll
AspNet40x64Path -> %WINDIR%\Microsoft.NET\Framework64\v4.0.30128\aspnet_isapi.dll

Check if ASP.Net 4.0 show from your server setting. If not, you may proceed to the step below.

1. Backup MSSQL database.
2. Open table ServiceProperties.
3. Check if AspNet40Path and AspNet40x64Path existed for each of the ServiceID.
4. If you have multiple web server and do not know which server belong to which ServiceID, open table Services and Servers.
5. Check for Services table and look for ProviderID of 2(IIS6) or 101(IIS7). Check for the ServerID and verify the server from Servers table.
6. Add the record as below.
AspNet40Path -> %SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30128\aspnet_isapi.dll
AspNet40x64Path -> %WINDIR%\Microsoft.NET\Framework64\v4.0.30128\aspnet_isapi.dll

Free Proxy Server List

Sometimes, you might want to hide your IPs from the Internet to perform some task or even want to try to test some task from different country.

A proxy server has a large variety of potential purposes, including:

  • To keep machines behind it anonymous (mainly for security).
  • To speed up access to resources (using caching). Web proxies are commonly used to cache web pages from a web server.
  • To apply access policy to network services or content, e.g. to block undesired sites.
  • To log / audit usage, i.e. to provide company employee Internet usage reporting.
  • To bypass security/ parental controls.
  • To scan transmitted content for malware before delivery.
  • To scan outbound content, e.g., for data leak protection.
  • To circumvent regional restrictions.

Now, you may get the free proxy server list as URL below.
http://www.digitalcybersoft.com/ProxyList/fresh-proxy-list.shtml

What is DNS?

What would be a DNS from your mind? DNS could be Domain Name Service or Domain Name System.

By right a domain name will referring to the DNS setting and understand which web server or server should it go and an Internet User could only able to get the page work from their Browser.

Basically, DNS could be the group in 2 major group where I will separate it to parent DNS and child DNS. With Parent DNS, it meant that the DNS of your domain name set that referring to your DNS server such as ns1.mickgenie.com and ns2.mickgenie.com.

Once the parent DNS setting up, the domain will connect to the DNS server and you will have A, CNAME, MX, TXT, and so on record to refer so the subdomain, email services and some rules called from TXT will done accordingly.

Below is some of the record available.
1. Address Record (A record),
A record normally used by an IPs only where it could resolve to 4 blocked of IP which something like 127.0.0.1 and you shall not point it to a domain base such as mickgenie.com and this will cause it not working.

2. Canonical Name (CNAME),
CNAME used a user-friendly domain name such as mickgenie.com to allow a user do not need to remember the IPs based address and this is easily for a web services to connect to different server if they have more than 1 server within the subdomain.

3. Mail Exchange(MX),
MX record used for the email services and it used to recognize if you have more than 1 email server and if you have backup email services.

4. Text (TXT),
TXT record is widely used when a DNS services contain a Sender Verify Framework(SPF) were used to protect spamming record, etc.

TXT also used when you have a domain key such as Yahoo! email services protection.

Remote MySQL Access for cPanel

By right, MySQL is one of the engine that used up lots of I/O and Memory resource from a server. Somehow you may use this scenario to setup so-called Clustering Web and MySQL server to reduce the I/O usage.

To setup remote MySQL server, you need 3 main steps as below.
1. Grant remote access to cPanel root user.
2. Add remote host information to /root/.my.cnf file.
3. Configure PHPMyAdmin configuration.

1. Grant remote access to cPanel root user,
To grant remote access to cPanel root user, you will need to amend the MySQL privilege as line below.
mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]`192.168.1.1` IDENTIFIED BY ‘password’ WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]`mysql.mickgenie.com` IDENTIFIED BY ‘password’ WITH GRANT OPTION;

2. Add remote host information to /root/.my.cnf file,
Next, you will need to change the host of the MySQL location to the slave server.
[client]
user=”root”
pass=”password”
host=”mysql.mickgenie.com”

3. Configure PHPMyAdmin information,
Open file /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php, configure the setting as below.
$i++;
$cfg[‘Servers’][$i][‘host’] = ‘mysql.mickgenie.com’;
$cfg[‘Servers’][$i][‘port’] = ‘3306’;
$cfg[‘Servers’][$i][‘socket’] = ”;
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘extension’] = ‘mysql’;
$cfg[‘Servers’][$i][‘compress’] = FALSE;

You have done the setting.