DocumentRoot "xx"httpd -D SSL###################################httpd参数-f xx.conf-e warn-E xx.error-v-V version -t test config##################监控APACHE模块mod_statusSetHandler server-status
Order deny,allow
Deny from all
Allow from 192.168.1.2ExtendedStatus On###############################http://ip/server-status?autohttpd -M #what modules have been loaded#############安装mod_log_access模块wget http://www.gjvc.com/software/Apache/modules/mod_log_access-1.03.tar.gztar zxf mod_log_access-1.03.tar.gzcd mod_log_access-1.03#mod MakefileAPACHE_PREFIX=/usr/local/apacheAPACHE_VERSION=2.2.21make &&make install#####################################config add moduleLoadModule env_module libexec/mod_env.soClearModuleListAddModule mod_env.so#########################yum -y install mod_perlorwget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gztar zxvf mod_perl-2.0-current.tar.gz &&cd mod_perl-2.0.5perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxsmake &&make installhttpd -M | grep perl#########加速perl脚本Alias /perl/ /usr/local/apache/cgi-bin/SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order allow,deny
Allow from all########################dirctoryfileslocationDirectoryIndexInclude conf/extra/httpd-autoindex.confwebmin gui config toolredhat-config-httpd gui config toolservernameserveraliasdocumentrootifconfig eth0:0 122.222.222.222 netmask xxx upAddHandler cgi-script .cgi .pl###添加自己的CGI脚本处理程序AddHandler myfiletype .xyAction myfiletype /cgi-bin/program.cgiorSetHandler xx
Action xx /xx.cgi virtual ############################script GET /xx.cgiOptions +ExecCGIssipermanent temp seeother gonerewriteengine onRewriteRule pattern substitution flagsRewriteCondpt:继续处理F:403 G:410 L:该URL不再被重写 NC:忽略大小写 P:交给代理处理RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteLogLevel 0 #禁止重写日志RewriteEngine OnRewriteRule ^/$ /FAQ/ [R]CheckSpelling on 无视URL[R,L]#proxyOrder Deny,Allow
Deny from all
Allow from www.xxx.comAllowCONNECT NoProxyProxyBlockProxyDomainProxyPass xx !ProxyPass / http://www.xx.comProxyPassReverse URL不会被重写CacheDefaultExpire 10 secondCacheDisable /bin 不缓存CacheEnable mem/fd/disk /bin 用内存 文件 硬盘内存缓存模块LoadModule cache_module modules/mod_cache.soLoadModule mem_cache_module modules/mod_mem_cache.soCacheEnable mem /src/ww/
MCacheMaxObjectCount 100
MCacheMaxObjectSize 1
MCacheMaxStreamingBuffer 65535
MCacheMinObjectSize
MCacheRemovalAlgorithm GDSF
MCacheSize 10240LoadModule cache_module modules/mod_cache.soLoadModule disk_cache_module modules/mod_disk_cache.soCacheRoot /var
CacheEnable disk /
CacheDirLevels 5
CacheDirLength 3mod_file_cache //无法缓存CGICacheFile /src/index.htmlnmapfile /src/index.html图片和动态内容一般转发到其他服务器Proxypass /img http://img.jonsk.comProxypassreverss /img http://img.jonsk.com#禁止代理服务器转发电子邮件Rewriteengine on
Rewriterule "^proxy:[a-z]*://[^/]*:25(/|$)" "-" [F,NC,L]Proxyblock ww.xx.com#mod_dbd链接DB需要安装apr-utils24小时进行分割CustomLog "|/usr/local/apache/bin/rotatelogs log/access_log 86400" commonCustomLog "|/usr/bin/rotatelogs log/access_log_%Y%m%d 86400 480" combinedErrorLog syslog:local7webalizerawstats#不记录日志SetEnvIfNoCase Referer "xxx" no_img=1CustomLog logs/access_log combined env=!no_img${Referer}i 引用页面ab -n 1000 -c 10 http://www.baidu.comRequire valid-usermod_security 安全检查nikto 对网站进行检查chkrootkit 系统漏洞检查HostnameLookups off DNS负载均衡htpasswd -c .htpasswd jonskhtpasswd -D .htpasswd jonshtpasswd .htpasswd jonskAuthType Basic AuthName "Rest Files"AuthUserFile /xxx/apasswdorder deny,allowAllow from all--enable-ssl
Apache 作为世界使用排名第一的Web服务器软件,它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一
相信前端的小伙伴对于 apache 和 nginx 都有所了解,特别是前后端分离,独立开发部署后,使用web服务器做一些代理服务可以解决绝大多数因为前后端分离造成的跨域,认证等问题(PS:都2020年了,不会还有项目组主张使用weblogic或tomcat部署前端项目吧? 不会吧,不会吧,不会吧
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)