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:
- Install XAMPP in Windows and LAMPP in Ubuntu
- Boot into Ubuntu and record your Windows htdocs folder (say
/media/user/OS/xampp/htdocs
) - Go to
/opt/lampp/etc
and edithttpd.conf
and make the following changes (you will need root permissions to do so) - Replace
by#DocumentRoot "/opt/lamp/htdocs"
#DocumentRoot "/media/user/OS/xampp/htdocs"
- Replace
byDirectory "/opt/lampp/htdocs"
Directory "/media/user/OS/xampp/htdocs"
In the
section replaceIfModule unixd_module
byUser daemon Group daemon
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
Restart LAMPP services and you should be good to go.
Related videos on Youtube
Author by
yes_in
Updated on September 18, 2022Comments
-
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 about 4 yearsIf 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 thesess_*
file(s?) there. After reloading phpmyadmin all is well. (and a new session is created for the correct user)