这就是我想做的:
我只需要创建一个Apache目录别名(而不是DNS别名)并定义具有一定权限的目录.
Here is what I would like to do:
I just need to make an apache directory alias (NOT a DNS alias) and define a directory with some permissions.
我在rhc上手动编辑了文件,然后从本地命令提示符下重新启动了该应用程序.重新启动完成后,这会用默认的盒带文件覆盖我的编辑文件.
I manually edited the file on rhc and restarted the app from my local command prompt. This overwrote my edited file with the default cartridge file when the restart was complete.
$ rhc app restart
在我的部署脚本中添加了一些herdoc语句,提交了更改,并推送到了rhc(我不认为这会行得通,但以防万一.)
Added some herdoc statements to my deploy script, commited the change, and pushed to rhc (I didn't think this would work but tried it just in case.)
#.openshift/action_hooks/deploy cat << EOF >> ${HOME}php/configuration/etc/conf.d/openshift.conf all of my edits ... EOF
#.openshift/action_hooks/deploy cat << EOF >> ${HOME}php/configuration/etc/conf.d/openshift.conf all of my edits ... EOF
是否有更聪明的方法来执行此操作,或者我必须自己制造墨盒才能对httpd.conf进行简单编辑?
Is there a smarter way to do this or must I build my own cartridge to make a simple edit to httpd.conf?
非常感谢您的帮助!
周杰伦
推荐答案找到了我自己的问题的答案:
Found the answer to my own question:
浏览完用于创建盒带的文档后,答案就直直地盯着我(第一步下面的部分讨论如何创建到modules目录的符号链接.)
After looking through the documentation for creating a cartridge the answer was staring me in the face (section under first steps talks about creating a symlink to the modules directory.)
我真正想使用别名的目的是指向ApacheDocument根目录之外的文件.墨盒中启用了FollowSymLinks,因此,我要做的就是创建一个符号链接,它确实完成了我要使用Alias进行的操作(不确定为什么我没有更早看到它).
What I really wanted to do with the alias was to point to files outside of the ApacheDocument root. FollowSymLinks is enabled in the cartridge, so all I had to do was create a symlink and it did exactly what I was trying to accomplish with the Alias (not sure why I didn't see that sooner).
因此,而不是在apache conf文件中...
So instead of this in the apache conf file...
Alias /publicly-visible-alias "/some/path/outside/of/document/root" <Directory "/some/path/outside/of/document/root"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
Alias /publicly-visible-alias "/some/path/outside/of/document/root" <Directory "/some/path/outside/of/document/root"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
我在.openshift/action_hooks/deploy
I used this in the .openshift/action_hooks/deploy
ln -s /some/path/outside/of/document/root ${OPENSHIFT_REPO_DIR}/sub-directory/publicly-visible-alias
/publicly-visible-alias目录中的.htaccess文件负责所有其他详细信息(mod_rewrites,文档索引等...等...)
The .htaccess file inside of /publicly-visible-alias directory took care of all the other details (mod_rewrites, document index, etc... etc...)
希望这对其他人有帮助.
Hope this helps someone else.
周杰伦
更多推荐
编辑httpd.conf(openshift.conf)以创建apache别名
发布评论