How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

March 2, 2012

proftpd passive port not working

Filed under: Linux — Tags: , , , , — admin @ 12:20 pm

Well, we have to check a proftpd why was not working in some case.
Here are some error output:
227 Entering Passive Mode (10,108,211,224,191,201).
ftp: connect: Connection timed out

Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is the current directory
Command: TYPE I
Response: 200 Command okay.
Command: PASV
Response: 227 Entering Passive Mode (172,30,255,230,229,148)
Status: Server sent passive reply with unroutable address. Using server address instead.
Command: MLSD
Error: Connection timed out
Error: Failed to retrieve directory listing

Well from here look like passive mod not working ok.
I know that I open the port from firewall , for passive range. However this still was not working.
So it appear that when you are using passive mod, you have to use also and the masqueradeaddress section on proftpd.

So basically you should have something like this:
ServerName "your server name"
PassivePorts 49000 50000
MasqueradeAddress name.ofserver.com

Or you may use your routable ip on masqueradeaddress .
And not forget to open 49000:50000 range port in firewall.

February 28, 2012

MYSQL slow queries log

Filed under: Linux — Tags: , , — admin @ 5:18 pm

MySQL has built-in functionality that allows you to log SQL queries to a file , You can enable the full SQL queries logs to a file or only slow running queries log. It is easy for us to troubleshoot/ debug the sql statement if SQL queries log enable.
* To enable slow Query Log only
log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 1

The minimum and default values of long_query_time are 1 and 10, respectively.

* To enable full Log Query
log=/var/log/mysqldquery.log
This will log all queries on your mysqld.

Selecting Queries to Optmize
– The slow query log
– Logs all queries that take longer than long_query_time
– Can also log all querie s that don’t use indexes with
–log-queries-not-using-indexes
– To log slow administatve commands use
–log-slow-admin-statements
– To analyze the contents of the slow log use
mysqldumpslow

Powered by WordPress