Archive for the 'Apache' Category

 

[crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock

Nov 21, 2007 in Apache

Este error en el que apache se flipa y no es capaz de levantar aún cuando sí tiene espacio en el disco, se soluciona así:

ipcs -s | grep apache | perl -e 'while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}'

Invalid command ‘Order’, perhaps misspelled or defined by a module not included in the server configuration

Nov 07, 2006 in Apache, Debian

En Debian testing al actualizar ahora ocurre este problema:

# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)...Syntax error on line 141 of /etc/apache2/apache2.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
 failed!

Si vemos la documentación de Apache, el comando ‘Order’ pertenece al modulo mod_access

Al pararecer este módulo ya no está enlazado estáticamente si no que se cargará dinámicamente, lo podemos hacer con

# a2enmod authz_host

Lo que ahora lanza otro error:

debian:/etc/apache2/mods-available# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)...Syntax error on line 145 of /etc/apache2/apache2.conf:
Invalid command 'TypesConfig', perhaps misspelled or defined by a module not included in the server configuration
 failed!

Pareceser que hay que activar todo esto:

#a2enmod mime

Ahora este otro error:

# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)...Syntax error on line 22 of /etc/apache2/sites-enabled/000-default:
Invalid command 'ScriptAlias', perhaps misspelled or defined by a module not included in the server configuration
 failed!

solucionamos con :

#a2enmod alias

ahora uno típico:

debian:/etc/apache2/mods-available# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)...apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
httpd (no pid file) not running
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
.

Añadimos /etc/apache2/apache2.conf

ServerName localhost

reiniciar y listo

P.D.: en algunas listas recomiendan añadir tambien el modulo setenvif

Eaccelator: cache para php

May 19, 2006 in Apache, Debian

Instalar eaccelerator

Requirements
————
apache >= 1.3, mod_php >= 4.1, autoconf, automake, libtool, m4

apt-get install php4-dev

#/usr/src/
wget http://keihanna.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc2.tar.bz2
tar jxvf eaccelerator-0.9.4-rc2.tar.bz2

cd eaccelerator-0.9.4-rc2

export PHP_PREFIX=”/usr”
$PHP_PREFIX/bin/phpize

./configure \
–enable-eaccelerator=shared \
–with-php-config=$PHP_PREFIX/bin/php-config

export PHP_PREFIX=”/usr/local”
make

You must specify the real prefix where PHP is installed in the “export”
command. It may be “/usr” “/usr/local”, or something else.

Step 2. Installing eAccelerator

make install

pepito2:/usr/src/eaccelerator-0.9.4-rc2# make install
Installing shared extensions: /usr/lib/php4/20020429/
front3
Installing shared extensions: /usr/lib/php4/20020429/

To install as PHP extension:

en /etc/php/apache2/php.ini
extension=”eaccelerator.so”
# memoria a usar
eaccelerator.shm_size=”256″
eaccelerator.cache_dir=”/var/cache/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

Step 4. Creating cache directory

mkdir /var/cache/eaccelerator
chmod 0777 /var/cache/eaccelerator

# errores:
error: C++ preprocessor “/lib/cpp” fails sanity check
soluicon: apt-get install g++

Interprestar ApacheTop

May 19, 2006 in Apache, Debian

Last hit: 09:17:07 atop runtime: 0 days, 00:58:20 09:17:08
All: 638924 reqs ( 182.65/sec) 3433539K ( 981.6K/sec) ( 5.4K/req)
2xx: 455415 (71.3%) 3xx: 175745 (27.5%) 4xx: 7746 ( 1.2%) 5xx: 10 ( 0.0%)
R ( 30s): 5195 reqs ( 173.17/sec) 25405K ( 846.8K/sec) ( 4.9K/req)
2xx: 3447 (66.4%) 3xx: 1715 (33.0%) 4xx: 33 ( 0.6%) 5xx: 0 ( 0.0%)

REQS REQ/S KB KB/S URL
103 3.4 2983 99.4 /
56 1.9 239 8.0 /tickerdata/story2.dat
47 1.6 104 3.6 /home/today/patina.js
44 1.5 82 2.8 /home/styles/home_d0e2ee.css

Primera linea
-Last hit -> ultima peticion
-tiempo uptime
-hora actual

Peticiones totales ( peticiones/segundo )
Kbs totales ( kbs / segundo )
media kb por peticion

2xx -> codigo 222
3xx -> codigo 3xx
4xx -> codigo 4xx
4xx -> codigo 5xx

2ª linea es igual pero de hace 30 segundos, para ver si todo va bien en el momento actual

Teclas : s -> menu de ordenacion

r Sort by REQUESTS
R Sort by REQUESTS/SECOND
b Sort by BYTES
B Sort by BYTES/SECOND