FastCgiWrapper /usr/local/apache/bin/suexec
# URIs that begin with /fcgi-bin/, are found in /var/www/fcgi-bin/
Alias /fcgi-bin/ /var/www/fcgi-bin/
ScriptAlias /wws /var/www/fcgi-bin/b.fcgi
# Anything in here is handled as a "dynamic" server if not defined as "static" or "external"
AllowOverride None
Options +ExecCGI -Includes
#SetHandler fastcgi-script
AddHandler fastcgi-script .fcg .fcgi
Order allow,deny
Allow from all
# Anything with one of these extensions is handled as a "dynamic" server if not defined as
# "static" or "external". Note: "dynamic" servers require ExecCGI to be on in their directory.
#AddHandler fastcgi-script .fcgi .fpl
# Start a "static" server at httpd initialization inside the scope of the SetHandler
#FastCgiServer /var/www/fcgi-bin/echo -processes 3
# Start a "static" server at httpd initialization inside the scope of the AddHandler
#FastCgiServer /var/www/fcgi-bin/b.fcgi -processes 3 -user nobody -group nobody
#FastCgiServer /var/www/htdocs/some/path/echo.fcgi
# Start a "static" server at httpd initialization outside the scope of the Set/AddHandler
#FastCgiServer /var/www/htdocs/some/path/coolapp
#
# SetHandler fastcgi-script
#
mod_ssl报错,装了最新的apache 今天回来发现apache不能启动了,郁闷,报的错误是mod_ssl无法加载,我把#LoadModule ssl_module modules/mod_ssl.so加截ssl的地方注释掉就好了。以前都配置好了的,今天怎么会不行了呢?我又重新把mod_ssl编译了一下,
cd /apache的解压目录/modules/ssl
[root@BlackGhost ssl]# /usr/local/apache/bin/apxs -c -i mod_ssl.c
ssl_private.h:541:14: error: declaration for parameter ’ssl_hook_UserCheck’ but no such parameter
ssl_private.h:540:14: error: declaration for parameter ’ssl_hook_Auth’ but no such parameter
ssl_private.h:537:14: error: declaration for parameter ’ssl_init_ModuleKill’ but no such parameter
ssl_private.h:536:14: error: declaration for parameter ’ssl_init_Child’ but no such parameter
mod_ssl.c:520:1: error: expected ‘{‘ at end of input
apxs:Error: Command failed with rc=65536
上面的报错只是最下面的一部分,搞了好长时间,没搞定,决定下个新的apache重装一下,顺便把安装过程说一下
一,安装httpd-2.2.16.tar.gz
wget http://www.apache.org/dist/httpd/httpd-2.2.16.tar.gz
tar zxvf httpd-2.2.16.tar.gz
cd httpd-2.2.16
./configure –prefix=/usr/local/apache –enable-ssl –enable-so –with-ssl=/us
make && make install
1,改documentroot和,把里面的默认路径改成你的web目录。
2,加载libphp.so
我记得以前装php的时候,会自动添加好下面的东西,但是这次我只升级apache,我还没找到libphp.c文件在什么地方,没法用apxs来重新编译,还是用以前的libphp5.so吧
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
如果不加上面的东西,php代码无法解悉,会直接把源码显示出来
3,修改user和group,你看一下user后面的用户,在你的系统中有没有,如果没有的话,你启动apache后,查看页面时会forbidden错误,改成你指定的用户,当然这个用户必有在你的系统中。
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User zhangy
Group users
二,编译mod_ssl模块看看报不报错
cd /apache的解压目录/modules/ssl
/usr/local/apache/bin/apxs -c -i mod_ssl.c
make && make install
下面是安装时候显示出来的信息
Libraries have been installed in:
/usr/local/apache/modules
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.
———————————————————————-
chmod 755 /usr/local/apache/modules/mod_ssl.so
现在编译就没有报错了,我觉得肯定是因为我升级的原因,并且只是升级了一部分。安装的时候,我已经内建了mod_ssl所以就不用在加载了。如果加了的话,会提示module ssl_module is built-in and can’t be loaded
[root@BlackGhost misc]# /usr/local/apache/bin/apachectl configtest
Syntax OK
对apache2的模块如果动态编译通常可以使用 /path/apxs -c *.c来完成
但对 mod_ssl编译是会有一些问题
如:
出现
Unrecognized SSL Toolkit!
是由于 HAVE_OPENSSL这个没有define
需要增加 -DHAVE_OPENSSL
undefined symbol: ssl_cmd_SSLMutex
或
undefined symbol: X509_free
通产是由于静态连接了 openssl的库照成的(默认)。
需要使用 -lcrypto -lssl -ldl
命令如下:
/path/apxs -I/path/openssl/include -L/path/openssl/lib -c *.c -l crypto -l ssl -l dl
openssl 编译的时候需要增加 shared参数
/usr/local/apache2/bin/apxs -a -i -c -D HAVE_OPENSSL=1 -I /usr/include/openssl/ -L /usr/lib/openssl/engines/lib ./mod_ssl.c
--------------------------- Apache 编译参数的区别
1、 ./configure --prefix=/usr/local/apache
其中,下面这两个参数加不加都是一样的。
--enable-so、--enable-so=static
[root@haha bin]# ./apachectl -M
Loaded Modules:
core_module (static)
authn_file_module (static)
authn_default_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_default_module (static)
auth_basic_module (static)
include_module (static)
filter_module (static)
log_config_module (static)
env_module (static)
setenvif_module (static)
mpm_prefork_module (static)
http_module (static)
mime_module (static)
status_module (static)
autoindex_module (static)
asis_module (static)
cgi_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
userdir_module (static)
alias_module (static)
so_module (static)
Syntax OK
-----------------------------------------------------------
2、./configure --prefix=/usr/local/apache --enable-mods-shared=most(编译大部分常用模块,也可以是all,即编译所有模块。)
[root@haha apache]# bin/apachectl -M
Loaded Modules:
core_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
------------------------------------ 下面是动态加载的模块
authn_file_module (shared)
authn_dbm_module (shared)
authn_anon_module (shared)
authn_dbd_module (shared)
authn_default_module (shared)
authz_host_module (shared)
authz_groupfile_module (shared)
authz_user_module (shared)
authz_dbm_module (shared)
authz_owner_module (shared)
authz_default_module (shared)
auth_basic_module (shared)
auth_digest_module (shared)
dbd_module (shared)
dumpio_module (shared)
ext_filter_module (shared)
include_module (shared)
filter_module (shared)
substitute_module (shared)
deflate_module (shared)
log_config_module (shared)
logio_module (shared)
env_module (shared)
expires_module (shared)
headers_module (shared)
ident_module (shared)
setenvif_module (shared)
mime_module (shared)
dav_module (shared)
status_module (shared)
autoindex_module (shared)
asis_module (shared)
info_module (shared)
cgi_module (shared)
dav_fs_module (shared)
vhost_alias_module (shared)
negotiation_module (shared)
dir_module (shared)
imagemap_module (shared)
actions_module (shared)
speling_module (shared)
userdir_module (shared)
alias_module (shared)
rewrite_module (shared)