Optimize MySQL 4

Optimize MySQL 4

If you are using MySQL 5 and having 2+GB RAM, then use /usr/share/mysql/my-large.cnf

If you’ve got mysql 4 (and not mysql 5), then you can use the following code in your /etc/my.cnf:

[mysqld]
local-infile=0
skip-locking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1

[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

If you want to bypass all automated means for more control, you can create a key and certificate request using the following commands:

/usr/bin/openssl genrsa 1024 > private.key
/usr/bin/openssl req -new -key private.key

where you can replace 1024 with 2048 if you want a stronger key.

The genrsa will ask you all information for the certificate.

Once created, you give the certificate request to a certificate authority. They’ll give you a new certificate, which you’d use with your private.key to make the pair.

DirectAdmin Access: Ports that needs to be opened in firewall.

20,21: FTP.

Note that ftp will use a “random high port number” if the client is in PORT mode, so you may need to add a port range into your /etc/proftpd.conf file to allow ftp connections, eg:

PassivePorts 35000 35999

22: ssh access

25, 587: smtp for exim to recieve email

53: dns (named), so your sites resolve. TCP/IP and UDP here.

80, 443: apache traffic, http and https

110, 993: client pop email access
143, 995: clients imap email access

2222: DirectAdmin Access

3306: mysql acess. For remote mysql access.

Setting the system date and clock

To set the system clock, use the date command.

For Redhat Systems, use the following format:

date –set=”Mmm DD HH:MM:SS YYYY”


Example:

date –set=”Jan 20 20:20:20 2009″

SYNOPSIS

date [OPTION]… [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

DESCRIPTION

Display the current time in the given FORMAT, or set the system date.


Proftpd Troubleshooting

Proftpd Troubleshooting

1) Try resetting your password.

2) Check the /etc/proftpd.vhosts.conf to see if there are any virtualhosts for the IP you’re connecting to. If there is, check the password file it points to, to ensure the account they’re logging in with exists in the file. If no virtualhost means it defaults to /etc/proftpd.passwd (check the /etc/proftpd.conf to confirm)

3) For any shared IP account, the user/cryptedpass should be in /etc/proftpd.passwd
Owned IPs should be in /usr/local/directadmin/data/users/username/ftp.passwd, but will have a virtualhost in the proftpd.vhosts.conf file.

4)Try running proftpd in debug mode.

« Prev - Next »