Apache Virtual Host Setup on Centos for Zend Framework 3

风流意气都作罢 提交于 2019-12-13 20:39:50

问题


I am newbie to zf3 and have extracted the ZF3 Skeleton Application from GitHub into location /var/www/html/zf2-tutorial and had installed successfully to get the zf3 home page from URL https://xxx.xxx.xx.xx/zf2-tutorial/public

While going through the tutorial i found i have to set up a virtual host to access the site like zf2-tutorial.localhost so i followed the steps and making a zf2-tutorial.conf file under /etc/httpd/conf.d folder .

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>

I also edited my /etc/hosts file to add

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

All i want i want to access the zf3 home page by accessing the URL

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

I am using httpd-2.4.6-67.el7.centos.6.x86_64

The Tutorial Link https://docs.zendframework.com/tutorials/getting-started/skeleton-application/


回答1:


Did you include the new zf2-tutorial.conf file inside your https.conf file?

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

Or is there a wildcard to that path inside your config?

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


来源:https://stackoverflow.com/questions/50754737/apache-virtual-host-setup-on-centos-for-zend-framework-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!