Showing posts with label linux server. Show all posts
Showing posts with label linux server. Show all posts

How to get MySQL root Password - Linux Plesk

0 comments
Plesk MySQL server have no root user. Instead Plesk have user “admin” with root privileges.

You can run the command given below to get MySQL admin user password.

[root@server ~] # cat /etc/psa/.psa.shadow
3G5wVCxDGotP4itJ
Verify the password by login to the admin user.

[root@server ~] # mysql -u admin -p3G5wVCxDGotP4itJ
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1234 to server version: 5.1

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

If you want login to MySQL without entering the password always, go through the following steps.

Create a file, /root/.my.cnf and add the follwong contents in it.

[mysql]
user = admin
password = 3G5wVCxDGotP4itJ

[mysqldump]
user = admin
password = 3G5wVCxDGotP4itJ

This will allow you to use mysql and mysqldump without providing passwords.

How to install PECL uploadprogress

0 comments

On Linux server:
  1. # cd /usr/local/src/
  2. get the latest version http://pecl.php.net/package/uploadprogress
  3. # tar xvfz uploadprogress-VERSION.tgz
  4. # cd uploadprogress-VERSION

  5. # export PHP_PREFIX="/usr/local"
    # $PHP_PREFIX/bin/phpize
    # ./configure
    # make
    # make install
  6. open your php.ini
    e.g.

    # vi /usr/local/lib/php.ini

    add the line you received followed by "uploadprogress.so":

    ; PECL uploadprogress
    extension_dir="/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"
    extension=uploadprogress.so
  7. # service httpd restart

How to allow remote access to mysql using xampp?

0 comments
Just make sure that your mysql is binding to a socket on 0.0.0.0 and you should be able to connect to that socket. I guess the default is for mysql to bind to 127.0.0.1, which, of course, is hard to reach from the outside.

EDIT: The MySQL configuration file should be in .\xampp\mysql\bin\my.ini. You need to find thebind-address parameter and change it to 0.0.0.0.

Everyone on your network should then be able to connect that MySQL instance. Of course, that may include people who better shouldn't do that. But as long as there is a password for each mysql user and the instance is not facing the internet, there is not much to worry about.

Adding mime types to a Linux server

1 comments
There are two ways to add a mime type to a Linux server. You can either add the mime type to the server mime type listing or you can specify a mime type via an .htaccess file in a individual hosting account. This article will explain how to do both.

Method 1.

  1. Log into the Linux server via SSH.

  2. Open the “/etc/mime.types” file using a text editor.

  3. Add the new mime type into the end of the “/etc/mime.types” file and save it.

  4. Restart Apache by typing either of the following commands;


“service httpd restart”

“/etc/init.d/httpd restart”

Method 2.

  1. Loging the Linux server via SSH.

  2. Navigate to the account that you wish to add the mime type. You will need to be in the web accessible portion of the account.

  3. Either create or modify the existing “.htaccess” file and add the mime type entry and save the file.

  4. Restart Apache by typing either of the following commands;


“service httpd restart”

“/etc/init.d/httpd restart”

Managing Log Files and Log Rotation

0 comments
Plesk allows managing log files and log rotation settings from the control panel. To access these functions, click the  Log Manager icon on the Domain Administration page. The Log Manager page will open:



  • Define the number of log file's lines to be displayed at once. To do that, type in the number of lines in the Lines of log file to be displayed input field prior to selecting a log file for viewing.

  • View a log file. To this effect, click on a log file's name in the list. The log file contents will be displayed in a separate Log File Viewer window.

  • Save a log file on your local machine. To do that, click on the appropriate  icon. After that you will need to specify the location on your local machine and the file name for the downloaded log file to be saved, and then click Save.

  • Delete log files. To this effect, select the corresponding checkboxes, and click Remove Selected.


To configure the log rotation preferences, follow these steps:

  1. Click the  Log Rotation icon on the Log Files Management page. The Log Rotation Preferences page will open:

  2. Click the  Enable or  Disable icon respectively to enable/disable log rotation.

  3. Select the log rotation condition:                                                                                      a)  log file size - enter the size in kilobytes in the appropriate field.

  4. Specify the maximum number of log files in the appropriate input field, if desired. The maximum number is the number of processed files to be kept for each log file.

  5. Select the Compress log files checkbox to enable compression.

  6. If desired, in the Send processed log files to e-mail input field, enter the e-mail address, for the processed log files to be delivered to.

  7. Click OK to submit changes.

Delete an IP address from linux cPanel dedicated server

1 comments
Normally, to delete an IP from a cPanel server you can login to WHM and remove the IP using the function “Show or delete current IP address” under “IP functions” or use linux command.

For some reason we were having problems with the datacenter and we were asked to remove the IP using KVM. In this case, we entered the KVM and checked the if the IP was listed on the server by using ifconfig – we found that the IP was listed there. To remove the IP edit the file.
root@server# nano /etc/ips

and now remove the line of the IP and then restart the ipaliases service by the command
root@server# service ipaliases restart

It will show failed, you can ignore those warnings. And you can recheck if the IP has gone by using the command ifconfig. You’ll see the IP is not seen in the ifconfig output. Now, you can ask the datacenter to get the server online and then if you check from the WHM you will see that the IP is not available there.

That’s it!

Mount NTFS drive from boot

0 comments
So, looks like you want to mount /dev/hda1 & /dev/hdb2. Edit /etc/fstab from a terminal with

Code:

gksudo gedit /etc/fstab

and add these two lines to the end of it.

Code:

/dev/hda1   /media/hda1   ntfs-3g   defaults   0   0

/dev/hdb2   /media/hdb2   ntfs-3g   defaults   0   0

Save it and close down gedit editing window. Then, install ntfs-3g driver, create those two new mount points, and mount them.

Code:

sudo apt-get update

sudo apt-get install ntfs-3g

sudo mkdir /media/hda1 /media/hdb2

sudo mount -a

df -h

Two two ntfs partitions will be mounted to /media/hda1 & /media/hdb2 from now on, every time you boot Ubuntu.

Labels: mount NTFS on linux

So, looks like you want to mount /dev/hda1 & /dev/hdb2. Edit /etc/fstab from a terminal with

Code:

gksudo gedit /etc/fstab

and add these two lines to the end of it.

Code:

/dev/hda1   /media/hda1   ntfs-3g   defaults   0   0

/dev/hdb2   /media/hdb2   ntfs-3g   defaults   0   0

Save it and close down gedit editing window. Then, install ntfs-3g driver, create those two new mount points, and mount them.

Code:

sudo apt-get update

sudo apt-get install ntfs-3g

sudo mkdir /media/hda1 /media/hdb2

sudo mount -a

df -h

Two two ntfs partitions will be mounted to /media/hda1 & /media/hdb2 from now on, every time you boot Ubuntu.

Windows Data Backup on Linux Server

0 comments
Windows Data Backup on Linux Server I had a work to take backup of Windows Data Server on my Linux based backup server.

As a user, i never tried for such kind of things specially merging the data of two different platforms. Mostly services offered by the Windows are different from Linux. In Win XP, could not find a suitable service to backup and synchronization of data on live server.

I tried many Open Source utilities like Cygwin, Amanda Backup etc. These are very hectic and needs a lot of hardware involvement and requires a lot of settings.

One of my friends suggested me to try SyncBack at least once.

Its amazing, all the things which i needed found and works, in a very simple graphical settings.

For further queries, please contact me on mail id

PHP Warning: Unknown: POST Content-Length of 28 bytes exceeds the limit of -2147483648 bytes in Unknown on line 0

0 comments
If you are noticing the above error in apache error logs and having problems for login scripts the problem is with post_max_size variable in php.ini

Here is what you need to do, Find out the correct php.ini configuration file.

root@server [/usr]# php -i | grep php.ini

Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Edit the loaded php.ini file and check for post_max_size variable value, Set it to 8M which is best recommended.

root@server [/usr]# grep post_max /usr/local/lib/php.ini

post_max_size = 8M

Then restart apache, That should resolve the problem.

PHP Warning: Unknown: POST Content-Length of 28 bytes exceeds the limit of -2147483648 bytes in Unknown on line 0

0 comments
If you are noticing the above error in apache error logs and having problems for login scripts the problem is with post_max_size variable in php.ini

Here is what you need to do, Find out the correct php.ini configuration file.

root@server [/usr]# php -i | grep php.ini

Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Edit the loaded php.ini file and check for post_max_size variable value, Set it to 8M which is best recommended.

root@server [/usr]# grep post_max /usr/local/lib/php.ini

post_max_size = 8M

Then restart apache, That should resolve the problem.