如果公共目录中存在索引页面,则当我输入URL时,它将在浏览器中打开 printf("All individuals have the same age of %d", &age1);
页面。
如果我从公共目录中删除index.html
文件,它将显示localhost Apache页面。
但是根据路由,它应该在家庭控制器中显示index.html
。
我将虚拟主机设置为:
index.html.erb
我在<VirtualHost *:80>
ServerName rapp.dev
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/html/rapp/public
<Directory /var/www/html/rapp/public>
# This relaxes Apache security settings.
AllowOverride All
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
文件中的路由:
routing.rb