Archive for May, 2009

SBDavid

Creating an ext3 File System

Creating an ext3 File System

After installation, it is sometimes necessary to create a new ext3 file system. For example, if you add a new disk drive to the system, you may want to partition the drive and use the ext3 file system.
The steps for creating an ext3 file system are as follows:

1.Format the partition with the ext3 file system using mkfs.

2.Label the partition using e2label.

The tune2fs allows you to convert an ext2 filesystem to ext3.

/sbin/tune2fs -j block_device

Where block_device contains the ext2 filesystem you wish to convert. You must recreate the initrd image so that it will contain the ext3 kernel module. To create this, run the mkinitrd program.

SBDavid

DDOS attack

DDOS attack: Find the domains which are under attack.

If your cpanel server is under DDOS attack then just go to the directory /usr/local/apache/domlogs and then use the command:

grep ‘408 -’ *.com > output_file_name

You can use the search pattern for any other domains with the extension .net .org etc.

408 Request Timed Out

Successful Client Requests

200 OK
201 Created
202 Accepted
203 Non-Authorative Information
204 No Content
205 Reset Content
206 Partial Content

SBDavid

How to Disable Telnet

How to Disable Telnet

TELNET server listens for incoming messages on port 23, and sends outgoing messages to port 23.

1. Login to your server through SSH and su to root.

2. Type pico /etc/xinetd.d/telnet

3. Look for the line: disable = no and replace with disable = yes

4. Now restart the inetd service: /etc/rc.d/init.d/xinetd restart

5. Turn off it through chkconfig as well because it can still start through that.

/sbin/chkconfig telnet off

6. Scan your server to ensure port 23 is closed.

nmap -sT -O localhost
SBDavid

Setting up remote mysql server on DA

Setting up remote mysql server on DA

Make sure that port 3306 is open on the remote box.

Basically, you just run the “GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost” command again, but you change localhost to the IP of your DA server.

GRANT ALL PRIVILEGES ON *.* TO user@16.15.4.1 WITH GRANT OPTION;
FLUSH PRIVILEGES;

Test it out by logging into your DA machine via ssh, and type:

mysql -uda_admin -p –host=16.15.4.1
SBDavid

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

« Prev - Next »