lunes, 16 de febrero de 2009

HOW TO COMPILE PROFTPD with BOTH SFTP AND FTPS

Proftpd is a really could ftp server, but by default, you can use neither ftps nor sftp.

So here is a little explanation about how to do it using some source files to compile it.

I used this webpage in order to get some help on how to install it, nevertheless I got some error message that were not referenced, neither on the website nor on google so I hope that help:

http://www.castaglia.org/proftpd/modules/mod_sftp.html#Installation


1) Download proftpd version 1.3.2 (only version compatible with mod_sftp)
ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.2.tar.gz


2) Download the mod_sftp module

from : http://www.castaglia.org/proftpd/#Modules I choose:
http://www.castaglia.org/proftpd/modules/proftpd-mod-sftp-0.9.6.tar.gz


3) Uncompress the proftpd-1.3.2.tar.gz tarball in /tmp/proftpd_source and then the proftpd-mod-sftp-0.9.6.tar.gz in the folder /tmp/proftpd_source/proftpd-1.3.2/modules

4) From a shell, run the configure in order to generate the Makefile

./configure --enable-openssl --with-modules=mod_sftp:mod_tls

(We indicate that we want both mod_sftp and mod_tls to be compiled by seperating them by a colon)
.
.
.
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking for ANSI C header files... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mod_sftp.h
config.status: mod_sftp.h is unchanged



5) Now you can launch the make (which will fail but we'll see how to fix that)

make
cd lib/ && make lib
make[1]: Entering directory `/tmp/proftpd_sftp/proftpd-1.3.2/lib'
make[1]: Nothing to be done for `lib'.
make[1]: Leaving directory `/tmp/proftpd_sftp/proftpd-1.3.2/lib'
cd src/ && make src
make[1]: Entering directory `/tmp/proftpd_sftp/proftpd-1.3.2/src'
make[1]: Nothing to be done for `src'.
make[1]: Leaving directory `/tmp/proftpd_sftp/proftpd-1.3.2/src'
cd modules/ && make static
make[1]: Entering directory `/tmp/proftpd_sftp/proftpd-1.3.2/modules'
make[2]: Entering directory `/tmp/proftpd_sftp/proftpd-1.3.2/modules/mod_sftp'
ar rc mod_sftp.a mod_sftp.o mod_sftp.o msg.o packet.o cipher.o mac.o compress.o kex.o keys.o crypto.o utf8.o session.o service.o kbdint.o auth-hostbased.o auth-kbdint.o auth-password.o auth-publickey.o auth.o disconnect.o rfc4716.o keystore.o channel.o blacklist.o interop.o tap.o fxp.o scp.o
ranlib mod_sftp.a
make[2]: Leaving directory `/tmp/proftpd_sftp/proftpd-1.3.2/modules/mod_sftp'
make[1]: Leaving directory `/tmp/proftpd_sftp/proftpd-1.3.2/modules'
test -z """" -a -z """" || (cd modules/ && make shared)
test -z """" || (cd locale/ && make locale)
/bin/sh ./libtool --mode=link --tag=CC gcc -L./lib -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/str.o src/table.o src/regexp.o src/dirtree.o src/expr.o src/support.o src/netaddr.o src/inet.o src/child.o src/parser.o src/log.o src/lastlog.o src/xferlog.o src/bindings.o src/netacl.o src/class.o src/scoreboard.o src/help.o src/feat.o src/netio.o src/response.o src/data.o src/modules.o src/display.o src/auth.o src/fsio.o src/mkhome.o src/ctrls.o src/event.o src/var.o src/throttle.o src/trace.o src/encode.o src/proctitle.o src/pidfile.o src/env.o src/version.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_delay.o modules/mod_facts.o modules/mod_ident.o modules/mod_cap.o modules/mod_auth_pam.o modules/mod_tls.o modules/mod_sftp.o modules/module_glue.o -lssl -lcrypto -lssl -lcrypto -lcap -lssl -lcrypto -lpam -lsupp -lcrypt
mkdir .libs
gcc -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/str.o src/table.o src/regexp.o src/dirtree.o src/expr.o src/support.o src/netaddr.o src/inet.o src/child.o src/parser.o src/log.o src/lastlog.o src/xferlog.o src/bindings.o src/netacl.o src/class.o src/scoreboard.o src/help.o src/feat.o src/netio.o src/response.o src/data.o src/modules.o src/display.o src/auth.o src/fsio.o src/mkhome.o src/ctrls.o src/event.o src/var.o src/throttle.o src/trace.o src/encode.o src/proctitle.o src/pidfile.o src/env.o src/version.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_delay.o modules/mod_facts.o modules/mod_ident.o modules/mod_cap.o modules/mod_auth_pam.o modules/mod_tls.o modules/mod_sftp.o modules/module_glue.o -L/tmp/proftpd_sftp/proftpd-1.3.2/lib -lcap -lssl -lcrypto -lpam -lsupp -lcrypt
modules/mod_sftp.o(.text+0xb2): In function `sftp_get_client_version':
: undefined reference to `sftp_interop_handle_version'
modules/mod_sftp.o(.text+0x18f): In function `sftp_cmd_loop':
: undefined reference to `sftp_kex_send_first_kexinit'
modules/mod_sftp.o(.text+0x1be): In function `sftp_cmd_loop':
: undefined reference to `sftp_kex_init'
modules/mod_sftp.o(.text+0x1c3): In function `sftp_cmd_loop':
: undefined reference to `sftp_service_init'
modules/mod_sftp.o(.text+0x1c8): In function `sftp_cmd_loop':
: undefined reference to `sftp_auth_init'
modules/mod_sftp.o(.text+0x1cd): In function `sftp_cmd_loop':
: undefined reference to `sftp_channel_init'
modules/mod_sftp.o(.text+0x1d9): In function `sftp_cmd_loop':
: undefined reference to `sftp_ssh2_packet_set_poll_timeout'
modules/mod_sftp.o(.text+0x252): In function `sftp_cmd_loop':
: undefined reference to `sftp_ssh2_packet_handle'
modules/mod_sftp.o(.text+0x418): In function `set_sftpauthmeths':
: undefined reference to `sftp_kbdint_have_drivers'
modules/mod_sftp.o(.text+0x559): In function `set_sftpauthorizedkeys':
: undefined reference to `sftp_keystore_supports_store'
modules/mod_sftp.o(.text+0x6f4): In function `set_sftpciphers':
: undefined reference to `sftp_crypto_get_cipher'
modules/mod_sftp.o(.text+0x1458): In function `set_sftpdigests':
: undefined reference to `sftp_crypto_get_digest'
modules/mod_sftp.o(.text+0x226a): In function `set_sftptrafficpolicy':
: undefined reference to `sftp_tap_have_policy'
modules/mod_sftp.o(.text+0x22bf): In function `sftp_exit_ev':
: undefined reference to `sftp_keys_free'
modules/mod_sftp.o(.text+0x22da): In function `sftp_exit_ev':
: undefined reference to `sftp_crypto_free'
modules/mod_sftp.o(.text+0x2317): In function `sftp_mod_unload_ev':
: undefined reference to `sftp_utf8_free'
modules/mod_sftp.o(.text+0x2323): In function `sftp_mod_unload_ev':
: undefined reference to `sftp_crypto_free'
modules/mod_sftp.o(.text+0x237d): In function `sftp_postparse_ev':
: undefined reference to `sftp_keys_set_passphrase_provider'
modules/mod_sftp.o(.text+0x23d0): In function `sftp_init':
: undefined reference to `sftp_interop_init'
modules/mod_sftp.o(.text+0x23dc): In function `sftp_init':
: undefined reference to `sftp_keystore_init'
modules/mod_sftp.o(.text+0x260d): In function `sftp_sess_init':
: undefined reference to `sftp_crypto_set_driver'
modules/mod_sftp.o(.text+0x266a): In function `sftp_sess_init':
: undefined reference to `sftp_keys_get_hostkey'
modules/mod_sftp.o(.text+0x269a): In function `sftp_sess_init':
: undefined reference to `sftp_keys_have_hostkeys'
modules/mod_sftp.o(.text+0x26e9): In function `sftp_sess_init':
: undefined reference to `sftp_blacklist_set_file'
modules/mod_sftp.o(.text+0x271b): In function `sftp_sess_init':
: undefined reference to `sftp_channel_set_max_count'
modules/mod_sftp.o(.text+0x2784): In function `sftp_sess_init':
: undefined reference to `sftp_fxp_use_gmt'
modules/mod_sftp.o(.text+0x2789): In function `sftp_sess_init':
: undefined reference to `sftp_utf8_init'
modules/mod_sftp.o(.text+0x27f1): In function `sftp_sess_init':
: undefined reference to `sftp_kex_rekey_set_interval'
modules/mod_sftp.o(.text+0x27fe): In function `sftp_sess_init':
: undefined reference to `sftp_ssh2_packet_rekey_set_size'
modules/mod_sftp.o(.text+0x2834): In function `sftp_sess_init':
: undefined reference to `sftp_tap_set_policy'
modules/mod_sftp.o(.text+0x2883): In function `sftp_sess_init':
: undefined reference to `sftp_kex_rekey_set_timeout'
modules/mod_sftp.o(.text+0x2895): In function `sftp_sess_init':
: undefined reference to `sftp_kex_rekey_set_interval'
modules/mod_sftp.o(.text+0x28a1): In function `sftp_sess_init':
: undefined reference to `sftp_kex_rekey_set_timeout'
modules/mod_sftp.o(.text+0x28ad): In function `sftp_sess_init':
: undefined reference to `sftp_ssh2_packet_rekey_set_seqno'
modules/mod_sftp.o(.text+0x28b8): In function `sftp_sess_init':
: undefined reference to `sftp_ssh2_packet_rekey_set_size'
modules/mod_sftp.o(.text+0x28db): In function `sftp_sess_init':
: undefined reference to `sftp_kex_rekey_set_interval'
modules/mod_sftp.o(.text+0x28e9): In function `sftp_sess_init':
: undefined reference to `sftp_ssh2_packet_rekey_set_size'
modules/mod_sftp.o(.text+0x22e3): In function `sftp_exit_ev':
: undefined reference to `sftp_utf8_free'
modules/mod_sftp.o(.text+0x2386): In function `sftp_postparse_ev':
: undefined reference to `sftp_keys_get_passphrases'
collect2: ld returned 1 exit status
make: *** [proftpd] Error 1


6) The make failed because it does not find some libraries:

To solve this problem, we launch the last command run by the make but instead of
putting modules/mod_sftp.o we are going to put modules/mod_sftp/*.o

gcc -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/str.o src/table.o src/regexp.o src/dirtree.o src/expr.o src/support.o src/netaddr.o src/inet.o src/child.o src/parser.o src/log.o src/lastlog.o src/xferlog.o src/bindings.o src/netacl.o src/class.o src/scoreboard.o src/help.o src/feat.o src/netio.o src/response.o src/data.o src/modules.o src/display.o src/auth.o src/fsio.o src/mkhome.o src/ctrls.o src/event.o src/var.o src/throttle.o src/trace.o src/encode.o src/proctitle.o src/pidfile.o src/env.o src/version.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_delay.o modules/mod_facts.o modules/mod_ident.o modules/mod_cap.o modules/mod_auth_pam.o modules/mod_tls.o modules/mod_sftp/*.o modules/module_glue.o -L/tmp/proftpd_sftp/proftpd-1.3.2/lib -lcap -lssl -lcrypto -lpam -lsupp -lcrypt

7) We now get an error message regarding mktemp but as explained on www.castaglia.org, this is just a warning and can be ignored.

gcc -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/str.o src/table.o src/regexp.o src/dirtree.o src/expr.o src/support.o src/netaddr.o src/inet.o src/child.o src/parser.o src/log.o src/lastlog.o src/xferlog.o src/bindings.o src/netacl.o src/class.o src/scoreboard.o src/help.o src/feat.o src/netio.o src/response.o src/data.o src/modules.o src/display.o src/auth.o src/fsio.o src/mkhome.o src/ctrls.o src/event.o src/var.o src/throttle.o src/trace.o src/encode.o src/proctitle.o src/pidfile.o src/env.o src/version.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_delay.o modules/mod_facts.o modules/mod_ident.o modules/mod_cap.o modules/mod_auth_pam.o modules/mod_tls.o modules/mod_sftp/*.o modules/module_glue.o -L/tmp/proftpd_sftp/proftpd-1.3.2/lib -lcap -lssl -lcrypto -lpam -lsupp -lcrypt
modules/mod_sftp/fxp.o(.text+0x2077): In function `fxp_handle_create':
: the use of `mktemp' is dangerous, better use `mkstemp'

8)

./proftpd -l
Compiled-in modules:
mod_core.c
mod_xfer.c
mod_auth_unix.c
mod_auth_file.c
mod_auth.c
mod_ls.c
mod_log.c
mod_site.c
mod_delay.c
mod_facts.c
mod_ident.c
mod_auth_pam.c
mod_sftp.c
mod_tls.c
mod_cap.c

9) You won't be able to run make install for the same reason (due to the path problem) and therefore you will have to manually copy the proftpd in /usr/local/sbin

10) You can now configure the proftpd.conf file in /usr/local/etc

[root@sv210 sbin]# more ../etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName "ProFTPD FTP "
ServerType standalone
ServerIdent off
DefaultServer on
MasqueradeAddress (enter ip adress seen from the internet or host here)
# Port 21 is the standard FTP port.
Port 21

# Disable Name resolution in order to shorten the waiting time for user
UseReverseDNS off
IdentLookups off

# Don't use IPv6 support by default.
UseIPv6 off


# Ports to be used by the server working in passive mode
PassivePorts 35700 35900

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# Set the user and group under which the server will run.
User nobody
Group nobody

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.

DefaultRoot ~



# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite on

# Bar use of SITE CHMOD by default

DenyAll


# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire section.
#
# User ftp
#Group ftp
# We want clients to be able to login with "anonymous" as well as "ftp"
#UserAlias anonymous ftp
# Limit the maximum number of anonymous logins
#MaxClients 10

TimeoutLogin 600
TimeoutIdle 14400
TimeoutNoTransfer 14400

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
# DisplayLogin welcome.msg
# DisplayChdir .message
# Limit WRITE everywhere in the anonymous chroot
#
# DenyAll
#

#




#Bind
Port 21
ServerName "FTP Server"
IdentLookups off




SFTPEngine on
SFTPLog /etc/proftpd/sftp/sftp.log

# Configure the server to listen on the normal SSH2 port, port 22
Port 22

# Configure both the RSA and DSA host keys, using the same host key
# files that OpenSSH uses.
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key

# Configure the file used for comparing authorized public keys of users.
SFTPAuthorizedUserKeys file:~/.sftp/authorized_keys

# Enable compression
SFTPCompression delayed

# Allow the same number of authentication attempts as OpenSSH.
#
# It is recommended that you explicitly configure MaxLoginAttempts
# for your SSH2/SFTP instance to be higher than the normal
# MaxLoginAttempts value for FTP, as there are more ways to authenticate
# using SSH2.
MaxLoginAttempts 6







TLSEngine on
TLSLog /var/ftpd/tls.log
TLSProtocol TLSv1


# Are clients required to use FTP over TLS when talking to this server?
TLSRequired on

# Server's certificate
TLSRSACertificateFile /usr/local/certs/server.cert.pem
TLSRSACertificateKeyFile /usr/local/certs/server.key.pem

# CA the server trusts
TLSCACertificateFile /usr/local/certs/ca.cert.pem

# Authenticate clients that want to use FTP over TLS?
TLSVerifyClient off
TLSOptions NoCertRequest

martes, 8 de julio de 2008

Error with rcp and name resolution on HP-UX 11.23

If you try to use rcp, telnet or other network client on HPUX 11.23, you might encounter a problem with name resolution based on files instead of DNS.

To solve that, you will need to add up a line to your /etc/nsswitch.conf as it may not be present by default.

ipnodes: files [NOTFOUND=continue] dns

Source: http://docs.hp.com/hpux/pdf/5187-4159.pdf


lunes, 7 de julio de 2008

How to compile install and configure Apache with HTTPS and PUT module and PHP

This document was created using the following sources:

http://www.securityfocus.com/infocus/1818

http://dan.drydog.com/apache2php.html

1) Download latest source file from www.apache.org (apache 2.0 not 1.3)

requirements: In order for you apache to work ok, you’ll need to have the ssl binaries and libraries installed first.

2) Launch the installation (It will be installed in /usr/local/apache2 as defined by --prefix option)

./configure --prefix=/usr/local/apache2 --with-mpm=prefork --enable-ssl --disable-charset-lite --disable-include --disable-env --enable-setenvif --disable-status --disable-asis --enable-cgi --disable-negotiation --disable-userdir --enable-so --enable-dav


make

make install (this will copy the compiled httpd and it’s library + conf file to /usr/local/apache2 subfolders)

· --enable-dav option was set in order to be able to use the PUT option

· --enable-ssl for ssl (https) to work

· --enable-so in order to be able to load dynamic module (LoadModule)

· Option --disable-autoindex was not set as we don’t want it disabled

To see what was installed, you can run httpd –l

[root@server bin]# ./httpd -l

Compiled in modules:

core.c

.

.

[root@server bin]# ./httpd -v

Server version: Apache/2.2.9 (Unix)

Server built: Jul 1 2008 23:21:43



1) Generate ssl certificate

openssl req -new -x509 -days 30 -keyout /usr/local/apache2/conf/ssl.key/server.key -out /usr/local/apache2/conf/ssl.crt/server.crt -subj '/CN=mail999.altadis.com


You will be prompted for a password, choose one that's good for you

(For your information, this certificate is not trusted by an certificate authority such as verisign, therefore whenever you connect from a webbrowser, you will need to accept the "warning" message about the non trustable certificate.


4) Configure httpd.conf

# =================================================

#

# =================================================

# Basic settings

# =================================================

User apache

Group apache

ServerAdmin webmaster@server

ServerName server

#AllowOverride AuthConfig

UseCanonicalName Off

ServerSignature Off

HostnameLookups Off

ServerTokens Prod

ServerRoot "/usr/local/apache2"

DocumentRoot "/www"

PidFile /usr/local/apache2/logs/httpd.pid

ScoreBoardFile /usr/local/apache2/logs/httpd.scoreboard

#

# DirectoryIndex index.html

#

# =================================================

# HTTP and performance settings

# =================================================

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 30

DavLockDB /tmp/DavLock

MinSpareServers 5

MaxSpareServers 10

StartServers 5

MaxClients 150

MaxRequestsPerChild 0

# =================================================

# Access control

# =================================================

Options None

AllowOverride None

Order deny,allow

Deny from all

Order allow,deny

Allow from all

AllowOverride AuthConfig

Alias /user1 "/user1"

Dav On

order allow,deny

allow from all

Options Indexes FollowSymLinks MultiViews

AllowOverride AuthConfig

Order allow,deny

Allow from all

AuthType Basic

AuthName "Restricted Files"

AuthUserFile /usr/local/apache2/passw

Require user user1


# =================================================

# MIME encoding

# =================================================

TypesConfig /usr/local/apache2/conf/mime.types

DefaultType text/plain

AddEncoding x-compress .Z

AddEncoding x-gzip .gz .tgz

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddType application/x-tar .tgz

AddType application/x-x509-ca-cert .crt

AddType application/x-pkcs7-crl .crl

# =================================================

# Logs

# =================================================

LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

LogFormat "%h %l %u %t \"%r\" %>s %b" common

LogFormat "%{Referer}i -> %U" referer

LogFormat "%{User-agent}i" agent

ErrorLog /usr/local/apache2/logs/error_log

CustomLog /usr/local/apache2/logs/access_log combined

#CustomLog logs/ssl_request_log

#"%t %h %{HTTPS}x %{SSL_PROTOCOL}x %{SSL_CIPHER}x \

#%{SSL_CIPHER_USEKEYSIZE}x %{SSL_CLIENT_VERIFY}x \"%r\" %b"

# =================================================

# SSL/TLS settings

# =================================================

Listen 0.0.0.0:443

SSLEngine on

SSLOptions +StrictRequire

SSLRequireSSL

SSLProtocol -all +TLSv1 +SSLv3

SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM

SSLMutex file:/usr/local/apache2/logs/ssl_mutex

SSLRandomSeed startup file:/dev/urandom 1024

SSLRandomSeed connect file:/dev/urandom 1024

SSLSessionCache shm:/usr/local/apache2/logs/ssl_cache_shm

SSLSessionCacheTimeout 600

SSLPassPhraseDialog builtin

SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt

SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key

SSLVerifyClient none

SSLProxyEngine off

AddType application/x-x509-ca-cert .crt

AddType application/x-pkcs7-crl .crl



IMPORTANT:
In order to use the put option, we have compiled apache with the dav module.

We now need to load when apache starts. This is done with the parameter:

Dav On

You will then define the PUT option


order allow,deny

allow from all



Be carefull with this option, always specify a specific user to be allowed to PUT as it can be a security breach.


5)


Create the password file for .htaccess access

htpasswd -c /usr/local/apache2/passw user1 (same for each user)


chown apache:apache /usr/local/apache2/passw



6) Add us info to httpd.conf for each Alias

AuthType Basic

AuthName "Restricted Files"

AuthUserFile /usr/local/apache2/passw

Require user user1




7) PHP Configuration

· Download libxml….2.16 or higher and compile it (this is required to compile PHP)

./configure ; make ; make install

· Download php5 from www.php.net

./configure --with-apxs2=/usr/local/apache2/bin/apxs --prefix=/usr/local/apache2/php --with-config-file-path=/usr/local/apache2/php -enable-force-cgi-redirect --disable-cgi --with-gettext -with-gdbm

Build complete.

Don't forget to run 'make test'.

[root@server php-5.2.6]# make install

Installing PHP SAPI module: apache2handler

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = "ISO8859-1",

LANG = "ISO8859-1"

are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules

/usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/

cp .libs/libphp5.so /usr/local/apache2/modules/libphp5.so

cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la

libtool: install: warning: remember to run `libtool --finish /products/phpinst/php-5.2.6/libs'

chmod 755 /usr/local/apache2/modules/libphp5.so

[activating module `php5' in /usr/local/apache2/conf/httpd.conf]

Installing PHP CLI binary: /usr/local/apache2/php/bin/

Installing PHP CLI man page: /usr/local/apache2/php/man/man1/

Installing build environment: /usr/local/apache2/php/lib/php/build/

Installing header files: /usr/local/apache2/php/include/php/

Installing helper programs: /usr/local/apache2/php/bin/

program: phpize

program: php-config

Installing man pages: /usr/local/apache2/php/man/man1/

page: phpize.1

page: php-config.1

Installing PEAR environment: /usr/local/apache2/php/lib/php/

[PEAR] Console_Getopt - installed: 1.2.3

[PEAR] Archive_Tar - installed: 1.3.2

[PEAR] Structures_Graph- installed: 1.0.2

pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)

[PEAR] PEAR - installed: 1.7.1

Wrote PEAR system config file at: /usr/local/apache2/php/etc/pear.conf

You may want to add: /usr/local/apache2/php/lib/php to your php.ini include_path


[root@server php-5.2.6]# make install

Installing PHP SAPI module: apache2handler

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = "ISO8859-1",

LANG = "ISO8859-1"

are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules

/usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/

cp .libs/libphp5.so /usr/local/apache2/modules/libphp5.so

cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la

libtool: install: warning: remember to run `libtool --finish /products/phpinst/php-5.2.6/libs'

chmod 755 /usr/local/apache2/modules/libphp5.so

[activating module `php5' in /usr/local/apache2/conf/httpd.conf]

Installing PHP CLI binary: /usr/local/apache2/php/bin/

Installing PHP CLI man page: /usr/local/apache2/php/man/man1/

Installing build environment: /usr/local/apache2/php/lib/php/build/

Installing header files: /usr/local/apache2/php/include/php/

Installing helper programs: /usr/local/apache2/php/bin/

program: phpize

program: php-config

Installing man pages: /usr/local/apache2/php/man/man1/

page: phpize.1

page: php-config.1

Installing PEAR environment: /usr/local/apache2/php/lib/php/

[PEAR] Console_Getopt - already installed: 1.2.3

[PEAR] Archive_Tar - already installed: 1.3.2

[PEAR] Structures_Graph- already installed: 1.0.2

[PEAR] PEAR - already installed: 1.7.1

Wrote PEAR system config file at: /usr/local/apache2/php/etc/pear.conf

You may want to add: /usr/local/apache2/php/lib/php to your php.ini include_path

Installing PDO headers: /usr/local/apache2/php/include/php/ext/pdo/

[root@server php-5.2.6]# libtool --finish /products/phpinst/php-5.2.6/libs

PATH="$PATH:/sbin" ldconfig -n /products/phpinst/php-5.2.6/libs

----------------------------------------------------------------------

Libraries have been installed in:

/products/phpinst/php-5.2.6/libs

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR'

flag during linking and do at least one of the following:

- add LIBDIR to the `LD_LIBRARY_PATH' environment variable

during execution

- add LIBDIR to the `LD_RUN_PATH' environment variable

during linking

- use the `-Wl,--rpath -Wl,LIBDIR' linker flag

- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------