GD installation on Debian nginx

May 17, 2010 by  
Filed under Linux Tutorials

Comments Off

To install the GD run the following command from the SSH root

apt-get install php5-gd

Then restart the webserver by

/etc/init.d/nginx restart

and the PHP engine by

/etc/init.d/php-fastcgi restart

yum install phpmyadmin forbidden error

April 12, 2010 by  
Filed under Linux Tutorials, MySQL

Comments Off

If you have installed phpMyAdmin in your linux server (centos/RHEL/debian), and tried to access phpMyAdmin in most cases you will get this 403 forbidden error. I have seen this issue very often if you are installing phpmyadmin using yum or by apt-get. By default phpmyadmin installed path is /usr/share/phpmyadmin and the apache configuration file is located in /etc/httpd/conf.d/phpmyadmin.conf.

Forbidden
You don't have permission to access /phpmyadmin/ on this server.

To fix:

nano /etc/httpd/conf.d/phpmyadmin.conf

Remove or comment the first two lines in bold.

#Order Allow,Deny
#Deny from all

Allow from 127.0.0.1

Restart the apache server.

service httpd restart

Once this is done, Point your browser to http://yourserveripaddress/phpmyadmin

Install MySql on CentOS 5.x

January 6, 2010 by  
Filed under Linux Tutorials, MySQL

Comments Off

How to install MySql in CentOS 5.3 from shell or webmin

 

Login the server SSH using root

Inorder to check if mysql is already installed or not run this command
which mysql
If found it will show some directory name otherwise not found

In order to remove old mysql
yum remove mysql-server
yum remove mysql

Now to install mysql run this command from the shell or a command line access point
yum install mysql-server
yum install mysql
yum install mysql-devel

Inorder to use with php
yum install php-mysql

service mysqld restart

By default mysql has the no passward. To change the password in command shell write the following commands
mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(‘new-password’) WHERE user=’root’;
mysql> FLUSH PRIVILEGES;

403 permissions problem after installing Nagios on virtualmin

December 15, 2009 by  
Filed under Linux Tutorials, Tools and Utilities

Comments Off

If the websites are managed with VirtualMin. Each site has its own user name, group and home folder.

For example, site www.sampleweb.com under VirtualMin has user name and groups sampleweb as well as home folder /home/sampleweb.
The document root of the site is /home/sampleweb/public_html.

If the Nagios is installed on the same server, it change the apache group and all the websites start returning 

403 error permission denied.

To resolve this add the user group again to apache for example :

/usr/sbin/usermod -a -G sampleweb apache

retstart apache and you will be back in business

IMPORTANT : THE NAGIOS INSTALLATION IS NOT RECOMMEND ON HOSTING SERVERS, AND THIS SHOULD BE DONE ON A PLAIN INSTALLATION ONLY, OTHERWISE IT LEADS TO SEVERAL PROBLEMS LIKE ONE ABOVE.

How to use VI Editor – Linux / Unix

February 18, 2009 by  
Filed under Linux Tutorials

Comments Off

To save the edits you have made, but leave vi running and your file open:

  1. Press <Esc>.
  2. Type :w
  3. Press <Return>.

To quit vi, and discard any changes your have made since last saving:

  1. Press <Esc>.
  2. Type :q!
  3. Press <Return>.

STARTING vi

     vi filename    edit a file named "filename"
     vi newfile     create a new file named "newfile"

ENTERING TEXT

     i            insert text left of cursor
     a            append text right of cursor

MOVING THE CURSOR

     h            left one space
     j            down one line
     k            up one line
     l            right one space

BASIC EDITING

     x         delete character
     nx        delete n characters
     X         delete character before cursor
     dw        delete word
     ndw       delete n words
     dd        delete line
     ndd       delete n lines
     D         delete characters from cursor to end of line
     r         replace character under cursor
     cw        replace a word
     ncw       replace n words
     C         change text from cursor to end of line
     o         insert blank line below cursor
                  (ready for insertion)
     O         insert blank line above cursor
                  (ready for insertion)
     J         join succeeding line to current cursor line
     nJ        join n succeeding lines to current cursor line
     u         undo last change
     U         restore current line

MOVING AROUND IN A FILE

     w            forward word by word
     b            backward word by word
     $            to end of line
     0 (zero)     to beginning of line
     H            to top line of screen
     M            to middle line of screen
     L            to last line of screen
     G            to last line of file
     1G           to first line of file
     <Control>f   scroll forward one screen
     <Control>b   scroll backward one screen
     <Control>d   scroll down one-half screen
     <Control>u   scroll up one-half screen
     n            repeat last search in same direction
     N            repeat last search in opposite direction

CLOSING AND SAVING A FILE

     ZZ            save file and then quit
     :w            save file
     :q!            discard changes and quit file