如何添加虚拟主机的正确途径,同时运行南国? [英] How do I add virtual hosts the right way while running WHM?

查看:240
本文介绍了如何添加虚拟主机的正确途径,同时运行南国?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个专用的服务器为我的客户有小南国和CentOS分离账户5.我的一个客户要求我安装颠覆,并保存在根目录下的资源库。

I'm running a dedicated server separating accounts for my clients with WHM and CentOS 5. One of my clients has asked me to install subversion, and have the repository stored beneath the webroot.


  • 回购的真实文件夹将在/家庭/ theirfolder / SVN

  • 回购将通过一个子域上访问svn.theirdomain.com

我知道,正规的方式来做到这一点是建立在Apache的虚拟主机处理重定向。问题是,南国似乎超越了整个虚拟主机的过程,迫使我改变烤到外部文件中甚至不似乎为我工作。当护根目录下的文件夹,我不能让虚拟主机的路径认识到该文件夹​​的。

I know that the regular way to do this is to set up a virtual host in Apache that handles the redirect. The problem is that WHM seems to overtake the whole virtual hosting process, forcing me to bake changes into external files that don't even seem to work for me. When retaining the folder beneath the webroot, I could not get virtual hosting to recognize the path to this folder at all.

我已经得到了而不是移动文件夹颠覆到根目录,但即使这样,我使用的身份验证不遵照说明,所以这不是一个很好的解决方案,安全明智的最接近的。它也出现在此设置正由Apache和不被颠覆生成的页面。

The closest I've gotten was instead moving the subversion folder onto the webroot, but even then, my instructions for using Authentication are not followed, so that's not a good solution, security-wise. It also appeared that in this setting pages were being generated by Apache and not by Subversion.

可以在这里任何人都点我的教程,可以引导我通过这种设置,或者给我什么我需要做一个明确的,一步一步的指导方向?我已经尝试了很多东西,但一切都没有真正得到我那里。我已经有Subversion和其所有相关的下载和安装正确。

Can anyone here point me in the direction of a tutorial that can guide me through this type of setup, or give me a clear, step-by-step guide on what I need to do? I've tried a lot of things but nothing has really gotten me there. I already have Subversion and all of its dependencies downloaded and installed correctly.

在此先感谢!

推荐答案

做到这一点的方法之一是使用的南国的定制包括文件,并添加自定义的<虚拟主机> 指令那里的正规方式。在这些文件中所做的更改将生存自动重建由南国Apache的配置文件,而任何改变直接向 /etc/httpd/conf/httpd.conf中可能不是。

One way to accomplish this is to use one of WHM's custom include files, and add your custom <virtualhost> directives there the "regular way". Changes made in these files will survive an automatic rebuild of the Apache configuration files by WHM, while any changes made directly to /etc/httpd/conf/httpd.conf might not.

有三种自定义包括文件的包含在不同点主要httpd.conf中。这些文件(如果运行Apache 2.x的)位于:

There are three custom include files that are included by the main httpd.conf at different points. These files (if running Apache 2.x) are located at:


  • /usr/local/apache/conf/includes/$p$p_virtualhost_2.conf ,包括自动生成的前&LT;虚拟主机&GT; 指令

  • /usr/local/apache/conf/includes/post_virtualhost_2.conf ,包括后自动生成的&LT;虚拟主机&GT; 指令

  • /usr/local/apache/conf/includes/$p$p_main_2.conf ,包括在httpd.conf文件的顶部

  • /usr/local/apache/conf/includes/pre_virtualhost_2.conf, included before the automatically generated <virtualhost> directives
  • /usr/local/apache/conf/includes/post_virtualhost_2.conf, included after the automatically generated <virtualhost> directives
  • /usr/local/apache/conf/includes/pre_main_2.conf, included at the top of httpd.conf

您可以直接编辑这些文件,或通过WHM管理面板(服务配置 - >配置Apache的,包括编辑器,在南国11.30)。

You can edit these files directly, or via the WHM admin panel (Service Configuration -> Apache Configuration, Include Editor, on WHM 11.30).

我用post_virtualhost_2.conf为客户帐户设置额外的虚拟主机时WHM /的cPanel不会做什么,我是想通过其他的配置方法。任何有效的Apache配置指令可以在文件中 - 它只是包含在其主httpd.conf中全部

I've used post_virtualhost_2.conf to setup additional vhosts for client accounts when WHM/cpanel won't do what I want it to via other configuration methods. Any valid Apache configuration directives can go in the file - it's simply included in its entirety in the main httpd.conf.

这篇关于如何添加虚拟主机的正确途径,同时运行南国?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆