fixed –bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

So right after the login was completed I was getting the following message:

warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

It only happened on certain servers, for others everything would work just fine.
This caused a few problems when running some perl scripts that would complain about the locale variables not being set, even though my Terminal app was setup correctly.

To fix this I simply added the following to my ~/.bash_profile:

export LC_CTYPE="en_US.UTF-8"

Preventing Open SSH from sending the LC_* variables

The fix is very easy. On your local system open your ssh_config file as root (usually in /etc/ssh_config or /etc/sshd/ssh_config) and comment this line:

SendEnv LANG LC_*

That’s it! From now on you will no longer get the annoying Bash error. Alternatively you can also set the locale setting of your locale system to something that matches your remote system, but this is the foolproof way that will always work, regardless of the locale config of your local and remote system.

CentOS / Redhat Apache mod_ssl install

Install mod_ssl

yum update

yum install mod ssl

 

Create an SSL Certificate

cd /etc/tls/certs

openssl genrsa -des3 -out apachekey.pem 2048

Generate a Certificate Signing Request (CSR)

Type the following command:
# openssl req -new -key apachekey.pem -out apachekey.csr

Create the Web Server Certificate

You must signed the CSR to create the web server certificate, enter (you can send it to your CA to sign the same). To sign httpserver.csr using your CA:
# openssl ca -in apachekey.csr -out apachecert.pem

Install SSL Certificate

Copy server key and certificates files /etc/tls/http/, enter:
# cp apachecert.pem /etc/tls/http/
# cp apachekey.pem /etc/tls/http/

 
Edit /etc/httpd/conf.d/ssl.conf, enter:
# vi /etc/httpd/conf.d/ssl.conf
Listen to the the HTTPS port, enter:

Listen 10.10.29.68:443

Update it as follows to seed appropriately, enteR:

SSLRandomSeed startup file:/dev/urandom 1024
SSLRandomSeed connect file:/dev/urandom 1024

Update VirtualHost as follows:

 
<VirtualHost www.ajayadas.com:443>
    SSLEngine On
    SSLCertificateFile /etc/tls/http/apachecert.pem
    SSLCertificateKeyFile /etc/tls/http/apachekey.pem
    SSLProtocol All -SSLv2
    SSLCipherSuite HIGH:MEDIUM:!aNULL:+MD5
    DocumentRoot "/var/www/html/ssl"
    ServerName www.ajayadas.com:443
</VirtualHost>

Save and close the file. Make sure /var/www/html/ssl exits, enter:
# mkdir -p /var/www/html/ssl
Edit /etc/httpd/conf/httpd.conf, enter:
# vi /etc/httpd/conf/httpd.conf
Make sure SSL is used for /var/www/html/ssl and set other options for the same, enter:

 
<Directory /var/www/html/ssl>
         SSLRequireSSL
         SSLOptions +StrictRequire
         SSLRequire %{HTTP_HOST} eq "www.ajayadas.com"
         ErrorDocument 403 https://www.ajayadas.com/sslerror.html
</Directory>

Now, you can upload ssl specific php or html pages in /var/www/html/ssl directory and can access them by visiting https://www.nixcraft.com/ url. Do not forgot to restart Apache:
# service httpd restart

 

 

 

Install PhpMyadmin – centos Redhat 6.x

phpMyAdmin is not included in default RHEL / CentOS repo so install EPEL

EL6 version, enter:

$ cd /tmp
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
# rpm -ivh epel-release-6-5.noarch.rpm

 

# yum -y install phpmyadmin

 

Step #3: Configure phpMyAdmin

You need to edit /etc/httpd/conf.d/phpMyAdmin.conf, enter:
# vi /etc/httpd/conf.d/phpMyAdmin.conf
It allows only localhost by default. You can setup HTTPD SSL as described here (mod_ssl) and allow LAN / WAN users or DBA user to manage the database over www. Find line that read follows

Require ip 127.0.0.1

Replace with your workstation IP address:

Require ip 10.1.3.53

Again find the following line:

Allow from 127.0.0.1

Replace as follows:

Allow from 10.1.3.53

Save and close the file. Restart Apache / httpd server:
# service httpd restart
Open a web browser and type the following url:
https://your-server-ip/phpMyAdmin/
OR
http://your-server-ip/phpMyAdmin/

 

 

WP Twitter Auto Publish Powered By : XYZScripts.com