Nov 9

Windows服务器apache设置虚拟主机virtualhost 不指定

北京SEO , 22:46 , SEO行业新闻 , 评论(1) , 引用(0) , 阅读(1220) , Via 本站原创 | |
Windows apache virtualhost
This will allow one to set up apache so that you can access a web site stored locally on a windows box in a more convienient manner: http://sitename rather than http://127.0.0.1/sitename/. It's useful to test things and looks neat!

In the httpd.conf file add a line to the bottom such as:

Include "D:/Program Files/Apache Group/Apache/conf/vhosts.conf"
Create and open that file and add lines such as

NameVirtualHost *


DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/"
ServerName 127.0.0.1



DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/npw/"
ServerName npw



DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/liamdelahunty/"
ServerName ld



DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/worldwideco/"
ServerName ww




Now find the "HOSTS" file, which may be in "C:\WINDOWS\system32\drivers\etc". Save it in same directory as HOSTS without the extention. Add the corresponding lines:

127.0.0.1 localhost
127.0.0.1 ld
127.0.0.1 npw
127.0.0.1 ww

Now restart apache and you will be able to see all your local websites using http://127.0.0.1/ or visit one directly using http://ld/ etc.

# Apache VirtualHost Example


     ServerAdmin 51solo@163.com
     DocumentRoot E:/www/cms
     ServerName 192.168.1.168:80
     #ServerAlias www.51solo.net
     DirectoryIndex index.htm index.html index.php
     DefaultLanguage zh-CN
     AddDefaultCharset GB2312
     #ErrorDocument 404 http://www.51solo.net/error.html
     #ErrorLog home/log/test.com-error_log
     #CustomLog home/log/test.com-access_log commom
    
         Options FollowSymLinks
         AllowOverride None
         Order allow,deny
         Allow from all
    

    
         php_admin_flag engine on
         php_admin_flag safe_mode off
       # php_admin_value open_basedir none
       # php_admin_value session.save_path "/usr/local/tmp/php/session"
       # php_admin_value open_basedir "/home/web/;/usr/local/tmp/php"
    

seo
2008/11/19 21:14
seo 这个很好用
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]