lighttpd配置虚拟主机/php等WEB环境
lighttpd(1.4.37)配置如下
server.document-root = "/var/www/lighttpd/" server.port = 8888
server.username = "nobody"
server.groupname = "nobody" server.max-worker = 2
server.max-keep-alive-requests =4000 server.errorlog = "/tmp/lighttpd.error.log"
accesslog.filename = "/tmp/lighttpd.access.log" server.modules = (
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_proxy",
"mod_redirect",
"mod_compress",
"mod_rewrite",
"mod_expire"
) var.document_root = "/usr/local/openresty/nginx/html/" mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png",
".js" => "application/x-javascript",
".css" => "text/css"
) static-file.exclude-extensions=(".fcgi", ".php", ".rb")
index-file.names = ("index.html") dir-listing.activate = "disable" $HTTP["host"] == "www.anotherweb.com" {
server.document-root = document_root + "ci/"
$HTTP["url"] =~ "^/download/" {
dir-listing.activate = "enable"
}
url.rewrite-once = (
"/(.*)\.(.*)" => "$0",
"/(css|files|img|js|stats)/" => "$0",
"^/([^.]+)$" => "/index.php/$1"
)
fastcgi.server = (
".php" =>
((
"host" => "127.0.0.1",
"port" => 9000,
#"check-local" => "disable",
#"broken-scriptfilename" => "enable"
))
)
} else $HTTP["host"] =~ "(.*\.|)mywebsite.com" {
#server.document-root = "/usr/local/openresty/nginx/html/" $HTTP["referer"] !~ "^($|http://.*\.mywebsite.com)" {
$HTTP["url"] =~ "/images" {
#url.access-deny = ("")
url.redirect = (".*" => "http://www.mywebsite.com/")
}
}
proxy.balance = "round-robin"
proxy.server = (
"/" => ((
"host" => "127.0.0.1",
"port" => 8081
))
)
} else $HTTP["host"] =~ "" {
alias.url = ( "/download/" => "/tmp/download/")
index-file.names = ( "index.html", "index.php" ) compress.allowed-encodings = ("gzip", "deflate")
compress.cache-dir = "/tmp/cache/lighttpd/compress/"
compress.filetype = ( "application/x-javascript", "text/css", "text/html", "text/plain" ) $HTTP["url"] =~ "\.(png)" {
expire.url = ( "" => "access 1 hours")
#expire.url = ( "" => "access 30 days")
#expire.url = ( "" => "access 5 minutes")
#expire.url = ( "" => "access 30 months")
#expire.url = ( "" => "access 1 years")
}
}
nginx(openresty/1.7.2.1)配置如下
#user nobody;
worker_processes 2; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid;
#
events {
worker_connections 1024;
} http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log main; sendfile on; keepalive_timeout 65; server {
listen 8080;
server_name anotherweb.com www.anotherweb.com; gzip on;
gzip_comp_level 4;
gzip_types text/css text/javascript application/javascript application/octet-stream; #access_log logs/host.access.log main; error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} location / {
root html/ci;
index index.html;
try_files $uri $uri/ /index.php/$query_string;
} location ~ \.php($|/) {
root html/ci;
client_max_body_size 10m; fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
} server {
listen 8080;
server_name www.mywebsite.com image.mywebsite.com mywebsite.com;
default_type text/html; location / {
proxy_pass http://127.0.0.1:8081;
} location /images {
valid_referers none blocked www.mywebsite.com mywebsite.com;
if ($invalid_referer) {
return 403;
}
proxy_pass http://127.0.0.1:8081/images;
}
}
}
lighttpd配置虚拟主机/php等WEB环境的更多相关文章
- Tomcat 配置WEB虚拟映射 及 配置虚拟主机
Tomcat 配置WEB虚拟映射 及 配置虚拟主机 配置WEB虚拟映射文件夹有三种方法例如以下: 第一(要重新启动server的): 打开路径 Tomcat 6.0\conf 下的 server.x ...
- linux环境下配置虚拟主机域名
linux环境下面配置虚拟主机域名 第一步:在root目录下面(即根目录)ls(查看文件)cd进入etc目录find hosts文件vi hosts 打开hosts文件并进行编辑在打开的文件最下面添加 ...
- javaweb学习总结十七(web应用组织结构、web.xml作用以及配置虚拟主机搭建网站)
一:web应用组织结构 1:web应用组成结构 2:安装web组成机构手动创建一个web应用程序目录 a:在webapps下创建目录web b:在web目录下创建html.jsp.css.js.WEB ...
- [javaEE] web应用的目录结构&配置虚拟主机
myWebSite | |-- 静态资源和JSP文件都可以直接放在web应用目录下,浏览器可以直接访问 |-- WEB-INF 浏览器没有办法直接访问 |-- classes 动态web运行时的cla ...
- windows环境利用apache 配置虚拟主机
windows环境利用apache 配置虚拟主机 1.改动http.host #LoadModule vhost_alias_module modules/mod_vhost_alias.so #In ...
- 使用WampServer环境,如何配置虚拟主机域名
很多人不会配置虚拟主机,我这里简单交一下大家,分三步: 1.在 C:\Windows\System32\drivers\etc 文件夹中的文件 Hosts 文件修改代码为: 127.0.0.1 loc ...
- PHP 使用WampServer环境,如何配置虚拟主机域名
很多人不会配置虚拟主机,我这里简单交一下大家,分三步: 1.在 C:\Windows\System32\drivers\etc 文件夹中的文件 Hosts 文件修改代码为: 127.0.0.1 loc ...
- Wampserver2.5配置虚拟主机出现403 Forbidden的处理方案
WampServer是一款由法国人开发的Apache Web服务器.PHP解释器以 及MySQL数据库的整合软件包.免去了开发人员将时间花费在繁琐的配置环境过程,从而腾出更多精力去做开发.在windo ...
- Nginx安装及配置虚拟主机
nginx安装部分 依赖环境 yum -y install gcc zlib openssl-devel zlib-devel 1. 下载好下面两个包:nginx-1.8.1.tar.gz pcre- ...
随机推荐
- ffmpeg在Win7 VS2010中debug通过,release出错的问题解决方法
我所用的系统环境是Win7 32位操作系统+VS2010编译环境.所以在debug模式下调通之后,在Release模式下调试不通过,最后通过上网查资料和自己对比两个编译选项得出以下结论: 修改“项目- ...
- 《UNIX网络编程》UDP客户端服务器:消息回显
udp写的程序相比tcp简单一些,在socket()与bind()之后,不需要connect(),accept()等步骤,直接简化为了sendto()与recvfrom(). 编译运行同前面的tcp. ...
- CSS自学笔记(16):CSS3 用户界面
CSS3中,也新增了一些关于用户界面的属性,这些属性可以重设元素或者盒子的尺寸.轮廓等等. 新增的部分属性的浏览器支持情况 属性 浏览器支持 resize IE Firefox Chrome Safa ...
- 没有产品,没有用户的,绝对不要浪费时间去联系风投——没有过home run的创业人,想办法先做出产品,找到少量用户,没有任何销售成本
著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.作者:Kuan Huang链接:http://www.zhihu.com/question/19641135/answer/1353 ...
- 关于css中使用ul li的一些体会
参考网址:http://hi.baidu.com/july_leo/item/5237cd612070ae2668105b40 如何修改ul li的显示 ----------------------- ...
- iOS中如何呼出另一个应用
我们经常会遇到在一个应用里面呼出另一个应用的需求,比如在文档里面点击地址,调用safari来打开网页:比如在文件浏览器里面点击某种文件,自动激活一个应用来打开文件. iOS里面对于这样的需求使用URL ...
- 修改TOMCAT服务器图标为应用LOGO
在tomcat下部署应用程序,运行后,发现在地址栏中会显示tomcat的小猫咪图标.有时候,我们自己不想显示这个图标,想换成自己定义的的图标,那么按如下方法操作即可: 参考网上的解决方案:1.将$TO ...
- 学习wxpython的网站
http://xoomer.virgilio.it/infinity77/Phoenix/main.html https://wxpython.org/Phoenix/docs/html/main.h ...
- H264源码分析(四)
sub_mb_pred( mb_type ) { for( mbPartIdx = 0; mbPartIdx < 4; mbPartIdx++ ) ...
- python单/双下划线使用
在Python编程中经常会遇到函数(function),方法(method)及属性(attribute)以下划线'_'作为前缀,这里做个总结. 主要存在四种情形: 1. object # public ...