Yii2在此服务器上找不到请求的URL问题

问题描述

我已经完成了Yii2的设置。任何缺陷都不可见。但是http: //advanced/frontend/web/index.PHP等。它给出404警告。当我执行vagrant hostmanager时,一切正常。但是一段时间后,我收到了新的404警报。

Not Found
The requested URL was not found on this server.

Apache/2.4.18 (Ubuntu) Server at portal Port 80

我的流浪者文件

require 'yaml'
require 'fileutils'

domains = {
  portal: 'portal',advanced:'advanced'
}

config = {
  local: './config/vagrant-local.yml',example: './config/vagrant-local.example.yml'
}

# copy config from example if local config not exists
FileUtils.cp config[:example],config[:local] unless File.exist?(config[:local])
# read config
options = YAML.load_file config[:local]

# check github token
if options['github_token'].nil? || options['github_token'].to_s.length != 40
  puts "You must place REAL GitHub token into configuration:\n/vagrant/config/vagrant-local.yml"
  exit
end

# vagrant configurate
Vagrant.configure(2) do |config|
  # select the Box
  config.vm.Box = 'ubuntu/xenial32'

  # should we ask about Box updates?
  config.vm.Box_check_update = options['Box_check_update']

  config.vm.provider 'virtualBox' do |vb|
    # machine cpus count
    vb.cpus = options['cpus']
    # machine memory size
    vb.memory = options['memory']
    # machine name (for VirtualBox UI)
    vb.name = options['machine_name']
  end

  # machine name (for vagrant console)
  config.vm.define options['machine_name']

  # machine name (for guest machine console)
  config.vm.hostname = options['machine_name']

  # network settings
  config.vm.network 'private_network',ip: options['ip']

  # sync: folder 'portal' (host machine) -> folder '/var/www/portal' (guest machine)
  config.vm.synced_folder '../portal','/var/www/portal',id: "vagrant-portal",owner: "vagrant",group: "www-data",mount_options: ["dmode=775,fmode=664"]

  # sync: folder 'advanced' (host machine) -> folder '/var/www/advanced' (guest machine)
      config.vm.synced_folder '../advanced','/var/www/advanced',id: "vagrant-advanced",fmode=664"]

  # disable folder '/vagrant' (guest machine)
  config.vm.synced_folder '.','/vagrant'

  # hosts settings (host machine)
  config.vm.provision :hostmanager
  config.hostmanager.enabled            = true
  config.hostmanager.manage_host        = true
  config.hostmanager.ignore_private_ip  = false
  config.hostmanager.include_offline    = true
  config.hostmanager.aliases            = domains.values

  # provisioners
  config.vm.provision 'shell',path: './provision/once-as-root.sh',args: [options['timezone']]
  config.vm.provision 'shell',path: './provision/always-as-root.sh',run: 'always'
end

advanced.conf;

<VirtualHost *:80>
    ServerName advanced
    DocumentRoot /var/www/advanced
    <Directory /var/www/advanced>
        Options -Indexes
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

我也检查了hosts文件,ips似乎已定义。 有人遇到过同样的情况并解决了吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)