简体   繁体   中英

Apache Virtual Host Setup on Centos for Zend Framework 3

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/

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM