搜尋
首頁資料庫mysql教程apache瘦身大行动---够用就好

决定为自己的apache减肥。ok现在就开始吧 系统平台:redhat7.3 软件版本:apache_1.3.28.tar.gz 安装的模块:core,access,alias,auth,dir,log_config,mime 说明 core模块就不用多说。一定是要的,不要也不行 1、虚拟目录的实现Alias mod_alias [Alias,ScriptAl

决定为自己的apache减肥。ok现在就开始吧

系统平台:redhat7.3

软件版本:apache_1.3.28.tar.gz

安装的模块:core,access,alias,auth,dir,log_config,mime

说明

core模块就不用多说。一定是要的,不要也不行

1、虚拟目录的实现Alias mod_alias [Alias,ScriptAlias]

2、基于客户端hostname,ip的访问控制 mod_access [Allow,Deny,Order]

3、基本的用户认证 mod_auth [AuthUserFile,AuthGroupFile]

4、自定义的访问日志 mod_log_config [LogFormat,CustomLog]

5、默认的主页 mod_dir [DirectoryIndex]

6、可以定义的character set, content- encoding, handler, content-language和MIME mod_mime

apache的安装。决定要安装的模块实际的安装过程是简单的

./configure --prefix=/www/apache --disable-module=all

--enable-module=alias

--enable-module=access --enable-module=auth

--enable-module=log_config

--enable-module=dir --enable-module=mime

make

make install

查看安装的模块/www/apache/bin/httpd -l

Compiled-in modules:

http_core.c

mod_log_config.c

mod_mime.c

mod_dir.c

mod_alias.c

mod_access.c

mod_auth.c

最后让我们看看安装了这些模块具体到配置文件中是怎样使用的

配置文件举例

# =================================================

# Basic settings

# =================================================

ServerType standalone

ServerRoot "/usr/local/apache"

PidFile /usr/local/apache/logs/httpd.pid

ScoreBoardFile /usr/local/apache/logs/httpd.scoreboard

ResourceConfig /dev/null

AccessConfig /dev/null

# =================================================

# Performance settings

# =================================================

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 15

MinSpareServers 5

MaxSpareServers 10

StartServers 5

MaxClients 150

MaxRequestsPerChild 0

# =================================================

# Apache's modules

# =================================================

ClearModuleList

AddModule mod_log_config.c

AddModule mod_mime.c

AddModule mod_dir.c

AddModule mod_access.c

AddModule mod_auth.c

AddModule mod_alias.c

# =================================================

# General settings

# =================================================

Port 80

User apache

Group apache

ServerAdmin Webmaster@www.abc.com

UseCanonicalName Off

ServerSignature Off

HostnameLookups Off

ServerTokens Prod



#——————————————

###mod_dir模块

#----------------------------------

DirectoryIndex index.html



DocumentRoot "/www/vhosts"

# =================================================

# Access control

#

#mod_access 模块

=================================================



Options None

AllowOverride None

Order deny,allow

Deny from all





Order allow,deny

Allow from all





Order allow,deny

Allow from all



#==========================================

#basic auth

#

#mod-auth模块

#=========================================



AuthType Basic

AuthName "基本的用户认证"

AuthUserFile /www/apache/passwd/passwords

Require user zhangshan lisi



# =================================================

# MIME encoding

#

#mod_mime模块

=================================================



TypesConfig /usr/local/apache/conf/mime.types



DefaultType text/plain



AddEncoding x-compress Z

AddEncoding x-gzip gz tgz

AddType application/x-tar .tgz



# =================================================

# Logs

#

#log_config模块

=================================================

LogLevel warn

LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined

LogFormat "%h %l %u %t "%r" %>s %b" common

LogFormat "%{Referer}i -> %U" referer

LogFormat "%{User-agent}i" agent

ErrorLog /usr/local/apache/logs/error_log

CustomLog /usr/local/apache/logs/access_log combined

# =================================================

# Virtual hosts

# =================================================

NameVirtualHost *



DocumentRoot "/www/vhosts/www.abc.com"

ServerName "www.abc.com"

ErrorLog logs/www.abc.com/error_log

CustomLog logs/www.abc.com/access_log combined

#=====================================================

#虚拟目录

#

#mod-alias模块

#=====================================================

Alias /icons/ /www/vhosts/icons/





DocumentRoot "/www/vhosts/www.chinaunix.com"

ServerName "www.chinaunix.com"

ErrorLog logs/www.chinaunix.com/error_log

CustomLog logs/www.chinaunix.com/access_log combined



配置文件中都标出了每个模块的使用方法。这里就不多说。希望喜欢“苗条”的同志赶快行动起来吧。最后不要忘了把你的瘦身方案拿出来大家分享
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
將用戶添加到MySQL:完整的教程將用戶添加到MySQL:完整的教程May 12, 2025 am 12:14 AM

掌握添加MySQL用戶的方法對於數據庫管理員和開發者至關重要,因為它確保數據庫的安全性和訪問控制。 1)使用CREATEUSER命令創建新用戶,2)通過GRANT命令分配權限,3)使用FLUSHPRIVILEGES確保權限生效,4)定期審計和清理用戶賬戶以維護性能和安全。

掌握mySQL字符串數據類型:varchar vs.文本與char掌握mySQL字符串數據類型:varchar vs.文本與charMay 12, 2025 am 12:12 AM

chosecharforfixed-lengthdata,varcharforvariable-lengthdata,andtextforlargetextfield.1)chariseffity forconsistent-lengthdatalikecodes.2)varcharsuitsvariable-lengthdatalikenames,ballancingflexibilitibility andperformance.3)

MySQL:字符串數據類型和索引:最佳實踐MySQL:字符串數據類型和索引:最佳實踐May 12, 2025 am 12:11 AM

在MySQL中處理字符串數據類型和索引的最佳實踐包括:1)選擇合適的字符串類型,如CHAR用於固定長度,VARCHAR用於可變長度,TEXT用於大文本;2)謹慎索引,避免過度索引,針對常用查詢創建索引;3)使用前綴索引和全文索引優化長字符串搜索;4)定期監控和優化索引,保持索引小巧高效。通過這些方法,可以在讀取和寫入性能之間取得平衡,提升數據庫效率。

mysql:如何遠程添加用戶mysql:如何遠程添加用戶May 12, 2025 am 12:10 AM

ToaddauserremotelytoMySQL,followthesesteps:1)ConnecttoMySQLasroot,2)Createanewuserwithremoteaccess,3)Grantnecessaryprivileges,and4)Flushprivileges.BecautiousofsecurityrisksbylimitingprivilegesandaccesstospecificIPs,ensuringstrongpasswords,andmonitori

MySQL字符串數據類型的最終指南:有效的數據存儲MySQL字符串數據類型的最終指南:有效的數據存儲May 12, 2025 am 12:05 AM

tostorestringsefliceflicyInmySql,ChooSetherightDataTypeBasedyOrneOrneEds:1)USEcharforFixed-LengthStstringStringStringSlikeCountryCodes.2)UseVarcharforvariable-lengtthslikenames.3)USETEXTCONTENT.3)

mysql blob vs.文本:為大對象選擇正確的數據類型mysql blob vs.文本:為大對象選擇正確的數據類型May 11, 2025 am 12:13 AM

選擇MySQL的BLOB和TEXT數據類型時,BLOB適合存儲二進制數據,TEXT適合存儲文本數據。 1)BLOB適用於圖片、音頻等二進制數據,2)TEXT適用於文章、評論等文本數據,選擇時需考慮數據性質和性能優化。

MySQL:我應該將root用戶用於產品嗎?MySQL:我應該將root用戶用於產品嗎?May 11, 2025 am 12:11 AM

No,youshouldnotusetherootuserinMySQLforyourproduct.Instead,createspecificuserswithlimitedprivilegestoenhancesecurityandperformance:1)Createanewuserwithastrongpassword,2)Grantonlynecessarypermissionstothisuser,3)Regularlyreviewandupdateuserpermissions

MySQL字符串數據類型說明了:選擇適合您數據的合適類型MySQL字符串數據類型說明了:選擇適合您數據的合適類型May 11, 2025 am 12:10 AM

mySqlStringDatatAtatPessHouldBechoseBasedondatActarActeristicsAndusecases:1)USEcharforFixed lengthStstringStringStringSlikeCountryCodes.2)usevarcharforvariable-lengtthslikeLikenames.3)usebarnionororvarinyorvarinyorvarybinarydatalgebenedaTalgeextocrabextrapon.4)

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

SecLists

SecLists

SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

WebStorm Mac版

WebStorm Mac版

好用的JavaScript開發工具

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )專業的PHP整合開發工具