Apache服务器配置与使用工作笔记

简介: uname -m -oecho "/usr/local/apache/lib" >> /etc/ld.so.confhwclock -w #将时间写入BIOSconfig.

uname -m -oecho "/usr/local/apache/lib" >> /etc/ld.so.confhwclock -w #将时间写入BIOSconfig.layout./configure --enable-layout=xxx.layoutapachectl -k startstatusproc httpdinetd#apachectlgracefulgraceful-stopconfigteststatusfullstatus#一个配置文件中启动多个apacheListen 443

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

目录
相关文章
|
4月前
|
存储 弹性计算 算法
前端大模型应用笔记(四):如何在资源受限例如1核和1G内存的端侧或ECS上运行一个合适的向量存储库及如何优化
本文探讨了在资源受限的嵌入式设备(如1核处理器和1GB内存)上实现高效向量存储和检索的方法,旨在支持端侧大模型应用。文章分析了Annoy、HNSWLib、NMSLib、FLANN、VP-Trees和Lshbox等向量存储库的特点与适用场景,推荐Annoy作为多数情况下的首选方案,并提出了数据预处理、索引优化、查询优化等策略以提升性能。通过这些方法,即使在资源受限的环境中也能实现高效的向量检索。
102 1
|
6月前
|
Ubuntu Linux 测试技术
在Linux中,已知 apache 服务的访问日志按天记录在服务器本地目录/app/logs 下,由于磁盘空间紧张现在要求只能保留最近7天的访问日志,请问如何解决?
在Linux中,已知 apache 服务的访问日志按天记录在服务器本地目录/app/logs 下,由于磁盘空间紧张现在要求只能保留最近7天的访问日志,请问如何解决?
|
6月前
|
Ubuntu 应用服务中间件 Linux
在Linux中,如何配置Web服务器(如Apache或Nginx)?
在Linux中,如何配置Web服务器(如Apache或Nginx)?
|
6月前
|
数据库连接 Apache Java
【独家揭秘】图书管理系统的奇幻之旅:一文看透Apache Wicket如何从想法萌芽到服务器上翩翩起舞?
【8月更文挑战第31天】本文通过实战案例,详细介绍从概念到部署的Apache Wicket应用开发全流程。以在线图书管理系统为例,涵盖应用概念定义、项目创建、架构设计、首页编写、数据库交互及应用部署等关键步骤。通过Maven或Gradle引入Wicket依赖,设计包结构,并使用JPA或Hibernate处理数据持久化。最终,将应用配置并部署到Tomcat或Jetty服务器,帮助你全面掌握Wicket开发技巧。
68 0
|
6月前
|
监控 Linux 测试技术
|
6月前
|
监控 安全 网络安全
如何保护 Apache 服务器的安全
【8月更文挑战第23天】
144 0
|
6月前
|
应用服务中间件 Linux 网络安全
在Linux中,如何配置Apache或Nginx Web服务器?
在Linux中,如何配置Apache或Nginx Web服务器?
|
6月前
|
Ubuntu 关系型数据库 MySQL
在 Ubuntu 14.04 服务器上使用 Apache 安装 Drupal 的方法
在 Ubuntu 14.04 服务器上使用 Apache 安装 Drupal 的方法
54 0
|
6月前
|
存储 缓存 Ubuntu
如何在 Apache Web 服务器中安装、配置和使用模块
如何在 Apache Web 服务器中安装、配置和使用模块
113 0
|
6月前
|
关系型数据库 MySQL Linux
在 CentOS 7 服务器上安装和保护 phpMyAdmin 与 Apache 的方法
在 CentOS 7 服务器上安装和保护 phpMyAdmin 与 Apache 的方法
106 0

热门文章

最新文章

推荐镜像

更多