3的Centos上安装Apache虚拟主机

3的Centos上安装Apache虚拟主机

本文介绍了在Zend Framework 3的Centos上安装Apache虚拟主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是zf3的新手,已从GitHub将ZF3骨架应用程序提取到位置/var/www/html/zf2-tutorial,并已成功安装以从URL https://xxx.xxx.xx.xx/zf2-tutorial/public

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

在阅读本教程的过程中,我发现必须设置一个虚拟主机才能访问zf2-tutorial.localhost之类的站点,因此我按照步骤在/etc/httpd/conf.d文件夹下创建了一个zf2-tutorial.conf文件.

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

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文件以添加

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

我想通过访问URL来访问zf3主页

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

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/

推荐答案

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

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

这篇关于在Zend Framework 3的Centos上安装Apache虚拟主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-10 22:29