【发布时间】:2018-01-13 09:05:19
【问题描述】:
对于背景故事,我不得不重新安装我的服务器,所以我对这里的几个网站进行了备份,我目前正在重新部署它们。但是,其中之一是我已经部署的网站之一的英文版。
但是,当我重装服务器的时候,忘记备份配置文件,因为我记得上次设置的时候并没有那么难,但是,嘿,我来了。
所以这里是英文版的配置文件:
<VirtualHost *:80>
ServerAlias en.mywebsite.fr
ServerAdmin webmaster@localhost
DocumentRoot /home/mywebsite-en/public
RailsEnv development
PassengerRuby /usr/local/rvm/wrappers/ruby-2.3.3/ruby
SetEnv GEM_HOME /usr/local/rvm/gems/ruby-2.3.3
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/home/mywebsite-en/public">
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
如果我转到 en.mywebsite.fr,它“有效”,但我实际上是在网站的法语部分。
这是我尝试做的事情列表(每次重新加载 apache 时),但没有奏效:
ServerAlias en.mywebsite.fr
服务器名称 en.mywebsite.fr
服务器名称 website.fr en.website.fr
ServerAlias website.fr en.website.fr
编辑:这里是主网站的样子
<VirtualHost *:80>
ServerName mywebsite.fr
ServerAlias www.mywebsite.fr
ServerAdmin webmaster@localhost
DocumentRoot /home/mywebsite/public
RailsEnv development
PassengerRuby /usr/local/rvm/wrappers/ruby-2.3.3/ruby
SetEnv GEM_HOME /usr/local/rvm/gems/ruby-2.3.3
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/home/mywebsite/public">
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
我错过了什么?
提前谢谢你
【问题讨论】:
-
还有哪些其他 VHost 文件?有没有人接管
*.website.fr? -
还有2个,一个不关心,一个是“主”网站,不是英文翻译。我正在更新问题(不,没有其他子域)
标签: ruby-on-rails apache subdomain virtualhost