dongpa9277 2013-06-10 13:32
浏览 45

Apache和PHP分离vhosts

Hello i want to ask how to setup apache in way that I will get on each vhost documentroot = "/" and separate php.ini.

i have this kind of folder structure:

root/
 domain1/
   php.files ect
 domain2/
   php.files ect

i want to get in each php file in domain1 & domain2 $_SERVER['DOCUMENTROOT'] = "/" and have ability to set individual php.ini which will override main php.ini directives.

I tried many things to set this documentroot but still have no idea how to make it work. I tried also with suPhp in order to handle php.ini but it seems to not meet my needs, or I dont know how to configure it.

  • 写回答

1条回答 默认 最新

  • dopzc64662 2013-06-10 13:43
    关注

    you need to edit 2 files 1- file is vhosts :

    Domain : example domain files : C:\xampp\htdocs\example

    <VirtualHost example>
        ServerAdmin ssc@ssc.com
        DocumentRoot C:\xampp\htdocs\example
        ServerName example
        ErrorLog logs/ssc-host.example.com-error_log
        CustomLog logs/ssc-host.example.com-access_log common
    
    </VirtualHost>
    

    2- Also if you using windows you need to edit hosts file :

    C:\Windows\System32\drivers\etc\hosts

    Add this line

    127.0.0.1 example

    3- Restart your Apache server

    4- write example in your browser

    and now you have your domain .

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?