Saturday, September 05, 2015

How to mount VMware Shares on Turnkey Linux (Debian) and use it as Apache2 Document Root

Hello everyone again. After struggling to find a perfect LAMP environment for WebDev and tried so many different things I decided to give a try on the Turnkey Linux because of its small footprint and easy deployability (just invented that I word guess).

That been said and not considering myself a Linux expert at all. I was able to successful deploy TurnKey Linux LAMP 13.0 box on a VMware workstation 11. Upgrade the Webmin to the latest version at this time (v1.760). Install the latest VMware Tools available and finally mount shared folders. I will try to post later a tut on how I got everything working. But on this post I will  focus on the topic. How to mount shared folders on the guest system AND use it as Apache2 Document Root.

I will assume the following considerations;

  1. You have install VMware workstation or Player 10, 11 or 12
  2. You have already installed VMware tools and it's tested to be working
  3. and you already have configured at least one shared folder in your VM settings.
Our Goal is to share C:\www on Windows 7 host and mount it at bot time under /mnt/www on our guest Turnkey Linux.

Let's start!   We will edit the following file with nano...

...and add the following line to mount ALL shared folders under /mnt on our guest at boot time;

SAVE, EXIT and RESTART VM Tools  ->  service open-vm-tools restart
RESTART Apache -> service apache2 restart

And at this point you should be able to list the folder and files under /mnt.

You still won't be able to browse to your website yet! We will have to now do the changes to make our folder available for Apache so we can navigate to it...

Lest's copy the default contents of /var/www to our new /mnt/www;
cp -R /var/www/* /mnt/www

We need to edit the following file and change anything from /var/www to our new document root /mnt/www

Now we edit the php5.conf file and make the following changes to it;

Note: The files above can also be edited through Webmin interface as follows;

At this point you should be able to go to http:/// and you should see;

Note: Also any website under the root should work like http:///website1

That's it! From now on, every time you restart your box the shared folders will be mounted under /mnt.

Have fun! :-)

If you have any question please don't hesitate to drop a msg.


Share this:

Post a Comment

Back To Top
Copyright © 2014 Unrevealing Box .