Apache

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:

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 - August 8, 2012 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:

Integrating XCache Into PHP5 (Fedora 13/CentOS 5.5 & Apache2)

How to integrate XCache into PHP5 on a Fedora 13 or CentOS 5.5 system (with Apache2). From the XCache project page: “XCache is a fast, stable PHP opcode cacher that has been tested and is now running on production servers under high load.” It’s similar to other PHP opcode cachers, such as eAccelerator and APC.

1 Preliminary Note

I have tested this on a Fedora 13 server with the IP address 192.168.0.100 where Apache2 and PHP5 are already installed and working. I’ll use Apache’s default document root /var/www/html in this tutorial for demonstration purposes. Of course, you can use any other vhost as well

2 Checking PHP5′s Current State

install XCache, let’s find out about our PHP5 installation. To do this, we create the file info.php in our document root /var/www/html

vi /var/www/html/info.php

call that file in a browser: http://192.168.0.100/info.php

see that another PHP opcode cacher such as eAccelerator or APC is installed, you must remove it before you install APC:

For eAccelerator

Continue reading “Integrating XCache Into PHP5 (Fedora 13/CentOS 5.5 & Apache2)” »

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

Categories: Apache, CentOS, PHP   Tags:

Integrating APC (Alternative PHP Cache) Into PHP5 (Fedora 13 & Apache2)

How to integrate APC (Alternative PHP Cache) into PHP5 on a Fedora 13 system (with Apache2). APC is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It’s similar to other PHP opcode cachers, such as eAccelerator and XCache.

1 Preliminary Note

tested this on a Fedora 13 server with the IP address 192.168.0.100 where Apache2 and PHP5 are already installed and working. I’ll use Apache’s default document root /var/www/html in this tutorial for demonstration purposes. Of course, you can use any other vhost as well, but you might have to adjust the path to the info.php file

2 Checking PHP5′s Current State

before we install APC, let’s find out about our PHP5 installation. To do this, we create the file info.php in our document root /var/www/html:

vi /var/www/html/info.php

call that file in a browser: http://192.168.0.100/info.php

see that another PHP opcode cacher such as eAccelerator is installed, you must remove it before you install APC

yum remove php-eaccelerator

Restart Apache

/etc/init.d/httpd restart

3 Installing APC

APC is a PHP extension that can be installed

[ccINb_bash width="700"]
yum install php-pecl-apc

Continue reading “Integrating APC (Alternative PHP Cache) Into PHP5 (Fedora 13 & Apache2)” »

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

Categories: Apache, Fedora, PHP   Tags:

How To Set Up WebDAV With Apache2 On OpenSUSE 11.3

how to set up WebDAV with Apache2 on an OpenSUSE 11.3 server. WebDAV stands for Web-based Distributed Authoring and Versioning and is a set of extensions to the HTTP protocol that allow users to directly edit files on the Apache server so that they do not need to be downloaded/uploaded via FTP. Of course, WebDAV can also be used to upload and download files.
1 Preliminary Note
I’m using an OpenSUSE 11.3 server with the IP address 192.168.0.100 here

2 Installing WebDAV

If Apache is not already installed, install

yast2 -i apache2

enable the WebDAV modules

a2enmod dav
a2enmod dav_fs
a2enmod dav_lock

create the system startup links for Apache and start it

chkconfig --add apache2
/etc/init.d/apache2 start

3 Creating A Virtual Host

create an Apache vhost www.example1.com in the directory /srv/www/web1/web. If you already have a vhost for which you’d like to enable WebDAV, you must adjust this tutorial to your situation.

First, we create the directory /srv/www/web1/web and make the Apache user (wwwrun) and group (www) the owner of that directory

mkdir -p /srv/www/web1/web
chown wwwrun:www /srv/www/web1/web
vi /etc/apache2/vhosts.d/www.example1.com.conf

Open /etc/apache2/httpd.conf and add the line NameVirtualHost * before the Include /etc/apache2/vhosts.d/*.conf line

vi /etc/apache2/httpd.conf

restart Apache

/etc/init.d/apache2 restart

Continue reading “How To Set Up WebDAV With Apache2 On OpenSUSE 11.3” »

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

Categories: Apache, OpenSUSE   Tags:

Next Page »