Ok,.. it was a very hard and rough way for me.. but finally i did it. Was just damn simple but sometimes there are things that won't work the way you want
- Stop your apache:and.. to be save: check if httpd really isn't running anymore:
it should look like this:
Code:
root@[ ~/ ]$ ps aux |grep httpd
root 25756 0.0 0.0 1876 604 pts/0 R+ 14:16 0:00 grep httpd
- Uninstall all apache and php versions using pgktool and delete all config files for a real fresh install as i wanted it. don't forget to back up your ssl certs
- - Go to /usr/src:- get httpd sources: http://httpd.apache.org/download.cgi
- or directly: - or get the package from linuxpackages.net as i did, cause i don't wanted to compile anymore ;>
- get php5 sources: http://www.php.net/downloads.php
- or directly: - unpack everything:
Quote:
tar xfvz httpd-2.2.4.tar.gz && tar xfvj php-5.2.1.tar.bz2
|
- - go to your httpd dir and choose how and what should be compiled with apache2:
Quote:
cd httpd-2.2.4
./configure --help
|
- normally this will be used by myself:
Quote:
./configure --enable-modules=most --enable-mods-shared=most --enable-so --enable-ssl --enable-info --enable-cgi --enable-rewrite --enable-mime-magic --enable-usertrack --enable-deflate
|
- everythings ok without any warnings, errors? if you get errors you probably are missing some libs
- compile and install:
- - do the same with php (be sure to have the newest libs installed... swaret or slapt-get will help you):
Quote:
cd ../php-5.2.1
./configure --help
|
- choose your settings or simply use mine (no vhosts):
Quote:
./configure --with-apxs2=/usr/sbin/apxs --enable-fastcgi --disable-ipv6 --with-openssl --with-zlib --with-bz2 --with-curl --enable-exif --enable-ftp --with-gd --with-gettext --with-ldap --with-mhash --with-mysql --with-ncurses --enable-sockets --with-sqlite --with-xsl --enable-zip
make && make install
|
- - configure everything:
Quote:
libtool --finish /usr/src/php-5.2.1/libs
cp .libs/libphp5.so /usr/local/apache2/modules
ldconfig <- just to be sure
cp php.ini-recommended /usr/local/include/php/php.ini
cp php.ini-recommended /usr/local/lib/php/php.ini
|
- edit httpd.conf:
Quote:
jed /etc/apache2/httpd.conf
|
- make sure this line is in your /etc/apache2/httpd.conf:
Quote:
LoadModule php5_module lib/apache2/libphp5.so
|
- edit the following part:
Quote:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
- to this:
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
|
- edit
Quote:
Quote:
<IfModule mime_module>
...
</IfModule mime_module>
|
-change to
Quote:
<IfModule mime_module>
...
# PHP Type and Handler
AddHandler php5-script php
AddType text/html php
AddType application/x-httpd-php-source phps
</IfModule mime_module>
|
Quote:
The php documentation recommends AddType application/x-httpd-php php instead of the above. However, it causes problems with the "MultiViews" feature of HTTP. That is, if the .php extension is left off a URL, and with certain browser Accept headers, Apache will not know .php (application/x-httpd-php) is HTML and will return a 406 Not Acceptable error. Using the AddType and AddHandler as shown above fixes this problem.
|
|
- save everything...
- now we test if everythings ok:
Quote:
root@[ ~/ ]$ httpd -t
Syntax OK
root@[ ~/ ]$ httpd -v
Server version: Apache/2.2.4 (Unix)
Server built: Jan 23 2007 04:39:37
root@[ ~/ ]$ httpd -V
Server version: Apache/2.2.4 (Unix)
Server built: Jan 23 2007 04:39:37
Server's Module Magic Number: 20051115:4
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/bin/suexec"
-D DEFAULT_PIDLOG="/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"
root@[ ~/ ]$ httpd -S
VirtualHost configuration:
Syntax OK
root@[ ~/ ]$ httpd -l
Compiled in modules:
...
root@[ ~/ ]$ httpd -M
Loaded Modules:
...
php5_module (shared)
Syntax OK
|
- - start apache2: - test php:
Code:
echo "<?php phpinfo(); ?>" >/var/www/htdoccs/info.php
- open http://localhost/info.php and you should see some strange information about your php installation...
- check the logfile for errors:
Code:
jed /var/log/apache2/error_log
used links:
would be nice if you could give me feedback