资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
1995 年,美国国家计算机安全协会(NCSA)的开发者创建了 NCSZ 全球 网络服务软件。Apache 源于 A patchy server 的 读音,意思是充满补丁的服务器。Apache 特点支持最新的 HTTP1.1 协议支持 PHP、CGI、Java servlets、FastCGI支持安全 socket 层集成了 perl 脚本编程语言支持 ssl 和虚拟主机实现动态共享对象,允许在运行时动态加载功能模块具有安全、有效和易于扩展等特征 安装rpm -qa |grep httpdhttpd-suexec-2.0.52-9.entsystem-config-httpd-1.3.1-1httpd-manual-2.0.52-9.enthttpd-2.0.52-9.enthttp:/192.168.1.1 看到 Red Hat Enterprise Linux Test Pageps -aux |grep httpdservice httpd start 服务器文件和目录/var/www 站点文件的目录/var/www/html web 文件/var/www/cgi-bin CGI 程序文件/var/www/manual 服务器手册/var/www/usage webalizer 程序文件/var/www/error 错误信息提示/var/www/icons 程序文件/etc/httpd/conf 服务器配置文件目录/etc/httpd/conf/httpd.conf 主配置文件 启动脚本/etc/rc.d/init.d/httpd 应用文件/usr/sbin/httpd 程序文件/usr/share/doc/httpd-2.0.52/ 服务器文档/var/log/httpd 日志文件 服务器启动/etc/rc.d/init.d/httpd statuschkconfig -list httpdchkconfig httpd onservice httpd restart/etc/rc.d/init.d/httpd restart/etc/rc.local选项vi /etc/httpd/conf/httpd.confGlobal EnvironmentServerRoot “/etc/httpd“ 服务器配置文件及日志文件的位置Timeout 120 响应时间,超时KeepAlive ON 提高性能, 允许保持连接MaxKeepAliveRequests 100 连接提出请求的数量,0 表 无限KeepAliveTimeout 15 两次请求的时间间隔StartServers 8 服务器启动时运行的进程数MinSpareServers 5 MaxSpareServers 20 空闲进程数MaxClients 256 并发连接数MaxRequestsPerChild 4000 子进程所请求的数量Listen 80 监听端口Main server configuration User apache 用户Group apache 组启动 apacheServerName new.host.name:80 主机名称,会送到对端DocumentRoot “/var/www/html“ 网页存放的根目录DirectoryIndex index.html index.html.var 默认索引文 件Virtual Hosts 虚拟主机地址ServerAdmin webmasterlinux.com.cn 管理员信箱DocumentRoot /www/linux.com.cn/html 网页的根目录ServerName www.linux.com.cn 虚拟主机名ErrorLog logs/www/linux.com.cnlerror_log 日志文 件CustomLog logs/www/linux.com.cn/access_log common 别名目录Alias /doc/ “/usr/share/doc/“Options Indexes MultiViewsAllowOverride NoneOrder allow,denyAllow from all 目录的访问控制选项 设置服务器根的访问权限Options FollowSymLinks 允许符号连接AllowOverride None 禁止访问设置根文档的访问权限Options Indexes FollowSymLinks 索引、符号连接AllowOverride None 禁止读取Order allow,deny 先允许后禁止Allow from all(10.10.1.) 全部允许规则 虚拟主机NameVirtualHost 192.168.1.253:80 ServerAdmin webmasterlinux.com.cn.DocumentRoot /var/www/linux.com.cnServerName www.linux.com.cn ErrorLog logs/linux.com.cn-error_logCustomLog logs/linux.com.cn-access_log commonServerAdmin webmastercisco.com.cnDocumentRoot /var/www/cisco.com.cnServerName www.cisco.com.cnErrorLog logs/cisco.com.cn-error_logCustomLog logs/cisco.com.cn-access_log commoninclude conf/vh.comvi /etc/httpd/conf/httpd.confab -c 50 -n 100 http:/www.linux.com.cn/index.html SSL 加密安全vi /etc/httpd/conf.d/ssl.conf LoadModule ssl_module modules/mod_ssl.soListen 443SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv 2:+EXPSSLCertificateFile /etc/httpd/conf/ssl.crt/server.crtSSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key 证书申请mkdir ca cd ca 第一步,创建 key 和 request:openssl req -new new.cert.csr第二步,从 key 中删除 passphrase(可选):openssl rsa -in privkey.pem -out new.cert.key 第三步,把 request 转换成 signed sert:openssl x509 -in new.cert.csr -out new.cert.cert - req -signkey new.cert.key -days 1825 第四步,把 cert 和 key 文件拷贝到适当的位置。cp new.cert.cert /etc/httpd/conf/ssl.crt/server.crt cp new.cert.key /etc/httpd/conf/ssl.key/server.key/usr/sbin/apachectl restartssl/usr/sbin/apachectl configtest SSL 虚拟主机SSLEngine onSSLCipherSuiteALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MED IUM:+LOW:+SSLv2:+EXPSSLCertificateFile /etc/httpd/conf/ssl.crt/server.crtSSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.keyservername www.linux.com.cnDocumentRoot “/var/www/linux.com.cn“options indexes followsymlinksallowoverride noneallow from allserveradmin webmasterlinux.com.cnservername www.cisco.com.cnDocumentRoot “/var/www/cisco.com.cn“options indexes followsymlinksallowoverride noneallow from allserveradmin webmastercisco.com.cninclude conf/sslvh.conf/usr/sbin/apachectl restartssl/usr/sbin/apachectl configtest
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号