apache虚拟主机配置一例

apache虚拟主机配置一例

代码如下:fivetrees extra # cat httpd-vhosts.conf_bak## Virtual Hosts## If you want to maintain multiple domains/hostnames on your# machine you can setup VirtualHost containers for them. Most configurations# use only name-based virtual hosts so the server doesn't need to worry about# IP addresses. This is indicated by the asterisks in the directives below.## Please see the documentation at# <URL:http://httpd.apache.org/docs/2.2/vhosts/># for further details before you try to setup virtual hosts.## You may use the command line option '-S' to verify your virtual host# configuration.## Use name-based virtual hosting.#NameVirtualHost *:80#NameVirtualHost *:443## VirtualHost example:# Almost any Apache directive may go into a VirtualHost container.# The first VirtualHost section is used for all requests that do not# match a ServerName or ServerAlias in any <VirtualHost> block.##<VirtualHost 192.168.1.66>#        RewriteEngine On#        RewriteMap      lowercase       int:tolower#        RewriteMap      vhost   txt:/usr/local/apache/conf/host.txt#        RewriteCond     %{HTTP_HOST}    !^$#        RewriteCond     ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)$#        RewriteRule     ^/(.*...)$ ${vhost:%1...}/$1#</VirtualHost><VirtualHost *:80>        DocumentRoot /opt/all_dir        ServerName *</VirtualHost><VirtualHost *:80>        DocumentRoot /opt/1        ServerName 1.com</VirtualHost><VirtualHost *:80>        DocumentRoot /opt/2        ServerName 2.com</VirtualHost>
Linux VPN pptpd构架方法

Linux VPN pptpd构架方法

按步骤:运行环境Centeros 6*首先运行如下命令:cat /dev/net/tun
返回的必须是: cat: /dev/net/tun: File descriptor in bad state 运行: cat /dev/ppp 返回的必须是: cat: /dev/ppp: No such device or address
Linux下编译安装python3步骤

Linux下编译安装python3步骤

Linux下默认系统自带python2.6的版本,这个版本被系统很多程序所依赖,所以不建议删除,如果使用最新的Python3那么我们知道编译安装源码包和系统默认包之间是没有任何影响的,所以可以安装python3和python2共存
nginx配置教程之add_header的坑详解

nginx配置教程之add_header的坑详解

前言 add_header 是 headers 模块中定义的一个指令,顾名思义就是用来添加 http 响应头的。但请注意他只是「添加」而已,并不是重写。所以如果已经存在某个头,再使用 add_header 就会出问题。而且在低版本的 nginx 中 add_header 还不支持在错误页面中使用。
nginx设置上传目录无执行权限的方法

nginx设置上传目录无执行权限的方法

nginx上也很简单,我们使用location。。如下: 代码如下: location ~ ^/upload/.*.(php|php5)$ { deny all; } 其中upload换为你要设置的目录名字 这条规则的含义是匹配请求连接中开头是/upload/,中间匹配任意字符,结尾匹配.php或者.php5的页面,最后利用deny all禁止访问,这样就防止了上传目录的脚本执行权限