惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 凌点

clr20r3 system.InvalidOperationException 程序终止的几种解决方案 能上Q 不能上网 JavaScript中url 传递参数(特殊字符) C#中使用 SendMessage 向非顶端窗体发送组合键 System.Xml.XmlException: 根级别上的数据无效 XP,WIN7双系统启动问题 VM安装XP注意事项 VC 命令行 捕获输出 make 信息重定向 VC 进度条制件CProgressCtrl 用法笔记 VC List Control控件高级使用 List Control 控件技巧总汇 VC中字符串取子串总结 如何禁用Windows屏保和电源管理 VC获取硬盘物理序列号 unicode cstring to char* - 凌点 将unicode的 Cstring 复制到粘贴板 VC由进程ID获取窗口句柄 嵌入式Linux操作系统学习规划
apache 多站点配置
凌点 · 2012-07-10 · via 博客园 - 凌点

1: 安装好AppServ2.5.9软件,官网是:[url]http://www.appservnetwork.com/[/url]
,2.59下载地址是:[url]http://nchc.dl.sourceforge.net/sourceforge/appserv
/appserv-win32-2.5.9.exe[/url] 是英文软件,但是安装时可以选择gbk-gb2312的编码(我自己用utf-8)。
2: 修改本机的hosts文件,如下:
示例:
127.0.0.1            localhost
127.0.0.1       http://www.dede.com/
127.0.0.1       http://www.phpcms.com/

3: 打开appserv的安装目录,找到httpd.conf文件,分别去掉下面两行文字前面的#号。
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
去掉#意思是启用apache的虚拟主机功能。

#Include conf/extra/httpd-vhosts.conf
去掉这一行的#意思是从conf/extra/httpd-vhosts.conf这个文件导入虚拟主机配置。

4: 打开extra目录内的httpd-vhosts.conf文件,什么都不管,直接在文件底部加入自己要加的虚拟主机的信息。如下面所示。
分别是给出一个管理员邮箱、指出此网站的根目录、域名、和错误日志存放位置。注意目录间隔最好用/而不是/ 。

<VirtualHost *:80>
        ServerAdmin jsw7001@hotmail.com
        DocumentRoot E:/AppServ259/www/dede
        ServerName http://www.dede.com/
        ErrorLog E:/AppServ259/www/dede/error.log
        CustomLog logs/dummy-host2.appservnetwork.com-access_log common
</VirtualHost>

<VirtualHost *:80>
        ServerAdmin jsw7001@hotmail.com
        DocumentRoot E:/AppServ259/www/phpcms
        ServerName http://www.phpcms.com/
        ErrorLog E:/AppServ259/www/dede/error.log
        CustomLog logs/dummy-host2.appservnetwork.com-access_log common
</VirtualHost>    

*以上路径中的斜线左斜右斜都可以。

5: 将appserv的apache服务重启,就可以了,可以在各网站的根目录下放一个index.html文件,如果能看到,说明就对了。

     上边是使用域名的方法。

     下边说下如何使用本地IP+端口的方法。

     例如本机IP为:192.168.0.10
     那如何控制  80 、1000、1001、1002 来访问不同的文件目录,而达到多个站点同时访问的目的?

     打开appserv的安装目录,找到httpd.conf文件,找到:
     Listen 80
     加入:
Listen 80
Listen 1000
Listen 1001
Listen 1002

然后参照虚拟主机的设置方法。不同的是:
<VirtualHost *:80> 这个后边的端口号按自己需求更改就成了。

如果 弄完之后 出现403错误 那 在httpd.conf里找到:

<Directory />
   Options FollowSymLinks ExecCGI Indexes
   AllowOverride None
   Order deny,allow
   Deny from all
   Satisfy all
</Directory>

更改为
<Directory />
   Options FollowSymLinks ExecCGI Indexes
   AllowOverride None
#    Order deny,allow
#    Deny from all
#    Satisfy all
</Directory>