对于Zend框架3在CentOS Apache的虚拟主机设置(Apache Virtual Host

2019-10-28 11:43发布

我是新手,ZF3并提取从GitHub上的ZF3骨架应用到位置/var/www/html/zf2-tutorial ,并成功安装摆脱URL的ZF3主页https://xxx.xxx.xx.xx/zf2-tutorial/public

虽然经历的教程中,我发现我必须建立一个虚拟主机访问的网站,如zf2-tutorial.localhost ,所以我遵循的步骤,使一个zf2-tutorial.conf下文件/etc/httpd/conf.d文件夹。

ZF2-tutorial.conf

<VirtualHost *:80>
ServerName https://xxx.xxx.xx.xx/zf2-tutorial
DocumentRoot /var/www/html/zf2-tutorial/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/html/zf2-tutorial/public>
    DirectoryIndex index.php
    AllowOverride All
    Require all granted
</Directory>

我还编辑我的/etc/hosts文件中添加

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
xxx.xxx.xx.xx  xxx.xxx.xx.xx/zf2-tutorial

所有我想要的,我想通过访问URL来访问ZF3主页

https://xxx.xxx.xx.xx/zf2-tutorial/

我使用httpd-2.4.6-67.el7.centos.6.x86_64

教程链接https://docs.zendframework.com/tutorials/getting-started/skeleton-application/

Answer 1:

是否包含新zf2-tutorial.conf您https.conf文件中的文件吗?

# include zf2 tutorial host file
Include /etc/httpd/conf.d/zf2-tutorial.conf

或者是有一个通配符你的配置里面这条道路?

Include /etc/httpd/conf.d/*.conf


文章来源: Apache Virtual Host Setup on Centos for Zend Framework 3