2013-10-02 41 views
1

我已經安裝了zendserver,它運行在http://localhost:81/安裝虛擬主機localhost工作在81端口在Apache的zendserver

現在我已經創建Zend框架2項目的Apache2/htdocs中/ zend2並通過http://localhost:81/zend2/public訪問此。

我必須爲此設置虛擬主機,如zend.local但它不起作用。

在httpd.conf文件

NameVirtualHost *:81 
<VirtualHost *:81> 
<Directory "C:\Program Files/Zend/Apache2/htdocs/zend2/public"> 
Options FollowSymLinks 
AllowOverride All 
Order allow,deny 
Allow from all 
</Directory> 
DocumentRoot C:\Program Files/Zend/Apache2/htdocs/zend2/public/ 
ServerName zend.local 
ServerAlias zend.local 
</VirtualHost> 

,並在hosts文件

127.0.0.1 zend.local  

我已經嘗試了所有的可能性,但沒有任何工程。

+1

zend.local:81? –

+0

設置127.0.0.1:81 – tinybyte

+0

你重新啓動了Apache嗎? – konradwww

回答

0

我推薦安裝ubuntu進行開發,我沒有看到你如何在windows上做它,以及它如何不煩擾你。

試試這個:

使默認部分的副本,只需添加服務器名Zend.local然後修改路徑,並應工作。您可能還想嘗試重新啓動有時會使其工作的計算機(罕見場合)

這裏是我的作品的副本,但它在ubuntu下,所以它可能會或可能不會爲您工作。

<VirtualHost *:80> 
#ZEND-{354B5BC7F803049AB79DE95C47F32B59} 
Include "/usr/local/zend/etc/sites.d/zend-default-vhost-80.conf" 
#ZEND-{354B5BC7F803049AB79DE95C47F32B59} 
    ServerAdmin [email protected] 
    ServerName zendapp.dev 
    DocumentRoot /var/www/vhosts/zendapp/public 
    <Directory /> 
     Options FollowSymLinks 
     AllowOverride All 
    </Directory> 
    <Directory /var/www/vhosts/zendapp/public/> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     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> 
#ZEND-{90331A19916187EEA0C9B3A8FE0E1632} 
Include "/usr/local/zend/etc/sites.d/globals-*.conf" 
Include "/usr/local/zend/etc/sites.d/vhost_*.conf" 
#ZEND-{90331A19916187EEA0C9B3A8FE0E1632}