Change xampp apache htdocs directory to access localhost from ubuntu and windows

43,601

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.

Share:
43,601

Related videos on Youtube

yes_in
Author by

yes_in

Updated on September 18, 2022

Comments

  • yes_in
    yes_in over 1 year

    I'm using ubuntu and windows 7 dualboot,and have xampp installed on both I want to have access to one localhost directory whether I'm using windows or ubuntu. both systems are installed on the same partition.

  • Nino van Hooff
    Nino van Hooff about 4 years
    If you made this change after you already logged in to phpmyadmin, the phpmyadmin session must be deleted, since the permissions for that session are still for the deamon user. Go to /opt/lamp/temp and remove the sess_* file(s?) there. After reloading phpmyadmin all is well. (and a new session is created for the correct user)