簡體   English   中英

設置VirtualHost,其中localhost在Apache Zendserver中的81端口上工作

[英]Setup virtualhost where localhost working on 81 port in apache zendserver

我已經安裝了zendserver,它正在http://localhost:81/

現在,我在Apache2 / htdocs / zend2中創建了zend framework 2項目,並通過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>

和在主機文件中

127.0.0.1 zend.local    

我嘗試了所有可能,但沒有任何效果。

我建議安裝ubuntu進行開發,我看不到您在Windows上的工作方式以及它如何使您煩惱。

嘗試這個:

制作默認部分的副本,只需添加ServerName Zend.local然后修改路徑即可。 您可能還想嘗試重新啟動計算機,這有時會使計算機正常工作(極少數情況)

這是我的一個副本,可以工作,但是在ubuntu下工作,因此它可能對您不起作用。

<VirtualHost *:80>
#ZEND-{354B5BC7F803049AB79DE95C47F32B59}
Include "/usr/local/zend/etc/sites.d/zend-default-vhost-80.conf"
#ZEND-{354B5BC7F803049AB79DE95C47F32B59}
    ServerAdmin webmaster@localhost
    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}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM