dtrj74376 2012-03-02 15:05
浏览 20
已采纳

如何在使用Plesk时动态创建vhost(Apache)?

I've built an app in PHP that runs on Apache. I need to be able to add vhosts on the fly so I would make my app write to sites-enabled and then reload Apache.

The only problem is, I have no choice but to use Plesk on this server as well. What would I edit on Plesk in order to be able to add vhosts on the fly without having Plesk overwrite it or cause any problems?

I've never had the chance to dig into Plesk too much so any guidance would be appreciated.

  • 写回答

2条回答 默认 最新

  • douluan5738 2012-03-08 11:46
    关注

    This is slightly tricky to handle with Plesk as the control panel likes to be in control of the Apache configuration files and certain files are automatically generated by Plesk to ensure that system settings remain consistent.

    There are a number of approaches you could take depending on your requirements.

    1) Make your app setup new sites on the local machine using the Plesk API. This would give you full control of the sites with the control panel and everything that entails. It's also the most complicated solution.

    2) If the sites can be addressed with the same domain, i.e. you are setting up subdomains a simple wildcard entry in the conf/vhost.conf for the master domain record would do it:

    ServerAlias *.mydomain.com

    You could then use this file to also associate other domains with the master domain by writing to it (carefully!) with your app.

    3) Setup and configure the Apache module mod_vhost_alias - although Plesk is likely to cause you a headache with this approach.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题