Tuesday, 14 August 2012

Yum Memory Error !!!!

If you are getting  "MemoryError" while doing yum update or yum install ,follow the steps shown below:

Solution


# ulimit -a

The output for this will be obtained as :
root@server1 [~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 19
file size               (blocks, -f) unlimited
pending signals                 (-i) 139264
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) 10000
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 15
virtual memory          (kbytes, -v) 262144
file locks                      (-x) unlimited

The reason for such memory error  is because of virtual memory and max. memory size. It should be unlimited, otherwise it will show memory error.

# ulimit -m unlimited 
#ulimit -v unlimited
  Then run yum again........

Installing LAMP on Linux

Please refer these links to get more information on installing LAMP on linux servers.

http://www.lamphowto.com/
http://www.howtoforge.com/quick-n-easy-lamp-server-centos-rhel

http://www.lifelinux.com/how-to-setup-a-lamp-server-on-centos-6-0/

Configuring Apache server to listen to Multiple Ports


By default Apache server listens on TCP port 80 but I’d like an Apache Web Server to listen on port 80 and port 8080.But we can also configure apache to listen on multiple ports.It is shown below.


edit file /etc/httpd.conf.httpd.conf
 and search the line Listen 80
Add one more line like it and change the port to one we want
Listen 8080
And find the VirtualHost portion for your website config and add *:8080 as shown below:


<Virtual Host *:80 *:8080 >
.................
<Virtual Host>

Ready to go ......!!!!

Changing the login details of Light speed webserver


Light speed webserver user details can be changed by using a script /usr/local/lsws/admin/misc/admpass.sh.

Light speed server port number is 7080.So can acces the login page via http://servernae:7080.

Images not loading in wordpress site

Images may not load on wordpress site if the permission of files are incorrect.To understand the file permissions of the wordpress contents,Please refer the link http://wordcastnet.com/2011/managing-file-permissions-in-wordpress/.

How to change time-zone in Linux servers

For this example, assume that your current timezone is UTC as shown below. You would like to change this to Pacific Time.

# date

Mon Sep 17 22:59:24 UTC 2010

 On some distributions (for example, CentOS), the timezone is controlled by /etc/localtime file.

Delete the current localtime file under /etc/ directory

# cd /etc

# rm localtime

All US timezones are located under under the /usr/share/zoneinfo/US directory as shown below.

# ls /usr/share/zoneinfo/US/

Alaska          Arizona         Eastern         Hawaii          Michigan        Pacific

Aleutian        Central         East-Indiana    Indiana-Starke  Mountain        Samoa

Note: For other country timezones, browse the /usr/share/zoneinfo directory

Link the Pacific file from the above US directory to the /etc/localtime directory as shown below.



# cd /etc

# ln -s /usr/share/zoneinfo/US/Pacific localtime

Now the timezone on your Linux system is changed to US Pacific time as shown below.

# date

Mon Sep 17 23:10:14 PDT 2010

Monday, 13 August 2012

Mysql.sock error in Cpanel

Cd /var/lib/mysql

touch mysql.sock

Chown mysql:mysql mysql.sock

Chmod 1777 mysql.sock

Making a sym link into /tmp

ln –s /var/lib/mysql/mysql.sock /tmp

then

Chmod 1777 /tmp

/scripts/mysqlup –force

Now just restart mysql

/etc/rc.d/init.d/mysql restart

Ready to go ……..!!!!!