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

3

3

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.

yes_in

Posted 2014-06-12T11:05:40.127

Reputation: 123

Answers

6

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.

Roberto Stelling

Posted 2014-06-12T11:05:40.127

Reputation: 61

0

I would recommend having the "shared" HTDOCS folder on your Windows side as Ubuntu can read NTFS natively.

You will need to use FSTAB to mount your Windows partition when Ubuntu boots so that you can access the web files.

Once you have a regular mount point for the Windows partition you need to create a symbolic link in Ubuntu so that your web files are still accessible by Ubuntu Apache but it can still read from its default location.

E.g. sudo chown -R $USER /var/www; ln -s /var/www /media/Windows/xampp/htdocs

I'm only using the above code as an example. Please do further reading to get your scenario correct.

Kinnectus

Posted 2014-06-12T11:05:40.127

Reputation: 9 411