Tuesday, July 24, 2012
PHP 4 can not connect to mysql server with error "Client does not support authentication protocol"
MySQL 4.1+ uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. MySQL extension for PHP4 was compiled with old (pre-4.1) client library.
When you connect to server. It will shows error
"Client does not support authentication protocol requested by server; consider upgrading MySQL client"
To solve this problem, you should use one of the following approaches:
1. reset password to old style password
SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
For PHP mysql_connect command, you must specify parameters following
mysql_connect($server,$user,$pass,false,0);
2.Tell the server to use the older password hashing algorithm:
add this line to mysql configuration (my.ini/my.cnf)
[mysqld]
.
.
old-passwords = 1
.
.
[client]
.
.
old-passwords = 1
.
.
then restart service and reset password using command
SET PASSWORD FOR 'some_user'@'some_host' = PASSWORD('newpwd');
MySQL native driver for PHP can not connect to mysql. It shows error "mysqlnd cannot connect to MySQL 4.1+ using old authentication"
Symptom
MySQL native driver for PHP can not connect to mysql. It shows error "mysqlnd cannot connect to MySQL 4.1+ using old authentication"
Cause
New version of MySQL native driver for PHP uses an authentication protocol based on improved password hashing algorithm that is incompatible with an account that still has a pre-4.1-style password.
Solution
Reset the password to 4.1+ style for each user that needs to use the client program.
SET SESSION OLD_PASSWORDS = FALSE;
USE mysql;
UPDATE user SET password = PASSWORD('newpass') WHERE user='someuser';
FLUSH PRIVILEGES;
MySQL native driver for PHP can not connect to mysql. It shows error "mysqlnd cannot connect to MySQL 4.1+ using old authentication"
Cause
New version of MySQL native driver for PHP uses an authentication protocol based on improved password hashing algorithm that is incompatible with an account that still has a pre-4.1-style password.
Solution
Reset the password to 4.1+ style for each user that needs to use the client program.
SET SESSION OLD_PASSWORDS = FALSE;
USE mysql;
UPDATE user SET password = PASSWORD('newpass') WHERE user='someuser';
FLUSH PRIVILEGES;
Saturday, June 16, 2012
Hosting Multiple FTP Sites with FTP User Isolation (IIS 6.0)
How to chroot ftp users in IIS 6?
How to jail ftp users in IIS6?
This is answer.
IIS 6.0 introduce 3 new modes for ftp site:
a) Do not isolate users - This mode does not enable FTP user isolation and it work similarly to earlier versions of IIS.
b) Isolate users - This mode authenticates users against local or domain accounts before they can access the home directory that matches their user name. All user home directories are in a directory structure under a single FTP root directory where each user is placed and restricted to their home directory. Users are not permitted to navigate out of their home directory.
c) Isolate users using Active Directory - This mode authenticates user credentials against a corresponding Active Directory container, rather than searching the entire Active Directory, which requires large amounts of processing time. Specific FTP server instances can be dedicated to each customer to ensure data integrity and isolation.
You can select the isolation mode during FTP site setup using the FTP Site Creation Wizard. You can use Iisftp.vbs to configure FTP User Isolation, using the/isolationparameter. When you use the/isolation parameter, specify either AD, for Active Directory isolation, or Local, for local isolation. If you do not include the /isolation parameter, the site will not isolate users.
Note: This article focus on Isolate users in normal mode (b)
To create a new FTP site that isolates users
1. In IIS Manager, expand the local computer, right-click the FTP Sites folder, point to New, and click FTP Site.
2. Provide the required information in the FTP Site Description and IP Address and Port Settings dialog boxes, and click Next.
3. In the FTP User Isolation dialog box, click Isolate users, and click Next.
4. In the Path box, type or browse to the directory that contains, or will contain, the site content, and then click Next.
5. Select the check boxes for the FTP site access permissions you want to assign to your users, and then click Next.
6. Click Finish.
To create FTP root-point and user folders
If users of the local computer log in with their individual account user names, create the subdirectoriesLocalUser under the FTP site root directory you specified when you creating the FTP site.
For Example -
FTP root directory -> D:\MyFTP\
LocalUser locate at D:\MyFTP\LocalUser
For individual user, you need to create folder in this format - LocalUser\username
User: Susan locate at D:\MyFTP\LocalUser\Susan
If users of different domains log on with their explicit domain\username credentials, create a subdirectory for each domain (by using the name of the domain) under the FTP site root directory you specified when you creating the FTP site.
For Example -
Domain Name: Account
FTP root directory -> D:\MyFTP\
LocalUser locate at D:\MyFTP\Account
For individual domain user, you need to create folder in this format - Domain\username
Domain User: Nancy locate at D:\MyFTP\Account\Nancy
Anonymous access in isolated ftp site
If anonymous access is allowed, create the subdirectories LocalUser and LocalUser\Public under the FTP site home directory.
Note: All user home directories are in a directory structure under a single FTP root directory where each user is placed and restricted to their home directory. Users are not permitted to navigate out of their home directory. If users need access to dedicated shared folders, you can also establish a virtual root.
How to jail ftp users in IIS6?
This is answer.
IIS 6.0 introduce 3 new modes for ftp site:
a) Do not isolate users - This mode does not enable FTP user isolation and it work similarly to earlier versions of IIS.
b) Isolate users - This mode authenticates users against local or domain accounts before they can access the home directory that matches their user name. All user home directories are in a directory structure under a single FTP root directory where each user is placed and restricted to their home directory. Users are not permitted to navigate out of their home directory.
c) Isolate users using Active Directory - This mode authenticates user credentials against a corresponding Active Directory container, rather than searching the entire Active Directory, which requires large amounts of processing time. Specific FTP server instances can be dedicated to each customer to ensure data integrity and isolation.
You can select the isolation mode during FTP site setup using the FTP Site Creation Wizard. You can use Iisftp.vbs to configure FTP User Isolation, using the/isolationparameter. When you use the/isolation parameter, specify either AD, for Active Directory isolation, or Local, for local isolation. If you do not include the /isolation parameter, the site will not isolate users.
Note: This article focus on Isolate users in normal mode (b)
To create a new FTP site that isolates users
1. In IIS Manager, expand the local computer, right-click the FTP Sites folder, point to New, and click FTP Site.
2. Provide the required information in the FTP Site Description and IP Address and Port Settings dialog boxes, and click Next.
3. In the FTP User Isolation dialog box, click Isolate users, and click Next.
4. In the Path box, type or browse to the directory that contains, or will contain, the site content, and then click Next.
5. Select the check boxes for the FTP site access permissions you want to assign to your users, and then click Next.
6. Click Finish.
To create FTP root-point and user folders
If users of the local computer log in with their individual account user names, create the subdirectoriesLocalUser under the FTP site root directory you specified when you creating the FTP site.
For Example -
FTP root directory -> D:\MyFTP\
LocalUser locate at D:\MyFTP\LocalUser
For individual user, you need to create folder in this format - LocalUser\username
User: Susan locate at D:\MyFTP\LocalUser\Susan
If users of different domains log on with their explicit domain\username credentials, create a subdirectory for each domain (by using the name of the domain) under the FTP site root directory you specified when you creating the FTP site.
For Example -
Domain Name: Account
FTP root directory -> D:\MyFTP\
LocalUser locate at D:\MyFTP\Account
For individual domain user, you need to create folder in this format - Domain\username
Domain User: Nancy locate at D:\MyFTP\Account\Nancy
Anonymous access in isolated ftp site
If anonymous access is allowed, create the subdirectories LocalUser and LocalUser\Public under the FTP site home directory.
Note: All user home directories are in a directory structure under a single FTP root directory where each user is placed and restricted to their home directory. Users are not permitted to navigate out of their home directory. If users need access to dedicated shared folders, you can also establish a virtual root.
Friday, April 20, 2012
How to move MailArchiva and its data from one server to another
These instructions describe how to move MailArchiva and its data from one server to another
Directories#
There is no complex database replication procedure to perform. Copying MailArchiva from one machine to another is as simple as copying a few directories over to another machine (almost!).
(1) Install a clean copy of MailArchiva on the new server.
(2) Copy the following directories & files from the old server to the new server
Server Configuration#
C:\Program Files\MailArchiva\server\webapps\ROOT\WEB-INF\conf\* (windows)
/usr/local/mailarchiva/server/webapps/ROOT/WEB-INF/conf/* (linux)
Logging Configuration#
C:\Program Files\MailArchiva\server\webapps\ROOT\WEB-INF\classes\log4j.xml (windows)
/usr/local/mailarchiva/server/webapps/ROOT/WEB-INF/classes/log4j.xml
License File (EE only)#
C:\Program Files\MailArchiva\server\webapps\ROOT\WEB-INF\classes\license.lic (windows)
/usr/local/mailarchiva/server/webapps/ROOT/WEB-INF/classes/license.lic
Audit & Log Files#
C:\Program Files\MailArchiva\server\logs\* (windows) /usr/local/mailarchiva/server/logs/* (linux)
C:\Program Files\MailArchiva\server\webapps\ROOT\WEB-INF\logs\* (windows)
/usr/local/mailarchiva/server/webapps/ROOT/WEB-INF/logs/* (linux)
C:\Program Files\MailArchiva\server\webapps\ROOT\WEB-INF\logs\index\* (windows)
/usr/local/mailarchiva/server/webapps/ROOT/WEB-INF/logs/index* (linux)\
Volumes#
Copy all files in all volume store paths and index paths
(copying indexes over is optional)
Since there are potentially a large number of files in the store path, on Linux when using the cp command you may receive the errors "too many arguments"
To workaround this, follow one of the methods in the following article: http://www.linuxjournal.com/article/6060
Sunday, February 26, 2012
how to set default proxy server for linux
In file ~/.bash_profile, add this line.
http_proxy=[proxy_server:port]
ftp_proxy=[proxy_server:port]
export http_proxy
export ftp_proxy
http_proxy=[proxy_server:port]
ftp_proxy=[proxy_server:port]
export http_proxy
export ftp_proxy
Subscribe to:
Posts (Atom)