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

目录
相关文章
|
8天前
|
网络安全 Apache
Apache服务器安装SSL证书
Apache服务器安装SSL证书
14 0
|
2月前
|
安全 Apache
Metasploit -- 对Apache HTTP服务器守护进程中断复现
Metasploit -- 对Apache HTTP服务器守护进程中断复现
20 0
|
1月前
|
安全 Linux Apache
Apache代理服务器搭建和配置
Apache代理服务器搭建和配置
|
26天前
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
28 0
|
26天前
|
Shell Linux Apache
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
155 1
|
1月前
|
存储 网络协议 数据可视化
如何使用Synology Drive作为文件同步服务器实现云同步Obsidian笔记
如何使用Synology Drive作为文件同步服务器实现云同步Obsidian笔记
|
3月前
|
弹性计算 安全 Linux
幻兽帕鲁云服务器搭建笔记,详细记录
如何自建幻兽帕鲁服务器?基于阿里云服务器搭建幻兽帕鲁palworld服务器教程来了,一看就懂系列。本文是利用OOS中幻兽帕鲁扩展程序来一键部署幻兽帕鲁服务器,阿里云百科分享官方基于阿里云服务器快速创建幻兽帕鲁服务器教程
43 0
|
3月前
|
Java 应用服务中间件 Apache
Windows安装Apache服务器
可能你听说过Apache Tomcat, Apache与Tomcat都是Apache开源组织开发的用于处理HTTP服务的项目,两者都是免费的,都可以作为独立的Web服务器运行。Apache是Web服务器。Tomcat是Java应用服务器,是 Apache 的扩展。本文档将详细描述如何在云服务器上安装Apache环境。
46 0
|
3月前
|
弹性计算 NoSQL MongoDB
用云服务器ECS玩转Leanote个人云笔记
本教程将介绍如何搭建个人Leanote云笔记。
149304 7
|
4月前
|
存储 Java 网络安全
ZooKeeper【部署 03】apache-zookeeper-3.6.0 伪集群版(一台服务器实现三个节点的ZooKeeper集群)
ZooKeeper【部署 03】apache-zookeeper-3.6.0 伪集群版(一台服务器实现三个节点的ZooKeeper集群)
48 0

热门文章

最新文章

推荐镜像

更多