Tag: amazon linux
-
Block HTTP traffic based on XFF IP behind ELB
iptables can only work with IP and we cannot make it use the values from a HTTP header OS : Amazon Linux #yum install mod_security #vim /etc/httpd/conf.d/mod_security.conf Following rule is added to block Traffic [ELB used]: SecRule REQUEST_HEADERS:X-Forwarded-For “@Contains 11.222.333.44” “phase:1,log,deny,id:1001” Following rule is added to block traffic [ELB not used] SecRule REMOTE_ADDR “^111.222.333.444” “phase:1,log,deny,id:1004″…
-
Install Newrelic Plugin for Redis
[Amazon Linux AMI] Download The Plugin #wget “https://pypi.python.org/packages/source/n/newrelic_plugin_agent/newrelic_plugin_agent-1.2.3.tar.gz” #tar xvzf newrelic_* #sudo easy_install pip #sudo pip install newrelic-plugin-agent #sudo cp /opt/newrelic_plugin_agent/newrelic_plugin_agent.cfg /etc/newrelic/newrelic_plugin_agent.cfg Edit the /etc/newrelic/newrelic_plugin_agent.cfg file and enter the 1.License 2.Uncomment the redis block. for example redis: – name: redis1 host: localhost port: 6379 db_count: 16 The whole portion should inside “Application” ie you have…
-
Setting Prefork parameters – Apache
80/20 Rule of Thumb : Overall performance depends on – 80% Application Tunning and 20% Infra Tuning Apache Default configuration on Amazon Linux IfModule prefork.c> StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 Lets Load Test with ab tool #ab -n 100 -c 30 http://ec2-public-domain-name/ Result with Default settings Concurrency Level:…
-
Set Up HTTP Authentication With Nginx On Amazon Linux
Setting Up Nginx VHost (Amazon Linux) yum install nginx vim /etc/nginx/conf.d/virtual.conf Inside virtual.conf server { listen 80; server_name unnitest.com; root /var/www/unni; index index.html; } Put Entry on /etc/hosts file in local computer as 1.2.3.4 unnitest.com Now Nginx server is setup. HTTP Authentication Install htpasswd yum install httpd Create User and Password Create a .htpasswd…
-
Apache + mod_jk + Tomcat on Amazon Linux
Installing Apache #yum install httpd.x86_64 #chkconfig httpd on Install Java Installing Tomcat from source cd /opt wget “http://apache.mirrors.lucidnetworks.net/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.tar.gz” tar xvzf apache-tomcat-7.0.42.tar.gz /opt/apache-tomcat-7.0.42/bin/startup.sh Installing mod_jk connector Prerequisite : #yum install libtool httpd-devel autoconf.noarch http://tomcat.apache.org/download-connectors.cgi #wget “http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.32-src.tar.gz” #tar xvzf tomcat-connectors-1.2.32-src.tar.gz #mv tomcat-connectors-1.2.32-src /usr/src/ #cd /usr/src/tomcat-connectors-1.2.32-src/native #./buildconf.sh #./configure –with-apxs=/usr/sbin/apxs ERROR — rm: cannot remove `libtoolT’: No such file…
-
Install Innotop for Mysql Performance Monitoring on Amazon Linux
Installing Dependencies 1.yum install perl-ExtUtils-MakeMaker 2.mkdir extutils wget http://files.directadmin.com/services/9.0/ExtUtils-MakeMaker-6.31.tar.gz tar xvzf ExtUtils-MakeMaker-6.31.tar.gz cd ExtUtils-MakeMaker-6.31 perl Makefile.PL make make install 3.yum install perl-CPAN perl -MCPAN -eshell install Term::ReadKey install DBI install DBD::mysql 4.yum install perl-Time-HiRes 5.yum install perl-TermReadKey.x86_64 Install Innotop mkdir innotop wget “http://innotop.googlecode.com/files/innotop-1.9.1.tar.gz” tar xvzf innotop-1.9.1.tar.gz perl Makefile.PL make install Connecting to RDS: innotop…