我在公司的服务器上面装了easyPHP,将程序拷到了www下面,而且数据库也连接好了,但是不会做VirtualHost,所以现在用域名访问不了,问问有没有会解决的,提供以下解决方案啊拜谢了

解决方案 »

  1.   

    <VirtualHost *:80> 
        ServerAdmin admin@localhost
        ServerName bbs.hehe.com
        DocumentRoot "d:/wamp/www/babel/htdocs/"     
        <Directory "d:/wamp/www/babel/htdocs"> 
        AllowOverride all
        Options Indexes FollowSymLinks MultiViews 
        Order allow,deny 
        Allow from all 
       </Directory> 
    </VirtualHost>大概就这样 改改就行  
      

  2.   

    我做了这样的虚拟端口,但是还是访问不了,是不是还有什么没有配置好啊
    NameVirtualHost hankook-gps.com:80<VirtualHost hankook-gps.com:80>
        ServerAdmin [email protected]
        DocumentRoot "d:/program files/EasyPHP 3.0/www/web"
        ServerName hankook-gps.com
        ServerAlias hankook-gps.com
        ErrorLog "logs/hankook-gps.comlog"
        CustomLog "logs/hankook-gps.com" common
        <Directory "d:/program files/EasyPHP 3.0/www/web"> 
        AllowOverride all
        Options Indexes FollowSymLinks MultiViews 
        Order allow,deny 
        Allow from all 
        </Directory> 
    </VirtualHost>
      

  3.   

    #NameVirtualHost *:80前的注释去掉了吗?
    去掉#之后restart加上这里就好了,之后就可加任意多的virtual host了NameVirtualHost 192.168.8.37:80
    #
    # NOTE: NameVirtualHost cannot be used without a port specifier
    # (e.g. :80) if mod_ssl is being used, due to the nature of the
    # SSL protocol.
    ##
    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for requests without a known
    # server name.
    #
    #<VirtualHost *:80>
    #    ServerAdmin [email protected]
    #    DocumentRoot /www/docs/dummy-host.example.com
    #    ServerName dummy-host.example.com
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    #/VirtualHost>
    <VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /var/www/html
        ServerName dummy-host.example.com
        ErrorLog logs/dummy-host.example.com-error_log
        CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost><VirtualHost 192.168.8.37:80>
        ServerAdmin [email protected]
        DocumentRoot /var/www/html
        ServerName XXX.com
        ErrorLog logs/dummy-host.example.com-error_log
        CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>
      

  4.   

    公司不能上Q
    你看下这个 
    http://foundationphp.com/tutorials/apache22_vhosts.php 
      

  5.   

    这是我的配置<VirtualHost *:80>
            ServerAdmin webmaster@localhost        DocumentRoot /var/www/WorkSpace/TEST
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
            <Directory /var/www/WorkSpace/TEST>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
            <Directory "/usr/lib/cgi-bin">
                    AllowOverride None
                    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                    Order allow,deny
                    Allow from all
            </Directory>        ErrorLog ${APACHE_LOG_DIR}/error.log        # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn        CustomLog ${APACHE_LOG_DIR}/access.log combined    Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory></VirtualHost>
    你看下你路径配置的对吗?放到项目的htdoc目录下
      

  6.   

    绿色没注释部分为
    DocumentRoot /var/www/WorkSpace/TEST
    <Directory /var/www/WorkSpace/TEST>放到项目的htdocs目录下
      

  7.   

    各位,我现在有一个域名地址,www.XXX.com(域名和IP已绑定),然后IP地址是218.94.115.134,我把我的程序把在www下面,现在我怎么配置apache的文件,让访问www.XXX.com成功