Web Server

Using mod_spdy With Apache2 On Fedora 17

SPDY (pronounced “SPeeDY”) 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. To use SPDY, you need a web server and a browser (like Google Chrome and upcoming versions of Firefox) that both support SPDY. mod_spdy is an open-source Apache module that adds support for the SPDY protocol to the Apache HTTPD server. This tutorial explains how to use mod_spdy with Apache2 on Fedora 17

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.

default SSL web site’s URL (e.g. https://www.example.com) and test if it works

2 Installing mod_spdy

at is installed

Continue reading “Using mod_spdy With Apache2 On Fedora 17” »

Be the first to comment - What do you think?  Posted by Aniruddh - August 9, 2012 at 12:18 am

Categories: Apache, Fedora   Tags:

Enabling/Disabling TLS Based On User Or Group

This article explains how to enable or disable TLS in ProFTPd based on the FTP user or group. FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure. While this is a good thing, not all FTP clients support TLS.

1 Preliminary Note

TLS set up already, for example as described in this tutorial: Setting Up ProFTPd + TLS On Debian Squeeze

you can use TLSRequired off in your ProFTPd configuration as this allows for TLS and non-TLS logins, but if you want to make your FTP setup as secure as possible, you should enforce the use of TLS and make exceptions only for the users or groups that use an FTP client that doesn’t support TLS

2 TLS Configuration Based On User/Group

Continue reading “Enabling/Disabling TLS Based On User Or Group” »

Be the first to comment - What do you think?  Posted by Aniruddh - at 12:15 am

Categories: Web Server   Tags:

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” »

Be the first to comment - What do you think?  Posted by Aniruddh - August 8, 2012 at 11:36 pm

Categories: Ubuntu, Web Server   Tags:

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” »

Be the first to comment - What do you think?  Posted by Aniruddh - at 5:43 pm

Categories: Nginx, Web Server   Tags:

Installing Apache2 With PHP5 And MySQL Support On CentOS 6.3

LAMP stands for Linux, Apache, MySQL, PHP.this method show how to install an Apache2 webserver on a CentOS 6.3 server with PHP5 support (mod_php) and MySQL support.

1 Preliminary Note

the hostname used server1.example.com with the IP address 192.168.0.100. These settings may difer for others want to replace them appropriate.

2 Installing MySQL 5

Installation of MySQL

yum install mysql mysql-server

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

Continue reading “Installing Apache2 With PHP5 And MySQL Support On CentOS 6.3” »

Be the first to comment - What do you think?  Posted by Aniruddh - at 1:42 am

Categories: Apache, CentOS, Web Server   Tags:

Apache Server Setup with Mod_Fcgid, PHP5 on CentOS 6

This document explains how to setup Apache web server with mod_fcgid, which is high performance alternative to mod_cgi or mod_cgid, it starts a sufficient number instances of the CGI program to handle concurrent requests, and these programs remain running to handle further incoming requests.

1. Make sure SELinux is disabled before starting

open SELinux configuration on vim editor (/etc/sysconfig/selinux)

vi  /etc/sysconfig/selinux

# 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,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

Save the file and reboot the machine
2. Setup EPEL repository as mod_fcgid is not available in default CentOS repository

Continue reading “Apache Server Setup with Mod_Fcgid, PHP5 on CentOS 6” »

Be the first to comment - What do you think?  Posted by Aniruddh - January 1, 2012 at 11:08 pm

Categories: Apache, CentOS   Tags:

How To Set Up WebDAV With MySQL Authentication On Apache2 (Ubuntu 9.10)

1 Preliminary Note

I’m using an Ubuntu 9.10 server with the hostname server1.example.com and the IP address 192.168.0.100 here.

2 Installing Apache2, WebDAV, MySQL, mod_auth_mysql

To install Apache2, WebDAV, MySQL, and mod_auth_mysql, we run

aptitude install apache2 mysql-server mysql-client libapache2-mod-auth-mysql

don’t have to specify a MySQL root password manually later on:
New password for the MySQL “root” user: < -- yourrootsqlpassword
Repeat password for the MySQL "root" user: <-- yourrootsqlpassword

Afterwards, enable the WebDAV and mod_auth_mysql modules

a2enmod dav_fs
a2enmod dav
a2enmod auth_mysql

Restart Apache

/etc/init.d/apache2 restart

3 Creating A Virtual Host

I will now create a default Apache vhost in the directory /var/www/web1/web. For this purpose, I will modify the default Apache vhost configuration in /etc/apache2/sites-available/default. To enable WebDAV, you must adjust this tutorial to your situation.

First, we create the directory /var/www/web1/web and make the Apache user (www-data) the owner of that directory

mkdir -p /var/www/web1/web
chown www-data /var/www/web1/web

back up the default Apache vhost configuration (/etc/apache2/sites-available/default) and create our own one

mv /etc/apache2/sites-available/default /etc/apache2/sites-available/default_orig
vi /etc/apache2/sites-available/default

reload Apache

/etc/init.d/apache2 reload

4 Configure The Virtual Host For WebDAV

Continue reading “How To Set Up WebDAV With MySQL Authentication On Apache2 (Ubuntu 9.10)” »

Be the first to comment - What do you think?  Posted by Aniruddh - December 20, 2011 at 4:33 pm

Categories: Apache, MySQL   Tags:

Chrooting Apache2 With mod_chroot On OpenSUSE 11.2

how to set up mod_chroot with Apache2 on an OpenSUSE 11.2 system. With mod_chroot, you can run Apache2 in a secure chroot environment and make your server less vulnerable to break-in attempts that try to exploit vulnerabilities in Apache2 or your installed web applications.

1 Preliminary Note

I’m assuming that you have a running OpenSUSE 11.2 system with a working Apache2, e.g. as shown in this tutorial: The Perfect Server – OpenSUSE 11.2 x86_64 [ISPConfig 2]. In addition to that I assume that you have one or more web sites set up within the /srv/www directory (e.g. if you use ISPConfig).

2 Installing mod_chroot

mod_chroot package for OpenSUSE 11.2, therefore we must build it ourselves. First we install the prerequisites

yast2 -i libgcc glibc-devel gcc flex lynx compat-readline4 db-devel wget gcc-c++ make vim

yast2 -i apache2-devel

build mod_chroot

cd /tmp
wget http://core.segfault.pl/~hobbit/mod_chroot/dist/mod_chroot-0.5.tar.gz
tar xvfz mod_chroot-0.5.tar.gz
cd mod_chroot-0.5
apxs2 -cia mod_chroot.c

restart Apache

/etc/init.d/apache2 restart

Continue reading “Chrooting Apache2 With mod_chroot On OpenSUSE 11.2” »

Be the first to comment - What do you think?  Posted by Aniruddh - December 17, 2011 at 2:52 pm

Categories: Apache, OpenSUSE   Tags:

Caching With Apache’s mod_cache On Debian Lenny

how you can cache your web site contents with Apache’s mod_cache on Debian Lenny. If you have a high-traffic dynamic web site that generates lots of database queries on each request, you can decrease the server load dramatically by caching your content for a few minutes or more (that depends on how often you update your content).

1 Preliminary Note

I’m assuming that you have a working Apache2 setup (Apache 2.2.x – prior to that version, mod_cache is considered experimental) from the Debian repositories – the Apache version in the Debian Lenny repositories is 2.2.9 so you should be good to go.

I’m using the document root /var/www here for my test vhost – you must adjust this if your document root differs.

2 Enabling mod_cache

mod_cache has two submodules that manage the cache storage, mod_disk_cache (for storing contents on the hard drive) and mod_mem_cache (for storing contents in memory which is faster than disk caching). Decide which one you want to use and continue either with chapter 2.1 (mod_disk_cache) or 2.2 (mod_mem_cache).

2.1 mod_disk_cache

vi /etc/apache2/mods-available/disk_cache.conf

enable mod_cache and mod_disk_cache

a2enmod cache
a2enmod disk_cache

/etc/init.d/apache2 restart

make sure that our cache directory /var/cache/apache2/mod_disk_cache doesn’t fill up over time, we have to clean it with the htcacheclean command. That command is part of the apache2-utils package

aptitude install apache2-utils

start htcacheclean as a daemon

htcacheclean -d30 -n -t -p /var/cache/apache2/mod_disk_cache -l 100M -i

clean our cache directory every 30 minutes and make sure that it will not get bigger than 100MB. To learn more about htcacheclean, take a look at

man htcacheclean

you don’t want to start htcacheclean manually each time you reboot the server – therefore we edit /etc/rc.local…

vi /etc/rc.local

2.2 mod_mem_cache

mod_mem_cache configuration is located in /etc/apache2/mods-available/mem_cache.conf:

vi /etc/apache2/mods-available/mem_cache.conf

Continue reading “Caching With Apache’s mod_cache On Debian Lenny” »

Be the first to comment - What do you think?  Posted by Aniruddh - December 13, 2011 at 7:13 am

Categories: Apache, Debian   Tags:

Caching With Apache’s mod_cache On Ubuntu 10.04

How you can cache your web site contents with Apache’s mod_cache on Ubuntu 10.04. If you have a high-traffic dynamic web site that generates lots of database queries on each request, you can decrease the server load dramatically by caching your content for a few minutes or more (that depends on how often you update your content).

1 Preliminary Note

I’m assuming that you have a working Apache2 setup (Apache 2.2.x – prior to that version, mod_cache is considered experimental) from the Ubuntu repositories – the Apache version in the Ubuntu 10.04 repositories is 2.2.14 so you should be good to go.

I’m using the document root /var/www here for my test vhost – you must adjust this if your document root differs

2 Enabling mod_cache

mod_cache has two submodules that manage the cache storage, mod_disk_cache (for storing contents on the hard drive) and mod_mem_cache (for storing contents in memory which is faster than disk caching). Decide which one you want to use and continue either with chapter 2.1 (mod_disk_cache) or 2.2 (mod_mem_cache).

2.1 mod_disk_cache

The mod_disk_cache configuration is stored in /etc/apache2/mods-available/disk_cache.conf, so let’s edit that one

vi /etc/apache2/mods-available/disk_cache.conf

You can find explanations for these configuration options and further configuration options on http://httpd.apache.org/docs/2.2/mod/mod_disk_cache.html.

Now we can enable mod_cache and mod_disk_cache

Continue reading “Caching With Apache’s mod_cache On Ubuntu 10.04” »

Be the first to comment - What do you think?  Posted by Aniruddh - December 11, 2011 at 6:25 am

Categories: Apache, Ubuntu   Tags:

Next Page »