varnish简明教程
2009-05-13 12:04:46来源:未知 阅读 ()
操作步骤
cd
useradd -d /dev/null -s /sbin/nologin
[url=javascript:;]varnish[/url]
wget
http://nchc.dl.sourceforge.net/sourceforge/varnish/varnish-1.1.1.tar.gz
tar zxvf varnish-1.1.1.tar.gz
cd varnish-1.1.1
./configure --prefix=/usr/local/varnish
[url=javascript:;]make[/url]
make install
cd /usr/local/varnish
mkdir var
mkdir logs
mkdir etc
mkdir cache
touch /usr/local/varnish/etc/cache.vcl
touch /usr/local/varnish/stopv
touch /usr/local/varnish/startv
touch /usr/local/varnish/resetv
chmod +x /usr/local/varnish/stopv
chmod +x /usr/local/varnish/startv
chmod +x /usr/local/varnish/resetv
cd ..
chown -R varnish varnish
chgrp -R varnish varnish
逐步说明
增加一个varnish帐户
useradd -d /dev/null -s /sbin/nologin varnish
下载varnish
wget
http://nchc.dl.sourceforge.net/sourceforge/varnish/varnish-1.1.1.tar.gz
解压
tar zxvf varnish-1.1.1.tar.gz
cd varnish-1.1.1
配置
./configure --prefix=/usr/local/varnish
编译
make
[url=javascript:;]安装[/url]
make install
设置相关目录
cd /usr/local/varnish
mkdir var
mkdir logs
mkdir etc
mkdir cache
配置文件
touch /usr/local/varnish/etc/cache.vcl
touch /usr/local/varnish/stopv
touch /usr/local/varnish/startv
touch /usr/local/varnish/resetv
chmod +x /usr/local/varnish/stopv
chmod +x /usr/local/varnish/startv
chmod +x /usr/local/varnish/resetv
修改
[url=javascript:;]权限[/url]
cd ..
chown -R varnish varnish
chgrp -R varnish varnish
cache.vcl内容
backend www1 {
set backend.host = "后端真实的web IP1";
set backend.port = "http";
}
backend www2 {
set backend.host = "后端真实的web IP2";
set backend.port = "http";
}
backend www3 {
set backend.host = "后端真实的web IP2";
set backend.port = "8080";
}
#可以做多个类似的后端
acl purge {
"localhost";
"后端真实的web IP1";
"后端真实的web IP2";
}
sub vcl_recv {
if (req.http.host ~ "域名1") {
set req.backend = www1;
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- OpenBSD安装简明教程 2009-05-13
- 写了个FreeBSD7.0下平台搭建的新手教程 2009-05-13
- [转]Qmail简明配置(附安装软件及补丁) 2009-05-13
- Freebsd 从安装到web配置 简明教程 2009-05-13
- vi 教程(图片) 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash