Running Multiple Mysql
The easiest way is to run multiple servers on Unix is to compile them with different TCP/IP ports and Unix socket files so that each one is listening on different network interfaces. Compiling in different base directories for each installation also results automatically in a separate, compiled-in data directory, log file, and PID file location for each server.
If the existing Mysql server is configured for the default TCP/IP port number (3306) and Unix socket file (/tmp/mysql.sock).
To configure a new My sql server to have different operating parameters, use a configure command something like this:
shell> ./configure --with-tcp-port=port_number (3307)\
--with-unix-socket-path=file_name (/tmp/new.mysql.sock \
--prefix=/usr/local/mysql-5.1.46
Here, port_number and file_name must be different from the default TCP/IP port number and Unix socket file path name, and the --prefix value should specify an installation directory different from the one under which the existing MySQL installation is located. As mentioned above.
Open the new port in the firewall.
shell> mysqld_safe --socket=file_name --port=port_number
To start a second server, provide different --socket and --port option values, and pass a --datadir=path option to mysqld_safe so that the server uses a different data directory.
Or we can Install multiple Mysql Using the Mysql sandbox tool.
Mysql sandbox :: -- MySQL Sandbox is a tool for installing one or more MySQL servers in isolation, without affecting other servers
Search This Blog
Showing posts with label Web Hosting. Show all posts
Showing posts with label Web Hosting. Show all posts
Monday, June 07, 2010
Sunday, June 06, 2010
Running Multiple Mysql
Running Multiple Mysql
The easiest way is to run multiple servers on Unix is to compile them with different TCP/IP ports and Unix socket files so that each one is listening on different network interfaces. Compiling in different base directories for each installation also results automatically in a separate, compiled-in data directory, log file, and PID file location for each server.
If the existing Mysql server is configured for the default TCP/IP port number (3306) and Unix socket file (/tmp/mysql.sock).
To configure a new My sql server to have different operating parameters, use a configure command something like this:
shell> ./configure --with-tcp-port=port_number (3307)\
--with-unix-socket-path=file_name (/tmp/new.mysql.sock \
--prefix=/usr/local/mysql-5.1.46
Here, port_number and file_name must be different from the default TCP/IP port number and Unix socket file path name, and the --prefix value should specify an installation directory different from the one under which the existing MySQL installation is located. As mentioned above.
Open the new port in the firewall.
shell> mysqld_safe --socket=file_name --port=port_number
To start a second server, provide different --socket and --port option values, and pass a --datadir=path option to mysqld_safe so that the server uses a different data directory.
Or we can Install multiple Mysql Using the Mysql sandbox tool.
Mysql sandbox :: -- MySQL Sandbox is a tool for installing one or more MySQL servers in isolation, without affecting other servers
The easiest way is to run multiple servers on Unix is to compile them with different TCP/IP ports and Unix socket files so that each one is listening on different network interfaces. Compiling in different base directories for each installation also results automatically in a separate, compiled-in data directory, log file, and PID file location for each server.
If the existing Mysql server is configured for the default TCP/IP port number (3306) and Unix socket file (/tmp/mysql.sock).
To configure a new My sql server to have different operating parameters, use a configure command something like this:
shell> ./configure --with-tcp-port=port_number (3307)\
--with-unix-socket-path=file_name (/tmp/new.mysql.sock \
--prefix=/usr/local/mysql-5.1.46
Here, port_number and file_name must be different from the default TCP/IP port number and Unix socket file path name, and the --prefix value should specify an installation directory different from the one under which the existing MySQL installation is located. As mentioned above.
Open the new port in the firewall.
shell> mysqld_safe --socket=file_name --port=port_number
To start a second server, provide different --socket and --port option values, and pass a --datadir=path option to mysqld_safe so that the server uses a different data directory.
Or we can Install multiple Mysql Using the Mysql sandbox tool.
Mysql sandbox :: -- MySQL Sandbox is a tool for installing one or more MySQL servers in isolation, without affecting other servers
Limiting the intensity of httpd Attack
Limiting the intensity of httpd Attack
First of all we need to check whether the attack is from a specified IP
You can check the number of connections from an IP using the Following script
netstat -plan|grep :80|awk '{print $5}'|cut -d: -f 1|sort|uniq -c|sort –n
You can block the IP from which the attack is going on.
Reload the Firewall after added the IP to the server (Good firewall
such as CSF and APF can be used for this purpose)
Tools for limiting the Httpd attacks
Install mod security
The DDOS attacks are generally targeted on HTTP. So its always good to have a filtering system for apache . So that the request gets analyzed before web server handles it.
Installation step of mod_security in DSO (Dynamic Shared Object) mode below
# wget Download the mod_Security module from the appropriate server
# Untar It
# cd mod_
# /usr/local/apache/bin/apxs -cia mod_security.c
Create a file named mod_security.conf under the folder /usr/local/apache/conf
# vi /usr/local/apache/conf/mod_security.conf
Create the rule with reference to the link http://www.modsecurity.org/documentation/quick-examples.html
and add it in the mod_security.conf file.
Add the location of mod_security.conf to httpd.conf
# vi /usr/local/apache/conf/httpd.conf
Add the string below Include /usr/local/apache/conf/mod_security.conf
# /usr/local/apache/bin/apachectl stop
# /usr/local/apache/bin/apachectl start
3. You can install Mod_dosevasive in the server to protect against the DDOS attack
# wget Download the mod_evasive module from the appropriate server
# Untar It
# cd mod_evasive …
# $APACHE_ROOT/bin/apxs -iac mod_evasive.c
Change the variable ``$APACHE_ROOT'' . It’s the variable which stores the location of the apache installation (eg $APACHE_ROOT =/usr/local/apache)
# vi /usr/loca/apache/conf/httpd.conf
After this add the below code in httpd.conf
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
# /usr/loca/apache/bin/apachectl restart
First of all we need to check whether the attack is from a specified IP
You can check the number of connections from an IP using the Following script
netstat -plan|grep :80|awk '{print $5}'|cut -d: -f 1|sort|uniq -c|sort –n
You can block the IP from which the attack is going on.
Reload the Firewall after added the IP to the server (Good firewall
such as CSF and APF can be used for this purpose)
Tools for limiting the Httpd attacks
Install mod security
The DDOS attacks are generally targeted on HTTP. So its always good to have a filtering system for apache . So that the request gets analyzed before web server handles it.
Installation step of mod_security in DSO (Dynamic Shared Object) mode below
# wget Download the mod_Security module from the appropriate server
# Untar It
# cd mod_
# /usr/local/apache/bin/apxs -cia mod_security.c
Create a file named mod_security.conf under the folder /usr/local/apache/conf
# vi /usr/local/apache/conf/mod_security.conf
Create the rule with reference to the link http://www.modsecurity.org/documentation/quick-examples.html
and add it in the mod_security.conf file.
Add the location of mod_security.conf to httpd.conf
# vi /usr/local/apache/conf/httpd.conf
Add the string below Include /usr/local/apache/conf/mod_security.conf
# /usr/local/apache/bin/apachectl stop
# /usr/local/apache/bin/apachectl start
3. You can install Mod_dosevasive in the server to protect against the DDOS attack
# wget Download the mod_evasive module from the appropriate server
# Untar It
# cd mod_evasive …
# $APACHE_ROOT/bin/apxs -iac mod_evasive.c
Change the variable ``$APACHE_ROOT'' . It’s the variable which stores the location of the apache installation (eg $APACHE_ROOT =/usr/local/apache)
# vi /usr/loca/apache/conf/httpd.conf
After this add the below code in httpd.conf
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
# /usr/loca/apache/bin/apachectl restart
Subscribe to:
Posts (Atom)