LINUX

How to install PostgreSQL on CentOS Linux?

First lets do an update before we start installing PostgreSQL

$ yum update

You can install PostgreSQL from CentOS Base repo or can do a search for the latest version and install it based on your needs. Method 1 describes manual setup and Method 2 indicates an install from CentOS base repo Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

How to find the port used by mysql?

List the listening ports and check if mysql is listed on it.

$ netstat -tln | grep mysql

If you cannot find the port number for mysql view my.cnf file to see if you can find the port number. If you see a line “skip-networking” try commenting out the line and then restart mysql daemon.

$ vi /etc/my.cnf

[mysqld] set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-networking

[mysql.server] user=mysql
basedir=/var/lib

[mysqld_safe] log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

$ service mysqld restart

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

How to check Python version number in Linux/Unix environment?

To check the Python version number in Linux, simply type


$ python -V

You will get an output

Python 2.4.3
Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Apache: [warn] NameVirtualHost *:80 has no VirtualHosts

$ /etc/init.d/apache2 restart

After configuring Apache server settings on the name server, you may encounter a message “[warn] NameVirtualHost 192.168.1.3:80 has no VirtualHosts

The issue may be due to more than one entry of NameVirtualHost lines in the configuration settings. You can find this out by

$ grep NameVirtual * -R
site1:NameVirtualHost *:80
site2:NameVirtualHost *:80

Linux Solution: Remove one of the occurance of the NameVirtualHost and the warning message that you receive will vanish.

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
NameVirtualHost *:80 has no VirtualHosts"]

Linux: How to display ONLY the directories?

To display a list of directories in Linux, issue the command

$ ls -l | egrep ‘^d’

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Beginner: Why there are many Linux Distributions?

There are different variants of Linux in the market like RedHat, Debian, CentOS, Ubuntu, Mandrake, Suse and a Linux beginner often ponder why they call Linux distributions by various names. The kernel or the heart of all the distributions is Linux and in bringing it to different market usage different community or vendors have adopted the kernel to serve that purpose.
Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Linux: Password creation

To create a password file and to add users to it, use the command
$ htpasswd -cm /secured/.mypass username1

To add users to the already existing password file, use the command
$ htpasswd -m /secured/.mypass username2

When additional users are added to the password file, ensure that you don’t use the “-c” option.

Read Password protect directories here

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Linux: alias, unalias

Alias command comes handy when we are in need to make long and frequently used command string short.

To list the current set of aliases simply type
$ alias

To display the set alias for a specified alias name, type
$ alias alias-shortstring
Example:
$ alias ls

To set an alias you use the format
$ alias shortstring = “linux command string”
Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Apache: Where to put site configuration settings?

/etc/apache2/conf.d/ and /etc/apache2/sites-enabled are the two locations from where configuration settings are ready by apache

Apache configuration file has two lines (listed below) in /etc/apache2/apache2.conf which does that

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Ubuntu: Configuring Virtual Hosts to listen on different ports

Files to check
– /etc/apache2/ports.conf
– /etc/apache2/apache2.conf

Consider the ServerName to be “myserver”. Check /etc/hosts for an entry

127.0.0.1 localhost
192.168.1.100 myserver.com myserver

Continue Reading…

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Kurinchi Calendar
December 2017
M T W T F S S
« Oct    
 123
45678910
11121314151617
18192021222324
25262728293031