Using mod_spdy With Apache2 On Ubuntu 12.04

SPDY means is a new networking protocol whose goal is to speed up the web. It is Google’s alternative to the HTTP protocol and a candidate for HTTP/2.0. SPDY augments HTTP with several speed-related features such as stream multiplexing and header compression.This tutorial explains how to use mod_spdy with Apache2 on Ubuntu 12.04.

1 Preliminary Note

SPDY runs over HTTPS, so we need an HTTPS-enabled web site to test SPDY. Please note that SPDY will fall back to HTTPS if the user’s browser does not support SPDY or if things go wrong, so installing mod_spdy doesn’t hurt your existing setup.

assuming that you have a working LAMP setup, as described on Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.04 LTS (LAMP)

testing purposes I wil lsimply enable the default SSL web site that comes with Ubuntu’s Apache package

Continue reading “Using mod_spdy With Apache2 On Ubuntu 12.04” »

 

Fedora 17 Samba Standalone Server With tdbsam Backend

This guide  explains the installation of a Samba fileserver on Fedora 17 and  to configure it to share files over the SMB protocol as well as how to add users. Samba is configured as a standalone server, not as a domain controller. In the resulting setup, every user has his own home directory accessible via the SMB protocol and all users have a shared directory with read-/write access.

1 Preliminary Note

a Fedora 17 system here with the hostname server1.example.com and the IP address 192.168.0.100

SELinux should be  disabled

Edit /etc/selinux/config and set SELINUX=disabled
vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
must reboot the system
reboot

2 Installing Samba

Connect server on the shell and install the Samba packages

yum install cups-libs samba samba-common

Edit the smb.conf file

vi /etc/samba/smb.conf

see the following lines in the [global] section

[...]
# ----------------------- Standalone Server Options ------------------------
#
# security = the mode Samba runs in. This can be set to user, share
# (deprecated), or server (deprecated).
#
# passdb backend = the backend used to store user information in. New
# installations should use either tdbsam or ldapsam. No additional configuration
# is required for tdbsam. The "smbpasswd" utility is available for backwards
# compatibility.
#

        security = user
        passdb backend = tdbsam


 Continue reading “Fedora 17 Samba Standalone Server With tdbsam Backend” »
 

To Use Nagios Plugins In Verax NMS

This lesson shows how to use Nagios plugins to monitor devices in Verax NMS Express. Verax NMS is a cross-platform network and application monitoring software.

Tools used

Nagios plugin for CPU check in a Shell Script format (.sh file) http://exchange.nagios.org/directory/Plugins/System-Metrics/CPU-Usage-and-Load/Check-CPU-LOAD-using-SNMP/details

Verax NMS Express ver. 1.9.5: http://www.veraxsystems.com/en/products/nms

Adding Nagios Plugin To The Device

download a plugin use plugin for checking CPU usage over the SNMP. Insert  plugin in a folder on the same server where Verax NMS Express is installed.

/root/nagios/check_snmp_cpu.sh

let’s add shell script sensor to the device

  1. Log into the Verax NMS, select Home from the main menu and select the right device from the aspects tree.
  2. In Monitors tab select Add option and click Go. The system will display a pop-up dialog with sensors available for your device.
  3. Select Shell Script Sensor from the sensors tree and click Next.
  4. Now you have to specify your sensor parameter

Continue reading “To Use Nagios Plugins In Verax NMS” »

 

Mounting Host Devices/Partitions/Directories In A Container With Bind Mounts

where you need to mount a hard drive, partiiton or directory from the OpenVZ host inside an OpenVZ container explains how you can mount host devices/partitions/directories in an OpenVZ container with bind mounts

1 Preliminary Note

an OpenVZ container with the container ID 101 which is running MySQL. I add a second hard drive to the host and want to put the container’s MySQL directory /var/lib/mysql on the second hard drive

2 Preparing The Host

a new hard drive to the host

fdisk -l

the hard drive is /dev/sdb:

root@server1:~# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00029d5c

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3793    30461952   83  Linux
/dev/sda2            3793        3917      992257    5  Extended
/dev/sda5            3793        3917      992256   82  Linux swap / Solaris

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Continue reading “Mounting Host Devices/Partitions/Directories In A Container With Bind Mounts” »

 

Benchmark Your System CPU, File IO, MySQL

Benchmark suite which allows you to quickly get an impression about system performance which is important if you plan to run a database under intensive load.

not issue any guarantee that this will work for you

1 Installing sysbench

Debian/Ubuntu, sysbench can be installed

apt-get install sysbench

a look

man sysbench

2 CPU Benchmark

benchmark your CPU performance

sysbench –test=cpu –cpu-max-prime=20000 run

root@server1:~# sysbench –test=cpu –cpu-max-prime=20000 run
sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing CPU performance benchmark

Threads started!
Done.

Continue reading “Benchmark Your System CPU, File IO, MySQL” »

 

Configuring An Email Gateway With Scrollout F1 Anti-Spam & DLP

Email gateway installed between Internet and the email server.to protect the email server by filtering incoming messages, via SMTP protocol, from Internet an email gateway may be used as an outgoing gateway in case you want to add some new email features as Secondary a quality improvement for message delivery

Basic Configuration

CONNECT

Set the network connection: IP address, subnet mask, gateway and DNS.

TRAFFIC

mention your domains and the responsible email server for each domain. The servers can have same value in case you are using one email server for multiple domains.

for receiving emails gateway system will become responsible Optionally the gateway for sending outgoing messages DKIM signature and the values that are necessary to be used in your DNS server for each domain. In case that your email servers are using IP addresses different than standard intranet CIDR (10.0.0.0/8, 192.168.0.0/24, 172.16.0.0/12) you must mention the range or IP in CIDR format by clicking “DKIM”

SECURITY

set the aggressiveness by clicking on a number between 1 and 10

COUNTRIES

Set the geographical area in which you have business

COLLECT

two roles of SPAM & LEGIT

Continue reading “Configuring An Email Gateway With Scrollout F1 Anti-Spam & DLP” »

 

Creating Backups & Clones Of Running Virtual Machines (No Downtime) With LVM Snapshots

use LVM volumes for your VirtualBox VMs This lesson shows using LVM snapshots to create backups and clones of running VirtualBox VMs without downtime

1 Preliminary Note

Installed VirtualBox on a headless server use phpvirtualbox as the VirtualBox GUI here. use the original VirtualBox GUI then only it will be perfect.

Running virtual machine named vm10 located on the LVM volume /dev/vg0/vm10.

logged in as root

sudo su

Should run as root user

2 Create A Backup Of A Running VM With LVM Snapshots

create a backup of the running virtual machine vm10 Snapshots can be smaller than the original volume – 512MB

lvcreate -L5G -s -n vm10_snap /dev/vg0/vm10

use dd to read the contents from the snapshot and pipe it to gzip to create a gzipped backup image in the directory

dd if=/dev/vg0/vm10_snap bs=64k | gzip -c > /backup/vm10.img.gz

your backup of vm10 is now located in /backup/vm10.img.gz.

remove the LVM snapshot

Continue reading “Creating Backups & Clones Of Running Virtual Machines (No Downtime) With LVM Snapshots” »

 

Integrate ClamAV Into PureFTPd For Virus Scanning On Ubuntu 12.04

This explains  integrate ClamAV into PureFTPd for virus scanning on an Ubuntu 12.04 system.a file gets uploaded through PureFTPd, ClamAV will check the file and delete it if it is malware.

1 Preliminary Note

PureFTPd setup on your Ubuntu 12.04 server

you are logged in as root

sudo su

should run all the steps as root user

2 Installing ClamAV

ClamAV can be installed as show below

apt-get install clamav clamav-daemon clamav-data

Run

freshclam

Download the latest virus signatures and starts the ClamAV daemon

/etc/init.d/clamav-daemon start

 

3 Configuring PureFTPd

create the file /etc/pure-ftpd/conf/CallUploadScript which contains string yes

echo "yes" > /etc/pure-ftpd/conf/CallUploadScript

create the file /etc/pure-ftpd/clamav_check.sh it wil be usefull when file uploaded through PureFTPd

Continue reading “Integrate ClamAV Into PureFTPd For Virus Scanning On Ubuntu 12.04” »

 

Headless VirtualBox Installation With phpvirtualbox

Phpvirtualbox is a web-based VirtualBox front-end written in PHP that allows you to access and control remote VirtualBox instances.It is a nice replacement for the VirtualBox GUI if you run VirtualBox on headless servers.I do not issue any guarantee that this will work.

1 Preliminary Note

Headless VirtualBox is already installed on the local OpenSUSE 12.1 server
running all the steps in this notes are with root privileges so lo gin as root

2 Installing phpvirtualbox

Create system user as vbox  and add to vboxusers

useradd -m vbox -G vboxusers

password for the vbox user

passwd vbox

Create the file /etc/default/virtualbox and put the line VBOXWEB_USER=vbox in it (so that the VirtualBox SOAP API which is called vboxwebsrv runs as the user vbox)

Continue reading “Headless VirtualBox Installation With phpvirtualbox” »

 

Purpose of Always Use Nginx With Microcaching

How hard is to push out as much as possible from your webserver(s).In daily work as a hosting engineer that means I fairly often get the same question, “Wow, cool website, but can it cope with big-time traffic?

The “normal” situation

A “normal” website running under Apache with mod_php should be able to put out 20 requests per second with ease like 50 requests per second the solution is to drop Apache, because as it is right now Apache just isn’t cutting it anymore

Nginx

Set up your website on Nginx and you run a quick loadtest you don’t get much more than Apache It’s real simple, it’s due to the fact that Nginx doesn’t have a php module built and  need a speciel fastcgi processor to process the php pages. we can use php-fpm as it is better than spawn-cgi for better performance Use microcaching

What is Microcaching?

Microcaching means  user requests the page it caches it so the next request for any other will come from cache, and with 100 users requesting within 5 seconds only 1 in 20 users will have to build up the full page

Continue reading “Purpose of Always Use Nginx With Microcaching” »