VMWare shared folder as apache vhost


Nov 14, 2018    Janaki Mahapatra, Installation

Step 1. Find the apache user and group id as
id -u apache
id -g apache
Step 2: open vmware-tools files add apache user to the shared folder as
sudo vim /etc/init.d/vmware-tools
Step 3: Update the following as bellow
# Mount all hgfs filesystems
vmware_mount_vmhgfs() {
  if [ "`is_vmhgfs_mounted`" = "no" ]; then
    if [ "`vmware_vmhgfs_use_fuse`" = "yes" ]; then
      mkdir -p $vmhgfs_mnt
      vmware_exec_selinux "$vmdb_answer_BINDIR/vmhgfs-fuse \
         -o subtype=vmhgfs-fuse,allow_other,uid=48,gid=48 $vmhgfs_mnt" #uid=48,gid=48 added here
    else
      vmware_exec_selinux "mount -t vmhgfs .host:/ $vmhgfs_mnt -o uid=48,gid=48" #uid=48,gid=48 added here
    fi
  fi
}
Step 4. Create your vhost as

DocumentRoot /mnt/hgfs/yoursite.com/public
ServerName yoursite.com

AllowOverride All
Require all granted # needed for apache 2.4

ErrorLog /mnt/hgfs/yoursite.com/logs/error_log
CustomLog /mnt/hgfs/yoursite.com/logs/access_log common

Restart your VM as
sudo reboot now