Andre's picture

Hello Everyone,

I sucessfully got my Turnkey Linux LAMP stack up and running  with the latest updates/upgrades. Managed to install VMware Tools and the latest Webmin 1.760.  
I also have achieved to get the VMware Shared Folders working. They are mounted at boot time under /mnt.

I am strugling with some probably stupid thing that I can't figure out. 

I have a "c:\www" folder on my HOST box shared and mapped on my guest under /mnt/www

The question is... How can I change the default location and/or create a new Virtualhost pointing to that location so any site that I put under /mnt/www will be served?

c:\www\site1  ->  /mnt/www/site1  ->  http://myltkvm/site1

c:\www\site2  ->  /mnt/www/site2  ->  http://myltkvm/site2

How can I acconplish this?

Thank you in advance for any help.

 

I have created a small manual on how to get shared folders working if anyone is interested;

http://unrevealingbox.blogspot.com.es/2015/09/how-to-mount-vmware-shares...

Forum: 
Jeremy Davis's picture

I'm unfamiliar with VMware usage but I know that with VirtualBox you can define where the shared folder is mounted. Assuming that VMware can do similar then you could just mount it at /var/www.

Alternatively you can mount --bind one location to another. E.g. mount /mnt/www to /var/www

The final otpion is to just change your webroot. That will require tweaking the Apache site to use /mnt/www instead of /var/www... Apache site files are in /etc/apache2/site-available they are enabled/disabled with a2ensite/a2dissite

PS Nice work on the blog post! :)

Andre's picture

Hi Jeremy,

Thanks for feedback man. I liked your idea. I didn't think of mounting directly my c:\www share under /var/www. I will try that and let you know.

I will also try the Bind option. 

What I really would like to do is to change the webroot. I tried to simply changin the default website in Webmin but it doesn't work. I get access denied and I don't seem to find a way to give propper permission. 

Could u gimme some light on changing the webroot? That tuts I found on internet doesn't seem to apply to Turnkey.

My idea is to have the TKL completly separate from the /www folder with the projects. This way I don't have the box full of stuff and its more mobile. I can just clone this ready box as much as I want give to a developer to start deving.

PS: VMware works the same way as VBOX when comes to shared folders. You basically share and mount on the guest. Straight forward with some twearks. ;-)

Thank in adavance.

Jeremy Davis's picture

TBH once I got my head around commandline stuff (and got over my fear) I rarely use Webmin. Personally I find that directly working on the commandline is much easier and straight forward.

I gave a very brief outline of what needs to happen above:

... change your webroot. That will require tweaking the Apache site to use /mnt/www instead of /var/www... Apache site files are in /etc/apache2/site-available they are enabled/disabled with a2ensite/a2dissite

With regards to online info for Apache; keep in mind that TurnKey is built on Debian. So most info you find that relates to Debian (and most of what you'll find that relates to Ubuntu) is relevant to TurnKey. Debian (and derivatives such as TurnKey and Ubuntu) do Apache config a little different to what Apache upstream do. RHEL (and derivatives e.g. CentOS) follow upstream config so WRT Apache config you'll only want to read info that relates to Debian/Ubuntu!

The webserver uses the 'www-data' user account (and group) so you'll need to make sure that you chown relevant files/directories so it can access them.

Having said all that; personally I leave the default config be and connect to my server via SSHFS. As SSH is configured by default there is no TKL server side tweaking required. Also as SSH is internet safe and password protected I can then connect to my severs anywhere! :)

I use Linux on my desktop and laptop so it integrates perfectly (like a part of the native filesystem - essentially achieving the same result as you but better IMO). AFAIK it should work almost exactly the same if you're a Mac user too. If you're a Windows user then there's a pretty cool SSHFS client that seems to be back in development. IMO this is the best fork: https://github.com/dimov-cz/win-sshfs

Good luck with it all regardless which direction you go :)

Add new comment