繁体   English   中英

为什么Apache找不到我的index.php?

[英]Why isn't apache finding my index.php?

我设置了一个无用信息框,将来宾80的端口转发到8080的主机,当我转到8080的主机时,找不到404文件。 根据此答案,这似乎是一个符号链接问题,但是我的符号链接设置正确:

vagrant@vagrant-ubuntu-trusty-64:/etc/apache2/sites-enabled$ ls -l
total 0
lrwxrwxrwx 1 vagrant vagrant 41 Apr  8 00:19 000-default.conf -> /etc/apache2/sites-available/default.conf

或者至少我很确定那是正确的。 我的default.conf看起来像这样:

<VirtualHost *:80>
  ServerAdmin webmaster@localhost

  DocumentRoot /var/www/dirty_bird

  # correct caching issue where edited images do not refresh http://www.mabishu.com/blog/2013/05/07/solving-caching-issues-with-vagrant-on-vboxsf/
  EnableSendfile off

  <Directory /var/www/dirty-bird>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/dirty-bird.error.log

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

  CustomLog ${APACHE_LOG_DIR}/dirty-bird.access.log combined
</VirtualHost>

当我vagrant up然后访问localhost::8080我得到: 404 File Not Found我确信这很简单,但是我不确定是什么。 Google大多告诉我这是一个符号链接问题,但是除非我的符号链接错误,否则不是这种情况。 和Apache正在运行。

防火墙中是否打开了8080端口?
在您的VirtualHost中查看端口80,更改为8080。

<VirtualHost *:80>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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