Dec 03 2009

HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO

Tag:tepezcuintle @ 18:36

Centos
HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO

I am trying to install cahoots a StackOverflow clone but I am running Centos 5 and by default
it comes with php 5.1.6 and I needed to install the Zend Framework. If you tried to install the Zend
framework you will realize that you need PHP 5.2 in order to use it.

I know there are ways to install a new version of PHP on Centos 5, I would not recommend this steps
on a production system at work because you will be using repos that are not supported by Redhat or Centos
so if the maintainer of the repo decides to you are stuck with a version of PHP that is not maintained
by anyone and if there are bugs or security risks you are stuck with a machine that is not supported anymore.
Continua”HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO”


Dec 17 2008

Optimizing Apache 1.3 Old but still useful for legacy machines

Tag:tepezcuintle @ 22:23

Apache 1.3 Process Model Overview







Apache 1.3 on UNIX is
a pre-forking process per request server. When the Apache parent
process is started, it forks a number of child
processes that are responsible for accepting connections off the listening
sockets. When a connection is received, the system wakes up one of the processes
to handle the connection. Since Apache does not do asynchronous network I/O,
Apache needs a process to handle each concurrently connected
browser and client. For example, Apache needs 1000 processes to handle 1000
concurrently connected clients, or connections.

Continua”Optimizing Apache 1.3 Old but still useful for legacy machines”


Jun 10 2008

Apache Performance Tunning

Tag:tepezcuintle @ 15:57

Apache Helicopter

“Premature optimization is the root of all evil.” — Donald Knuth.

…in other words, don’t implement in extra complexity if you don’t need it. A site handling a few thousand requests per day will do fine on a default configuration and just about any hardware. This article is geared towards a site that needs to handle multiple concurrent requests [ten to several hundred per second].

General [in order of importance]

RAM

The single biggest issue affecting webserver performance is RAM. Have as much RAM as your hardware, OS, and funds allow [within reason].

The more RAM your system has, the more processes [and threads] Apache can allocate and use; which directly translates into the amount of concurrent requests/clients Apache can serve.

Generally speaking, disk I/O is usually a close 2nd, followed by CPU speed and network link. Note that a single PII 400 Mhz with 128-256 Megs of RAM can saturate a T3 (45 Mbps) line.

Continua”Apache Performance Tunning”


May 19 2008

Web Server Log Rotation and Analysis

Tag:tepezcuintle @ 20:32

Reading owl

Original Article found at: http://www.keithjbrown.co.uk/vworks/unix/logs.php

Workshop Requirements

In order to make the most of this workshop you should have:

  • Access to an Apache Server that you have permission to administer.
  • A good understanding of Apache Configuration.
  • The ability to install software on your system.

Introduction

Unlike many of the other workshops that are aimed at learning within a development environment, this workshop is really
only of use within a production environment where you are interested in logs, hits and web traffics in general.
That is not to say that you should not first use a development environment on which to practice, but you will only see
the benefit when properly deployed.

This Virtual Workshop will cover how to filter information that you don’t want out of your web
server logs
, how to implement
a log rotation strategy and how to automate the creation of log analysis reports using a variety of different software.
As I run my production servers in a Linux environment, there may be a slight bias towards a Linux way of doing things
(and because everything seems much easier to do with Linux). Efforts have been made throughout to ensure that the
majority of methods work with Windows as well.

What Don’t We Want to Keep?

This may seem like a strange question, but it is necessary to think about this as Apache can and will record a hit for
every file that is requested unless you tell it differently. This means that for one view of a web page every file that
is used on that page (images, CSS, external javascript etc) will be recorded as a hit. Most log analysis software will
sort out the actual page views etc when producing the stats, but unless you have specific desire to look at data to do
with images or stylesheets it is better to not even record it. There are also other things you may not wish to record,
such as search engine robots trawling your site or worms checking for files that IIS comes with in an attempt to gain
access to the server (we can adopt an air of superiority due to using Apache ;-). The effect of not recording all this
extra data means that the log files are kept significantly smaller as can be seen looking at two test logs which
record one week’s data.

Unfiltered:

-rw-r--r-- 1 keith keith 8967670 Mar 1 00:00 hits_log

Filtered:

-rw-r--r-- 1 keith keith 2562468 May 1 00:00 access_log

The unfiltered log is over three times as big as the filtered one. So having decided that we don’t want
to record all hits on the server we next need to set up the filters on the httpd.conf file. This is
done by creating a custom environmental variable then the existence of which (or not) acts as a filter when given as
an argument to the the CustomLog directive
(can be preceded by the not operator ‘!’). For example if we have created a filter called ‘mylogs‘:

CustomLog logs/access.log combined env=mylogs

This would
only log things hits that appeared in the filter. Or to ensure that everything EXCEPT the filter was logged:

CustomLog logs/access.log combined env=!mylogs

Obviously before a filter can be applied it must first be defined.

Continua”Web Server Log Rotation and Analysis”


May 15 2008

Hide your Apache and PHP version from Hackers

Tag:tepezcuintle @ 20:39

You can't see me

Get your Apache server information using telnet

Code:
telnet domain.com 80

When connected type HEAD / HTTP/1.0, followed by [Enter] key.

Output:

Code:
Trying 206.xxx.xxx.xxx...
Connected to your-domain-name.com.
Escape character is '^]'.
HEAD / HTTP/1.0
Continua”Hide your Apache and PHP version from Hackers”


May 12 2008

Troubleshooting Apache

Tag:tepezcuintle @ 18:27

Guy Troubleshooting Apache

Original Article URL http://www.gentoo.org/proj/en/apache/doc/troubleshooting.xml

If there is something wrong with your Apache, but you have no idea how to
figure out what’s wrong, your first clues will be in the log files.

There are a few log files around. All of them are located inside
/var/log/apache2/. Not all of the following log files will be
on your system: this depends on what modules you have enabled.
Continua”Troubleshooting Apache”


May 10 2008

Ruby on Rails Guide, Great for SVN Setup

Tag:tepezcuintle @ 2:21

Ruby on Rails

This guide will help you setup a Rails development environment on Mac OS X. It includes a deployment recipe for Textdrive using lighttpd and general guide for deploying with Mongrel and Apache.

Quick Links:
Installing Lighttpd
Installing Mongrel
Deploying to TextDrive
Deploying with Mongrel and Apache

Get Set Up

Continua”Ruby on Rails Guide, Great for SVN Setup”


Apr 29 2008

How to upgrade to PHP 5 on Centos 4.6

Tag:tepezcuintle @ 20:08

I have a VMWare Virtual machine that I use for testing and I needed to upgrade to PHP 5
this can be accomplished this way.

To upgrade to PHP5
edit /etc/yum.repos.d/CentOS-Base.repo
Enable CentOSPlus
Then do yum update php

basically the REPO will look like this after you enable it.
Continua”How to upgrade to PHP 5 on Centos 4.6″


Dec 21 2007

Elite htaccess hacks

Tag:tepezcuintle @ 3:47

# ELITE HTACCESS FOR WEBDEVELOPERS
##############################################
AuthName “SiteName Administration”
AuthUserFile /home/sitename.com/.htpasswd
AuthType basic
Require valid-user
Order deny,allow
Deny from all
Allow from 24\.205\.23\.222
Allow from w3.org htmlhelp.com
Allow from googlebot.com
Satisfy Any
Each code snippet has been copied from htaccesselite. Additional and detailed info on each htaccess code snippet can be found at askapache.com

NOTE: Most of these snippets can be used with a Files or Filesmatch directive to only apply to certain files.

NOTE: Any htaccess rewrite examples should always begin with:

Continua”Elite htaccess hacks”


Dec 19 2007

How to collect PHP Errors to help Developers

Tag:tepezcuintle @ 16:29

PHP offers simple but effective solution to log all errors to a log fiie.
On all production web server you must turn off displaying error to end users via a web browser. Remember PHP gives out lots of information about path, database schema and all other sort of sensitive information. You are strongly advised to use error logging in place of error displaying on production web sites. The idea is quite simple -only developer should see php error log.

How do I log all php errors to a log file?

Just add following line to /etc/php.ini to log errors to specified file – /var/log/php-scripts.log

# vi /etc/php.ini
Modify error_log directive
error_log = /var/log/php-scripts.log
Make sure display_errors set to Off (no errors to end users)
display_errors = Off
Save and close the file. Restart web server:

# /etc/init.d/httpd restart

How do I log errors to syslog or Windows Server Event Log?

Modify error_log as follows :
error_log = syslog

How do I see logs?

Login using ssh or download a log file /var/log/php-scripts.log using sftp:
$ sudo tail -f /var/log/php-scripts.log


Next Page »