1

我需要在创作部分设置crafter cms studio,以便能够从远程主机(例如VPS)访问。我正在通过 Apache Web 服务器代理使用 Tomcat ajp 连接器。我试过像添加虚拟主机一样:

<VirtualHost *:80>
    ServerName studio
	
	DocumentRoot /home/web-apps/crafter/bin/apache-tomcat/webapps/studio
	
    RewriteEngine On
    ProxyPreserveHost On

    # Send requests to Engine's Tomcat
    ProxyPass / ajp://localhost:8009/
    ProxyPassReverse / ajp://localhost:8009/

    # This is where errors related to this virtual host are stored
    ErrorLog logs/mysite-error.log
    # This is where access logs are stored
    CustomLog logs/mysite-access.log combined
  </VirtualHost>

但并没有真正成功。我只能看到总是告诉我的默认页面:“Crafter CMS 没有为此域配置站点。请配置您要显示的站点或在创作环境中选择一个站点。” 当我像http://my_remote_host_ip/studio一样请求它时

有人曾经挑战过这样的问题吗?

4

1 回答 1

0

你所拥有的看起来是正确的。也许您可以尝试:

  • 清除您的 cookiemy_remote_host_ip
  • 清除浏览器缓存
  • 删除 DocumentRoot 指令(在这种特殊情况下并不真正需要)

这对我有用:

<VirtualHost *:80>
    ServerName myserver

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

    ErrorLog ${APACHE_LOG_DIR}/authoring-error.log
    CustomLog ${APACHE_LOG_DIR}/authoring-access.log combined

</VirtualHost>
<VirtualHost *:443>
    ServerName myserver

        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/my.crt
        SSLCertificateKeyFile /etc/apache2/ssl/my.key
        SSLCertificateChainFile /etc/apache2/ssl/their.crt

    ProxyPreserveHost On

    # Studio
        ProxyPass / ajp://localhost:8009/
        ProxyPassReverse / ajp://localhost:8009/

    ErrorLog ${APACHE_LOG_DIR}/authoring-error.log
    CustomLog ${APACHE_LOG_DIR}/authoring-access.log combined

</VirtualHost>

另一种方法是在 AWS 上试用社区版,看看它是否适用于您的浏览器。然后你可以看看它是如何配置的并复制配置:https ://aws.amazon.com/marketplace/pp/B08374YPTP?qid=1581949339014&sr=0-2&ref_=srh_res_product_title

于 2020-02-17T14:28:35.073 回答