Simple way to tune apache performance using mpm prefork module

There could be many reasons why your website performance is poor, one of them can possibly be that Apache is not coping with the load. Below you’ll find ready to consume configuration to make Apache performance better using the Apache MPM prefork module.

To do this, just include the below lines into your httpd.conf apache configuration file:

<IfModule mpm_prefork_module>
 StartServers 2
 MinSpareServers 2
 MaxSpareServers 5
 MaxClients 200 #must be customized
 ServerLimit 200 #must be customized
 MaxRequestsPerChild 100
 </IfModule>

KeepAlive Off

Some explanations are here:

Continue reading “Simple way to tune apache performance using mpm prefork module” »

Share

Install And Configure Varnish Cache With Apache On Debian 7

Varnish Cache is a web accelerator, sometimes referred to as a HTTP accelerator or a reverse HTTP proxy, that will significantly enhance your web performance.

Varnish speeds up a website by storing a copy of the page served by the web server the first time a user visits that page. The next time a user requests the same page, Varnish will serve the copy instead of requesting the page from the web server.

This means that your web server needs to handle less traffic and your website’s performance and scalability go through the roof. Varnish cache will increase the delivery of your web content by 80 % or more, depending on your architecture. Continue reading “Install And Configure Varnish Cache With Apache On Debian 7” »

Share

List all DNS records from a Nameserver using nslookup

Method-1)
How to list all records below some domain name.

Usually it’s done from interactive nslookup mode, not from batch mode

nslookup - your_dns_server
>set q=any
>ls -d domain.name

listing may be prohibited by administrator or by firewall settings, in that case you get empty output or ‘not implemented’ errors.

Method-2)
How to get all records of the domain name itself. In that case you need to run on Windows:

nslookup -"set q=all" yourdomain.com

onUnix:

nslookup -q=any yourdomain.com
Share

Hiding Apache and PHP Server Signature

Revealing web server signature with server/PHP version info can be a security risk as you are essentially telling attackers known vulnerabilities of your system. Thus it is recommended you disable all web server signatures as part of server hardening process.signature

Disable Apache Web Server Signature

Disabling Apache web server signature can be achieved by editing Apache config file.

On Debian, Ubuntu or Linux Mint:

$ sudo vi /etc/apache2/apache2.conf

Continue reading “Hiding Apache and PHP Server Signature” »

Share

Mount a Remote Directory With SSHFS

sshfs is a filesystem based on the SSH file transfer protocol. It is used on a client system i.e. you need to install sshfs package on your local computer/laptop powered by CentOS/RHEL/Ubuntu/Debian/Arch Linux. No need to install anything on server (server1.cyberciti.biz). You only need an openssh server installed on server side. Our sample setup:

Installing SSHFS on a Ubuntu/Debian/Mint Linux

Type the following apt-get command:

sudo apt-get install sshfs

Continue reading “Mount a Remote Directory With SSHFS” »

Share

How to correctly install wkhtmltopdf on debian 64 bit?

Ubuntu and Debian packages are compatible most times but not in all cases, i think this is the trouble you’re having you’re trying to use the Ubuntu’s .deb for Debian instead you should get the Debian specific file, (it works for both jessie and wheezy)

wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-wheezy-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-wheezy-amd64.deb

Then in the /etc/init.d/openerp-server or /etc/init.d/odoo-server script(s), depending on your which one you have

add /usr/local/bin to the front of path environment variable for example,

PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin,

This tells odoo where to look for system binaries it requires or optionally you can copy the files to /usr/bin, if you don’t want to mess with those files

sudo cp /usr/local/bin/wkhtmlto* /usr/bin/

Src: http://stackoverflow.com/questions/38262173/how-to-correctly-install-wkhtmltopdf-on-debian-64-bit

Share

Postfix using Gmail as a Mail Relay with Debian 7

Prerequisites

Before starting this tutorial, you should have:

  • Debian 7 installed
  • Your fully qualified domain name (FQDN)
  • All updates installed :
apt-get update

A valid username and password for the SMTP mail provider, such as Mandrill, or SendGrid
Make sure the libsasl2-modules package is installed and up to date:

apt-get install libsasl2-modules

Continue reading “Postfix using Gmail as a Mail Relay with Debian 7” »

Share

Create a Sudo User on Debian or Ubuntu

Log in to your server as the root user.

ssh root@server_ip_address

Use the adduser command to add a new user to your system. Be sure to replace username with the user that you want to create.

adduser username

Set and confirm the new user’s password at the prompt. A strong password is highly recommended! Continue reading “Create a Sudo User on Debian or Ubuntu” »

Share

Installing SqlMap in Ubuntu / any Linux distro for SQL Injection

SQLMAP is a automated SQL injection tool which does most of the work for you. If you don’t know what SQL injection is head over here: https://en.wikipedia.org/wiki/SQL_injection

Using SQLMAP, you can “hack” many databases in very short time. In the next post, i will show you how to dump database tables and credentials from a vulnerable database and explore.

Even if the passwords are stored using hashing functions ( https://en.wikipedia.org/wiki/Hash_function ), you can crack these hashes using online tools.

Here is the complete video guide for installation: Continue reading “Installing SqlMap in Ubuntu / any Linux distro for SQL Injection” »

Share

All about VPN ports

1) If RRAS based VPN server is behind a firewall (i.e. a firewall is placed between Internet and RRAS server), then following ports need to be opened (bidirectional) on this firewall to allow VPN traffic to pass through: –

  1. For PPTP:
    1. IP Protocol=TCP, TCP Port number=1723   <- Used by PPTP control path
    2. IP Protocol=GRE (value 47)   <- Used by PPTP data path
  2. For L2TP:
    1. IP Protocol Type=UDP, UDP Port Number=500    <- Used by IKEv1 (IPSec control path)
    2. IP Protocol Type=UDP, UDP Port Number=4500   <- Used by IKEv1 (IPSec control path)
    3. IP Protocol Type=ESP (value 50)   <- Used by IPSec data path
  3. For SSTP:
    1. IP Protocol=TCP, TCP Port number=443   <- Used by SSTP control and data path
  4. For IKEv2:
    1. IP Protocol Type=UDP, UDP Port Number=500    <- Used by IKEv2 (IPSec control path)
    2. IP Protocol Type=UDP, UDP Port Number=4500   <- Used by IKEv2 (IPSec control path)
    3. IP Protocol Type=ESP (value 50)   <- Used by IPSec data path

Continue reading “All about VPN ports” »

Share