[root@localhost conf]# rpm -ql httpd|grep bin
/usr/sbin/httpd.event
/usr/sbin/httpd.worker
如果想使用某一个模型只需要更改另外一个配置文件即可:
[root@localhost conf]# cat /etc/sysconfig/httpd #全局的配置文件
# Configuration file for the httpd service.
#
# The default processing model (MPM) is the process-based
# 'prefork' model. A thread-based model, 'worker', is also
# available, but does not work with some modules (such as PHP).
# The service must be stopped before changing this variable.
#
#HTTPD=/usr/sbin/httpd.worker
#Listen 12.34.56.78:80
Listen 80#说明监听当前主机上的所有80端口。listen指令可以出现多次。
LoadModules#指定apache要装载的模块;
Include conf.d/*.conf
User apache #开启服务器所用的用户
Group apache #开启服务所用的组名
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks #定义索引文件,将该目录下的所有内容都看到,默认是开放的,需要禁用。但是
当我们做下载的时候不需要禁用。Indexes 允许索引目录的。Options后面加none表示所有都不支持。
FollowSymLinks是否支持链接文件。这里的是允许使用符号链接。
Options有五个默认没有任何功能;
Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
None: 不支持任何选项
Indexes: 允许索引目录
FollowSynLinks: 允许访问符号链接指向的原文件
Includes: 允许执行服务端包含(SSI)SEVER SIDE INCLUDE #这个也不安全,除非特殊需要
SymLinksifOwnerMatch:允许执行符号链接,同时制定属主跟httpd进程一直;
ExecCGI: 允许运行CGI脚本;是否允许CGI脚本。有的时候需要打开这个功能;
MultiViews:多视图的一种机制;
All: 支持所有选项;
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None #是否允许覆盖
AllowOverride Authconfig #
#
# Controls who can get stuff from this server.
#
# Order allow,deny#用于定义IP或基于主机的访问控制功能的。定义列表,先allow,后deny。deny是默认值。allow和deny的次序很关键。
# Allow from all #仅允许172.16.100.0访问;
#拒绝:192.168.0.1访问;
Order deny,allow
deny from 192.168.0.1 172.16.100.1
下面模拟100.8做CA;
cd /etc/pki
ls
cd CA/
(umask 077;openssl genrsa -out private/cakey.pem 2048) #生成一个私有钥匙对
ls -l private/
openssl req -new -x509 -key private//cakey.pem -out cacert.pem -days 3655
生成一个自签证书,发给自己。
[root@localhost CA]# mkdir certs crl newcerts
[root@localhost CA]# touch index.txt
[root@localhost CA]# echo 01 >serial
more /etc/pki/tls/openssl.cnf
# the resulting certificates are compatible with Netscape
string_mask = MASK:0x2002
# req_extensions = v3_req # The extensions to add to a cer
tificate request
[ req_distinguished_name ]
countryName = Country Name (2 letter c
ode)
countryName_default = CN
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (
full name)
stateOrProvinceName_default = Henan
localityName = Locality Name (eg, city)
localityName_default = Zhengzhou
0.organizationName = Organization Name (eg, c
ompany)
0.organizationName_default = zl
# we can do this but it is not needed normally :-)
#1.organizationName = Second Organization Name
(eg, company)
#1.organizationName_default = World Wide Web Pty Ltd
organizationalUnitName = Organizational Unit Name
(eg, section)
organizationalUnitName_default =Tech
# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
#ServerName www.example.com:443
ServerName www.zledu.com
SSLCertificateFile /etc/httpd/ssl/httpd.crt
SSLCertificateKeyFile /etc/httpd/ssl/httpd.key
将如下目录下的证书给windows进行传输一份,并改名字叫.crt结尾即可。直接安装即可。受信任的证书颁发。
[root@localhost CA]# pwd
/etc/pki/CA
[root@localhost CA]# ls
cacert.pem