Warning: opendir(/vcdata/webroot/manhnd.com/blog.manhnd.com/wp-content/themes/postcard/styles/) [function.opendir]: failed to open dir: Permission denied in /vcdata/webroot/manhnd.com/blog.manhnd.com/wp-content/themes/postcard/includes/theme-options.php on line 39
Build apache php from sources | Mạnh Nguyễn

Feb 09

Build apache php from sources

by ManhND in Linux

Build Apache

- I use mpm prefork for stable reason.
Default max_clients is 256 .To increase max_clients, edit file ./httpd-2.2.11/server/mpm/prefork/prefork.c

Change #define DEFAULT_SERVER_LIMIT 512

- Check config

./configure \
–prefix=/wwwroot/apache2 \
–with-mpm=prefork \
–enable-fcgid \
–with-included-apr \
–enable-lib64 \
–enable-nonportable-atomics=yes \
–enable-cache \
–enable-disk-cache \
–enable-mem-cache \
–enable-file-cache \
–enable-rewrite \
–enable-expires \
–enable-headers \
–enable-deflate \
–enable-so \
–enable-unique-id \
–disable-autoindex \
–disable-userdir \
–disable-env \
–disable-setenvif \
–disable-status \
–disable-asis \
–disable-negotiation \
–disable-include \
–disable-charset-lite \
$@

make

make install

Build php

./configure –with-apxs2=/wwwroot/apache2/bin/apxs \
–with-mysql \
–enable-mbstring \
–prefix=/wwwroot/apache2/php \
–with-config-file-path=/wwwroot/apache2/php \
–disable-cgi \
–with-zlib \
–with-curl \
–with-curlwrappers \
–with-gettext \
–with-gd=/wwwroot/gd \
–enable-ftp \

download php.ini to /wwwroot/apache2/php

Config apache allow running php

-Edit httpd.conf

Add

AddHandler php5-script .php
AddType text/html .php

Start Apache

/wwwroot/apache2/bin/apachectl start

Tags: , , ,

Leave a Reply