安装httpd时需要参数:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-included-apr Use bundled copies of APR/APR-Util
--with-apr=PATH prefix for installed APR or the full path to
apr-config
--with-apr-util=PATH prefix for installed APU or the full path to
apu-config
--with-pcre=PATH Use external PCRE library
--with-port=PORT Port on which to listen (default is 80)
--with-sslport=SSLPORT Port on which to securelisten (default is 443)
--with-z=DIR use a specific zlib library
--with-lua=PATH Path to the Lua 5.1 prefix
--with-serf=PREFIX Serf client library
--with-sslc=DIR RSA SSL-C SSL/TLS toolkit
--with-ssl=DIR OpenSSL SSL/TLS toolkit
--with-mpm=MPM Choose the process model for Apache to use by
default. MPM={simple|event|worker|prefork|winnt}
This will be statically linked as the only available
MPM unless --enable-mpms-shared is also specified.
--with-module=module-type:module-file
Enable module-file in the modules/
directory.
--with-program-name alternate executable name
--with-suexec-bin Path to suexec binary
--with-suexec-caller User allowed to call SuExec
--with-suexec-userdir User subdirectory
--with-suexec-docroot SuExec root directory
--with-suexec-uidmin Minimal allowed UID
--with-suexec-gidmin Minimal allowed GID
--with-suexec-logfile Set the logfile
--with-suexec-safepath Set the safepath
--with-suexec-umask umask for suexec'd process
-1.安装前电脑上要装有g++,否则安装过程会出现错误。
0.下载httpd并解压
在解压后的文件夹里面有一个srclib文件夹,下面用到的apr, apr-util,pcre应该都在里面,要用这些安装,不要从网上下,因为可能出现版本不兼容的问题。如果srclib里面没有这些软件,那么在apache官网上找到httpd***deps***的压缩包,意思就是问安装httpd所用到的信赖文件,用里面的进行安装。如果这个包再没有,那就只能从网上下了。
1、安装apache APR
./configure --prefix=/usr/local/apr
make
make test
make install
2、安装apr-util
./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/bin/apr-1-config
make
make install
3、安装pcre
./configure --prefix=/usr/local/pcre --with-apr=/usr/local/apr/bin/apr-1-config
make
make install
4、安装httpd(红色的配置是必须要配置的)
./configure --prefix=/usr/local/apache/httpd --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-pcre=/usr/local/pcre/bin/pcre-config
make
make install