xampp lampp 改变网页root目录的方法

This is an old question but I haven't seen it properly answered yet. Here is what you need to do:

  1. Install XAMPP in Windows and LAMPP in Ubuntu
  2. Boot into Ubuntu and record your Windows htdocs folder (say /media/user/OS/xampp/htdocs)
  3. Go to /opt/lampp/etc and edit httpd.conf and make the following changes (you will need root permissions to do so)
  4. Replace
    #DocumentRoot "/opt/lamp/htdocs"
    by
    #DocumentRoot "/media/user/OS/xampp/htdocs"
  5. Replace
    Directory "/opt/lampp/htdocs" 
    by
    Directory "/media/user/OS/xampp/htdocs"
  6. In the

    IfModule unixd_module
    section replace
    User daemon
    Group daemon
    by
    User yourUsername
    Group yourGroupname
    Typically yourUsername and yourGroupname are the same: the name of your Ubuntu user but you can check this out in /etc/passwd and /etc/groups
  7. Restart LAMPP services and you should be good to go.

 

 

 

 

 

posted @ 2019-03-04 21:21  微信公众号--共鸣圈  阅读(199)  评论(0编辑  收藏  举报