Home » Web Server

Apache2 mod_fastcgi: Connect to External PHP via UNIX Socket or TCP/IP Port

Now, mod_fastcgi is configured and running. FastCGI supports connection via UNIX sockets or TCP/IP networking. This is useful to spread load among various backends. For example, php will be severed from 192.168.1.10 and python / ruby on rails will be severed from 192.168.1.11. This is only possible with mod_fastcgi. Required utilities You can spawn FastCGI [...]

CentOS, Apache & mod_fcgid: IPCCommTimeout not working as expected

If you’re running Apache with the mod_fcgid module to let your PHP scripts be handled in a seperate module, you can run into this annoying little bug in the mod_fcgid 2.2.x implementations. The problem: mod_fcgid: read data timeout in xx seconds First, check if you have the mod_fcgid module that is causing these problems. # [...]

Lighttpd client side optimization

Edit conf file: /etc/lighttpd/lighttpd.conf Enable mod_expire and mod_compress. Expire static files set for 3 days: $HTTP["url"] =~ “\.(js|css|gif|jpg|png|ico|txt|swf|html|htm)$” { expire.url = ( “” => “access 3 days” ) } Compress mime types: compress.cache-dir         = “/var/cache/lighttpd/compress/” compress.filetype          = (“text/plain”, “text/html”, “text/css”, “text/xml”, “text/javascript”) Cleanup the compressed cache via daily cron script: #!/bin/bash # lighttpd_cache_clean # Clean [...]

Redirect browser to use SSL

ou can redirect browser to use SSL secure port using .htaccess file with Rewrite Rules. Create a .htaccess file with the below Rewrite rule. Options +FollowSymLinks RewriteEngine On RewriteCond %{SERVER_PORT} !=443 RewriteRule ^ https://secure.yourdomain.com%{REQUEST_URI} [NS,R,L]

EasyApache Custom Modules

Custom Apache and PHP modules add features to the EasyApache system, and are accessible from both the command line and graphical WHM interfaces. These modules are compiled into Apache and/or PHP just like the modules provided with EasyApache. Before you begin You can find documentation for creating custom modules your server at WHM > EasyApache [...]

Chroot Apache 2 Web Server

A chroot on Red Hat / CentOS / Fedora Linux operating changes the apparent disk root directory for the Apache process and its children. Once this is done attacker or other php / perl / python scripts cannot access or name files outside that directory. This is called a “chroot jail” for Apache. You should [...]

Mapping subdomains to parametered web pages in Apache

Mapping john.webserver.com to http://www.webserver.com/user.php?name=john is just by changing a few parameters in http.conf file In httpd.conf file, <VirtualHost se.rv.er.ip.ad.re.ss> ServerAdmin info@servername.com DocumentRoot /var/www ErrorLog /var/log/apache/apache-error.log TransferLog /var/log/apache/apache.log ServerName www.servername.com ServerAlias *.servername.com RewriteEngine on RewriteCond %{HTTP_HOST} !^www.* [NC] RewriteCond %{HTTP_HOST} ^([^\.]+)\.servername\.com RewriteRule ^/$ http://www.servername.com/user.php?user=%1 </VirtualHost> The lines for this feature, RewriteEngine on activating rewrite option RewriteCond [...]

Lighttpd: network.c:483: error: ‘EC_KEY’ undeclared (first use in this function) Error and Solution

I’m trying to install the latest version of Lighttpd v1.4.29 web server under RHEL 6.1 AMD64 and getting the following error: network.c: In function ‘network_init’: network.c:483: error: ‘EC_KEY’ undeclared (first use in this function) network.c:483: error: (Each undeclared identifier is reported only once network.c:483: error: for each function it appears in.) network.c:483: error: ‘ecdh’ undeclared [...]

Using Nginx as reverse proxy

It’s common knowledge that when you’re serving a web application you shouldn’t use a standard Apache install to serve static assets, as it comes with too much overhead. I won’t go into the details of why here, as it’s been covered by many other people better qualified than I. What I can do, however, is tell you how [...]

Apache give each user their own cgi-bin directory

Apache has public_html directory support. With this you specify the name of the directory which is appended onto a user’s home directory if a ~user request is received. For example http://domain.com/~rocky/file.html will be rocky’s home directory /home/rocky/public_html/file.html. Recently I took small part time job to setup web server for university. I want to give every [...]