Scotchbox:文件根缺失/与Vagrant一起躲避(Scotchbox: Document root missing / desynced with Vagrant)

编程入门 行业动态 更新时间:2024-10-28 04:19:08
Scotchbox:文件根缺失/与Vagrant一起躲避(Scotchbox: Document root missing / desynced with Vagrant)

我正在使用Scotchbox(box.scotch.io)进行Vagrant。 自从他们上次更新后我得到一个文档根缺失错误( AH00112:警告:DocumentRoot [/ var / www / mypage]不存在 )当我尝试在Apache中设置我的一些域配置时。 我无法确定自Scotch 2.0以来是否对设置进行了更改,或者由于某些原因Vagrant是否已经使这些文件夹变得黯然失色。 我的设置如下,

流浪文件路径

config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

Apache域配置路径

<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName mypage.dev ServerAlias www.mypage.dev DocumentRoot /var/www/mypage </VirtualHost>

000-default和scotchbox配置文件都指向/ var / www / public。 我的默认dev文件夹位于~username / Development,该文件夹是我的Vagrant文​​件。 有任何想法吗? 如果我需要提供其他详细信息,请与我们联系。

更新:切换到Docker。 厌倦了这一点。

I'm using Scotchbox (box.scotch.io) for Vagrant. Since their last update I get a document root missing error (AH00112: Warning: DocumentRoot [/var/www/mypage] does not exist) when i try and set up my some domain configs in Apache. I can't really determine whether its a change in settings since Scotch 2.0 or if Vagrant for some reason has descyned these folders. My setup as follows,

Vagrant file pathway

config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

Apache domain config pathway

<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName mypage.dev ServerAlias www.mypage.dev DocumentRoot /var/www/mypage </VirtualHost>

The 000-default and scotchbox config files both point to /var/www/public. My default dev folder is located at ~username/Development, in that folder is my Vagrant file. Any ideas?Let me know if I need to provide other details.

Update: Switching to Docker. Tired of this.

最满意答案

我刚刚克隆了Scotchbox ,我的Vagrant文件还包含:

config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

我的apache配置( /etc/apache2/sites-enabled/000-default.conf )看起来:

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/public ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>

我在主机上的根目录中有public目录, ls -1打印:

README.md Vagrantfile public

它对我有用!

在您的情况下,您需要更新apache配置,并具有:

DocumentRoot /var/www/public

并注意您在Vagrantfile附近有public目录。 如果你有目录mypage - 然后运行mv mypage public

I've just cloned Scotchbox and my Vagrant file also contains:

config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

My apache config (/etc/apache2/sites-enabled/000-default.conf) looks:

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/public ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>

And I have public directory in my root dir on the host machine, ls -1 prints:

README.md Vagrantfile public

And it works for me!

In your case, you need update apache config, and have:

DocumentRoot /var/www/public

And pay attention that you have public directory near Vagrantfile. If you have directory mypage - then run mv mypage public

更多推荐

本文发布于:2023-04-27 14:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1327339.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缺失   文件   Vagrant   Scotchbox   missing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!