编辑httpd.conf(openshift.conf)以创建apache别名

编程入门 行业动态 更新时间:2024-10-26 12:35:20
本文介绍了编辑httpd.conf(openshift.conf)以创建apache别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 `${HOME}php/configuration/etc/conf.d/openshift.conf`

这就是我想做的:

我只需要创建一个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别名

    本文发布于:2023-07-16 04:02:15,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1117644.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:别名   编辑   httpd   conf   openshift

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!