Sunday, August 11, 2013

How to Enable SSL in Apache2 on Ubuntu

In this tutorial, I’ll explain you that how to enable the SSL for your website under Apache2 on Ubuntu Server. For this, I’m assuming:

1. That you have a working apache2 setup on your Ubuntu Server.

2. You have correctly configured the dns records for your domain.

3. You already got a certificate from a trusted certificate authority (CA) such as Godaddy,Verisign, Comodo, etc.

Let’s verify our web server that it is up and running, before beginning this tutorial:
http://rbgeek.com

1

Create a directory inside the /etc/apache2/ directory,where we’ll save the private key, public key certificate and bundle certificate:
cd /etc/apache2/ 
sudo mkdir ssl

2

Transfer the private key, public key certificate and bundle certificate inside the /etc/apache2/ssl/ directory and verify it:
cd ssl
ls

3

We want to configure the apache in such a way that it’ll run on HTTPs and for this we need to enable ssl Apache2 module with a2enmod:
sudo a2enmod ssl

4

It will suggest you to restart apache,ignore that message for now.

Edit the ports.conf file:
sudo nano /etc/apache2/ports.conf

5

Ensure that port 443 is defined as follows and add the NameVirtualHost for port 443,comment other lines:
NameVirtualHost *:443
Listen 443

6

Open up the SSL config file:
sudo nano /etc/apache2/sites-available/default-ssl

7

Fill in the correct ServerAdmin email address,add the ServerName line and adjust the path in the DocumentRootline. Also make sure that we have a valid path for the SSL:
8

Now we need to configure the SSL site:
sudo a2ensite default-ssl

9

Restart the Apache service:
sudo /etc/init.d/apache2 restart

13

Now we should be able to connect to the server through SSL using Chrome or any other browser:

14

Verify the Certificate, that it’s the same that we got from a trusted certificate authority (CA) and configured:

15

Our Web Server is also working with http (port 80).But, we don’t want that users access it through http, we only want to access it through https. To fix this, we need to edit the /etc/apache2/sites-available/default file:
sudo nano /etc/apache2/sites-available/default

16

Delete everything and add a redirection:
RedirectPermanent / https://rbgeek.com/

17

Restart the apache2 service:
sudo /etc/init.d/apache2 restart

18

Now if we go to http://rbgeek.com/, it will redirect us to https://rbgeek.com/

Sunday, August 4, 2013

1 TB cloud storage free for 6 months (Shared.com Pro account )



Shared.com is a cloud storage service which allows you to upload and share files for free. You can send a document or backup your music, photos in an easy manner. The shared.com pro account allows you to store files up to 5 GB with a storage limit of 1 TB. It supports all file types. The option includes forever storage, unlimited bandwidth, no advertising and hot linking



 

How to get 1 TB cloud storage using Shared.com Pro account for free ?

 

1. Go to Shared.com Page.

2. Register you account and get $ 60 worth cloud storage for free

Saturday, August 3, 2013

How to install the Apache mod_ssl module on CentOS

mod_ssl









mod_ssl is an Apache module that provides SSL v2/v3 and TLS v1 support for the Apache HTTP Server.  See the mod_ssl documentation for more information.

How to install the Apache mod_ssl module


1. Run the mod_ssl install command
yum install mod_ssl

How to configure the Apache mod_ssl module


1. Open the mod_ssl Apache configuration file located at /etc/httpd/conf.d/ssl.conf



#nano /etc/httpd/conf.d/ssl.conf

2. Enable name-based virtual hosting on port 443
Add the following text just before the SSL Virtual Host Context comment
# Use name-base virtual hosting

<VirtualHost *:443>

3. Disable the default https host
Comment out all text following the SSL Virtual Host Context comment

4. Restart the Apache HTTP Server
service httpd restart





Thursday, August 1, 2013

Install cPanel & WHM

CPANEL is professional manager for Linux.
In order to install cPanel & WHM, you have to: 
#cd /home
#wget -N http://httpupdate.cpanel.net/latest
#sh latest

If license is not valid (because of firewall or IP change),  you just run  /usr/local/cpanel/cpkeyclt to activate license for your IP.

Note: When installing cPanel & WHM, Apache 2.2 vĂ  PHP 5.2.17  are installed default. After installation is finished, you can edit  web Apache and PHP with WHM EasyApache.
Installing time is about 2-5 hours according to your server position.

In order access admin page of WHM, just go https://$IP:2087  with your ROOT account.

Thursday, July 25, 2013

How to install mod_rewrite on CentOS

mod_rewrite is an Apache module used to manipulate URL's and is compiled into the base Apache HTTP Server in CentOS.

How to configure the Apache mod_rewrite module



  1. Open the Apache configuration file located at /etc/httpd/conf/httpd.conf

  2. Change AllowOverride None to AllowOverride All  One inside <Directory /> and another one inside <Directory "/var/www/html"> and then it worked. Hope it helps somebody! P.S. I didn't use Virtual Hosts


Permanently redirect users to access the site WITH or WITHOUT the 'www.' prefix



  1. Create/Open a .htaccess file in the document root folder and add the following text replacing variables with appropriate values where necessary
    # mod_rewrite
    <IfModule mod_rewrite.c>
    # Enable mod_rewrite engine
    RewriteEngine on

    # WITH 'www.'
    RewriteCond %{HTTP_HOST} ^$uri\.$tld$ [NC]
    RewriteRule ^(.*)$ http://www.$domain$1 [L,R=301]

    # WITOUT 'www.'
    RewriteCond %{HTTP_HOST} ^www\.$uri\.$tld$ [NC]
    RewriteRule ^(.*)$ http://$domain/$1 [L,R=301]
    </IfModule>

    Note: Choose either WITH or WITHOUT the 'www.' prefix.  Do not include both or you will end up in a redirection loop.
    Note: If there is already an <IfModule mod_rewrite.c>directive, only copy the desired #RewriteCond and#RewriteRule lines and add them to the directive.
    Note: Replace http:// with https:// if used for a Virtual Hosts using the https protocol.
    Note: This text can also be added to the VirtualHost directive in the apache configuration file, but you can't typically move these changes to a live server, so the .htaccess file is the prefered method.

  2. Restart the Apache daemon
    service httpd restart

Wednesday, July 17, 2013

30 High-Quality Responsive Opencart Themes

Today we will show high-quality premium responsive OpenCart themes, OpenCart templates of 2013 with you. These templates design and development from ThemeForest authors with awesome overviews like mobile ready (responsive), unlimited color and style options, custom webfonts included, powerful control panels, search engine optimization (SEO) and multistore ready. This a great resource and something every designer should check out. You can use these responsive OpenCart templates for your next commercial projects (online stores, ecommerce sites, internet marketing sites).

Today we have collected a collection of top 30 OpenCart themes collection created in 2013. We hope you will like this collection. You can download these themes are below. To kick it off, here are the best OpenCart templates! I’d love to hear about them in the comments below.

Shoppica


Shoppica

Get this theme

Sellegance


Sellegance

Get this theme

Spicylicious


Spicylicious

Get this theme

R.Gen


R.Gen

Get this theme

Sellya


Sellya

Get this theme

ShopCart


ShopCart

Get this theme

AquaCart


AquaCart

Get this theme

Gentle


Gentle

Get this theme

Journal


Journal

Get this theme

Kinder


Kinder

Get this theme

Bigshop


Bigshop

Get this theme

SportStore


SportStore

Get this theme

BeautyShop


BeautyShop

Get this theme

Fortuna


Fortuna

Get this theme

ElegantCart


ElegantCart

Get this theme

Simple


Simple

Get this theme

Cupid


Cupid

Get this theme

Simplecart


Simplecart

Get this theme

Phantom


Phantom

Get this theme

Teez


Teez

Get this theme

PinShop


PinShop

Get this theme

FancyCart


FancyCart

Get this theme

MetroShop


MetroShop

Get this theme

Mega


Mega

Get this theme

Herbal


Herbal

Get this theme

Vanity Shop


Vanity Shop

Get this theme

Leisure


Leisure

Get this theme

My Stock Image


My Stock Image

Get this theme

MegaStore


MegaStore

Get this theme

UniVersum


UniVersum

Get this theme


Friday, July 5, 2013

How to unzip a zip file into a folder with the zip file's name - Bash Script



cd into the directory containing the zip files
Run command

nano run.sh

Add below code to run.sh file

#!/bin/bash
for z in *.zip
do
d=`basename $z .zip`
mkdir $d && unzip $z -d $d
done


Make it executable

chmod +x run.sh

Run it

./run.sh

If you want to delete zip files after unzip, you only need to add
rm -rf $z after mkdir $d && unzip $z -d $d