Chủ Nhật, 26 tháng 6, 2016

How to change phpMyAdmin post_max_size to more than 2MB

To change the post_max_size in Plesk it is not as simple as changing the /etc/php.ini file entries as there are not active when running phpMyAdmin from within with Plesk Control Panel.

Usually, on a regular *nix installation you would look for these values in /etc/php.ini

phpMyAdmin logoupload_max_filesize
phpMyAdmin logo
What you need to change in fact is this file:

# vi  /usr/local/psa/admin/conf/php.ini

change:

upload_max_filesize = 2147483647
post_max_size = 2147483647
to:

upload_max_filesize = 32M
post_max_size = 32M
This value will now allow phpMyAdmin uploads of files up to 32M is size. Enter your own value here.

Thứ Bảy, 25 tháng 6, 2016

Cách xem password Plesk admin

Symptoms

The password for the "admin" user in Plesk has been lost.

Resolution

For Plesk versions 10.x and above:
Use the ${PRODUCT_ROOT_D}/bin/admin utility to prompt the password for the "admin" user:
# /usr/local/psa/bin/admin --show-password
Use ${PRODUCT_ROOT_D}/bin/init_conf to reset the password for the "admin" user:
# /usr/local/psa/bin/init_conf -u -passwd <new_password>
If the init_conf utility cannot connect to the Plesk database, follow the steps from article #112492 "Cannot log into Plesk due to incorrect admin password" to reset the Plesk database password.
For Plesk versions up to 9.x:
The Plesk admin password is stored in a hidden file on the server. Use this command to get it:
# cat /etc/psa/.psa.shadow
This authenticates the "admin" user by trying to authorize access to the Plesk database using the password provided.

By kb.plesk.com

Thứ Năm, 23 tháng 6, 2016

How to backup and restore linux sever

Backing Up and Restore Your Server
Backup Your Server's OS
Making a backup of your Linux Operating System is a very simple process that uses tools included in every linux installation.

The first step is to create a location to store the backup. For this article we're going to store the backup on the same hard drive as the installed operating system, but you can attach USB devices like thumb drive and external hard drives and even special storage like iSCSI and NFS mounted device to store the backup.

Once you are logged into the server and at a command line make the directory to store the backup in an organized way such as:

mkdir /backups

Now we will create a compressed version of the Operating System in one single file (tarball) using the tar command.

For RedHat, CentOS and Fedora or any Operating System based on these linux flavors run the following command:

tar cvpzf /backups/backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backups --exclude=/dev --exclude=/sys --exclude=/boot/grub --exclude=/etc/fstab --exclude=/etc/sysconfig/network-scripts/ --exclude=/etc/udev/rules.d/70-persistent-net.rules /

For Debian or Ubuntu run the following command:

tar cvpzf /backups/backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backups --exclude=/dev --exclude=/sys --exclude=/boot/grub --exclude=/etc/fstab --exclude=/etc/network/interfaces --exclude=/etc/udev/rules.d/70-persistent-net.rules /

Once the command completes the tarball will be located at /backups/backup.tgz

***HINT: You can change the name of the tarball file with a date identifier and keep multiple versions or "snapshots" of your server's configuration.

Restore Your Server's OS From a Backup
In order to restore your server from the previously created tarball the server must have the same Operating System version loaded on it. This particular method of backup and restore is not meant for bare metal projects that need to restore an Operating System to an empty hard drive. It was actually designed to move a configured Operating System from one hardware platform to another, but also works well for rolling back an operating system to a previous configuration.

Once you have a working Operating System either on a new hardware platform or the same hardware platform move the tarball to the server you want to restore. If you stored the tarball on a USB device or other external storage just reattach the device and mount it. If the tarball is on another linux server use commands like this to copy it to the new server’s hard drive:

mkdir /backups
scp root@original_server:/backups/backup.tgz /backups

Of course replace "original_server" with the appropriate IP address.

Enter the root users password and the transfer will begin.

Once the transfer has completed run this command to extract the tarball thereby restoring the Operating System that the tarball contains:

tar xvpfz /backups/backup.tgz -C /

Complete the process with a reboot and troubleshoot any errors that may come up.

cp serverpronto.com

Thứ Ba, 14 tháng 6, 2016

How to install php-xmlrpc on centos - install php-xmlrpc on directadmin

If you want to add any extra modules to php, they'll most likely need to be compiled in. Any module that needs to be compiled in will have a --with-module type flag which will need to be used.

1) To add this flag, run the following:
cd /usr/local/directadmin/custombuild
mkdir -p custom/ap2
cp -fp configure/ap2/configure.php5 custom/ap2/configure.php5

If you're using CustomBuild 2.0, the file might be configure.php55 (where 55 is the php 5.5 version, adjust as needed).
Also, "ap2" applies to mod_php. If you're using suPhp, it's "suphp". Also possible: fpm, fastcgi.
See 4) below, to confirm which configure file to copy to ./custom.

2) Add your --with-module line to the end of the custom/ap2/configure.php5 file, and make sure the \ character exists at the end of all lines except the last one. The \ character tells the line configure line to loop to the next line, making the configure settings easier to read.  Without the \ character to trigger the wrap, the next line becomes a separate command, which is not correct. (see error below). Once set, type:
./build php n
change configure.php5 to configure.php4 if you're using php4.
If you're using suphp, the paths would be configure/suphp/configure.php5 and custom/suphp/configure.php5.

3) Restart apache:

RedHat:
/sbin/service httpd restart

FreeBSD:
/usr/local/etc/rc.d/httpd restart

Please keep in mind that any changes to your stock DirectAdmin setup are beyond our techinal support, and you do so at your own risk.

4) To confirm that you're actually editing the correct configure file, type the following to see which configure files the custombuild script is using:
./build used_configs



A common error people run into looks like this:
/usr/local/directadmin/custombuild/custom/ap2/configure.php5: line 32: --with-module: command not found
which simply means that the \ character was not correctly added on the line before --with-module.

Thứ Sáu, 10 tháng 6, 2016

How to auto start MySQL if that stop for any reason?

Digital Ocean has a tutorial about it, which also includes an example on how to keep MySQL running. The short synopsis is:
  1. Install monit
    sudo apt-get install monit
    
  2. Edit the configuration file:
    sudo nano /etc/monit/monitrc
    
    and include the following in it:
    check process mysqld with pidfile /var/run/mysqld/mysqld.pid
        start program = "/etc/init.d/mysql start"
        stop program = "/etc/init.d/mysql stop"
    
  3. Reload the new configuration:
    monit reload
    
I strongly suggest you look at the MySQL error log to understand why it is stopping (it should not do this in normal operation). It would be a good idea to also run mysqlrepair to check the status of all tables as you might have some serious DB corruption.

Thứ Năm, 9 tháng 6, 2016

How to fix unsupported_db_table_row_format in moodle - Converting InnoDB tables to Barracuda

Here is a Unix "screen-shot":

cd /path/to/your/moodle
php admin/cli/mysql_compressed_rows.php
Script for detection of row size problems in MySQL InnoDB tables.

By default InnoDB storage table is using legacy Antelope file format
which has major restriction on database row size.
Use this script to detect and fix database tables with potential data
overflow problems.

Options:
-i, --info Show database information
-l, --list List problematic tables
-f, --fix Attempt to fix all tables (requires SUPER privilege)
-s, --showsql Print SQL statements for fixing of tables
-h, --help Print out this help

Thứ Hai, 6 tháng 6, 2016

Cách xem logfile trên centos server

1. Dùng lệnh vào thư mục log

# cd /var/log

2. Hiển thị danh sách file log

# ls

3. Một vài lệnh xem logfile

# less /var/log/messages
# more -f /var/log/messages
# cat /var/log/messages
# tail -f /var/log/messages
# grep -i error /var/log/messages

Cách start-stop mysql server trên centos webserver

Stop MySQL Server

# /etc/init.d/mysqld stop

Start MySQL Server

# /etc/init.d/mysqld start

Restart MySQL Server

# /etc/init.d/mysqld restart

Mong rằng những lệnh này sẽ hữu ích đối với các bạn!

Thứ Tư, 1 tháng 6, 2016

How to fix gmail SMTP debug error please log in via your web browser on phpmailler?


There are two ways to resolve this, and only one may work, depending on how you're accessing Google.

The first method is to authorize access for your IP or client machine using the https://accounts.google.com/DisplayUnlockCaptcha link. That can resolve authentication issues on client devices, like mobile or desktop apps. I would test this first, because it results in a lower overall decrease in account security.

If the above link doesn't work, it's because the session is being initiated by an app or device that is not associated with your particular location. Examples include:

An app that uses a remote server to retrieve data, like a web site or, in my case, other Google servers
A company mail server fetching mail on your behalf
In all such cases you have to use the https://www.google.com/settings/security/lesssecureapps link referenced above.

TLDR; check the captcha link first, and if it doesn't work, try the other one and enable less secure apps.