我拥有域名“peterlee.com.cn”,并在我的域名控制面板中添加了一条 A 记录:
RR Destination IP TTL
rs.peterlee.com.cn 10.50.10.75 1 hour
我有一个正在运行的 RoR (Ruby on Rails) 项目10.50.10.75:9051
,这意味着用户可以通过以下方式访问我的 RoR 应用程序http://10.50.10.75:9051
我想让用户通过http://rs.peterlee.com.cn访问它,所以我添加了以下 VirtualHost File/Site:
<VirtualHost *:80>
ServerName rs.peterlee.com.cn
DocumentRoot /usr/website/myapp/current/public
PassengerEnabled off
ProxyPass / http://127.0.0.1:9051/
ProxyPassReverse / http://127.0.0.1:9051/
RackEnv production
RailsEnv production
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect all requests to the maintenance page if present
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
</IfModule>
</VirtualHost>
启用站点并重新启动 Apache2 后,我尝试了http://rs.peterlee.com.cn,它给了我 500 Internal Server Error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.22 (Ubuntu) Server at rs.peterlee.com.cn Port 80
谢谢。
彼得