Zend framework 多次尝试修复后,虚拟主机无法在Zend Framework中工作

Zend framework 多次尝试修复后,虚拟主机无法在Zend Framework中工作,zend-framework,virtual,host,Zend Framework,Virtual,Host,在“站点可用”和“站点启用”文件夹中,我都有一个名为“zend framework.conf”的conf文件。这是我在文件中包含的内容 <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating #

在“站点可用”和“站点启用”文件夹中,我都有一个名为“zend framework.conf”的conf文件。这是我在文件中包含的内容

 <VirtualHost *:80>
     # The ServerName directive sets the request scheme, hostname and port that
     # the server uses to identify itself. This is used when creating
     # redirection URLs. In the context of virtual hosts, the ServerName
     # specifies what hostname must appear in the request's Host: header to
     # match this virtual host. For the default virtual host (this file) this
     # value is not decisive as it is used as a last resort host regardless.
     # However, you must set it for any further virtual host explicitly.
     ServerName zendlocalhost
     ServerAlias zendlocalhost
     ServerAdmin root@localhost
     DocumentRoot /var/www/zend-framework/public
     SetEnv APPLICATION_ENV "development"
     <Directory /var/www/zend-framework/public>
         DirectoryIndex index.php
         AllowOverride All
         Order allow,deny
         Allow from All
     </Directory>

     # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
     # error, crit, alert, emerg.
     # It is also possible to configure the loglevel for particular
     # modules, e.g.
     #LogLevel info ssl:warn

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

     # For most configuration files from conf-available/, which are
     # enabled or disabled at a global level, it is possible to
     # include a line for only one particular virtual host. For example the
     # following line enables the CGI configuration for this host only
     # after it has been globally disabled with "a2disconf".
     #Include conf-available/serve-cgi-bin.conf 
</VirtualHost>
这是我的ports.conf文件中的内容。我收到一条消息说NameVirtualHost*:80将在以后的版本中被弃用。我试图补充这一点,只是因为我在另一个问题中看到了这一点

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
 Listen 443
</IfModule>

<IfModule mod_gnutls.c>
 Listen 443
</IfModule>

NameVirtualHost *:80

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
如果我转到
http://zendlocalhost/phpmyadmin
它停了下来 如果我转到127.0.0.1,它会调出通用的Ubuntu apache index.html文件 我对Zend很陌生,因为这是我第一次尝试。我知道有一些疯狂的URL重写之类的。我原以为转到根地址会调出index.php文件


提前感谢您的帮助

Apache不理解.htaccess中的第一条指令重写引擎。这意味着未启用mod_重写。如果您使用的是Ubuntu,请运行
sudoa2enmod rewrite
,然后重新启动Apache并重试

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
 Listen 443
</IfModule>

<IfModule mod_gnutls.c>
 Listen 443
</IfModule>

NameVirtualHost *:80

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The 
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to 
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size 
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]