How to create virtual directory in G-WAN webserver - g-wan

I installed G-WAN webserver , and i create virtual host , in G-WAN we must create folder for virtual host's , now i want to create virtual directory
my installed path is :
/home/gwan/
and myfiles are in
/home/user/
so how can i create virtual directory for virtual host ?

When we created G-WAN, we worked hard to remove any possible configuration issue by not using files where you have to tell the server what to do.
The simplest way to use your files located under /home/user/ is to either copy the G-WAN execuatble there or to copy your www files under the /home/gwan folder.
If you really want to use G-WAN, you should consider to read its documentation or at least its FAQs which both explain how to setup hosts.

Related

Issue using Vagrant SSH when vagrant.d folder is on an external exFAT drive

Setting up Vagrant for the first time and I'm using the VAGRANT_HOME environment variable to change the location of the ~/.vagrant.d folder to an external drive (I'm paranoid about SSD wear and tear, sue me). This is causing an issue with the vagrant ssh command as it's complaining about not having the right permissions and I can't use chmod to change the permissions for the file it wants on an exFAT volume.
Is there a workaround? I've checked the documentation and there doesn't seem to be a setting where I can specify a different location for the insecure key, but I might be missing something.
Thanks!
The solution is to move the insecure_private_key file located in the external vagrant.d folder to somewhere in your local home directory and then symlink it back.

Cannot access Vagrant shared folders

I just trying to add Vagrant to my workflow and I have following probably noob problem. I pull standard hashicorp standard 14.04 image, vagrant up it, SSH to it install my python requirements on it and then then try to execute build commands against code in Vagrant shared folder and run in to problems. Basic errors I get say those locations don't exist or cannot be found.
First action I, go ls /vagrant and can see my shared folders. I cannot cd to them from Vagrant machine I have tried to halt the machine.
Vagrantfile shared folder code.
{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"/Users/Kimmo/Documents/Mist.io","disabled":false}}}
I am using Virtualbox as provider newest version.
My dev machine is OSX 10.9.5
There are not access limitations on the folder itself.
Thanks for you help in advance :)
Does /vagrant exists inside the VM just after you start it ?
If no you can add this parameter : "create":true. According to the doc, for the create: true paramater : If true, the host path will be created if it does not exist. Defaults to false.
If the folder /vagrant exists but you can cd or ls it, you can add parameters wich will define the right/owner of this folder:
owner: (string) the user who should be the owner of this synced folder. By default this will be the SSH user. Some synced folder types don't support modifying the owner.
group: (string) the group that will own the synced folder. By default this will be the SSH user. Some synced folder types don't support modifying the group.
Also for the hostpath parameter you have to give him a folder path, not a file path. In your conf I can see: "hostpath":"/Users/Kimmo/Documents/Mist.io". If Mist.io is a file and you want to access this file inside your VM, just give the path to the folder containing this file, /Users/Kimmo/Documents in your case.

How can I set permissions for Magento using a Vagrant shared folder?

I am trying to install a Magento instance using vagrant. I used the MageVagrant repository found here, then modified it so that the default installtion directory on the vagrant machine points to a folder in the /vagrant folder, which is the shared folder (I did this so that I could edit the Magento files on my local machine and store them in version control), so that on my vagrant machine I have a symlink that looks like the following:
/srv/www/magento.localhost.com -> /vagrant/magento.localhost.com
When I try to run the Magento installer, it is fine until I get to the Configuration step of installation, and then I get the following error message:
Path "/srv/www/magento.localhost.com/public_html/app/etc" must be writable.
Path "/srv/www/magento.localhost.com/public_html/var" must be writable.
Path "/srv/www/magento.localhost.com/public_html/media" must be writable.
even though I have run chmod 777 -R on the directories both on my local machine and on the vagrant box. However, it still thinks it is not writable. How can I make these directories writable for the vagrant server?
By default it makes the mounted folder owned by the vagrant user and group, so you could make the web server you are using have permissions for that, or the way I do it is to add another shared folder and explicitly set the permissions on that share to how I want.
Line in my VagrantFile:
config.vm.synced_folder "../project_folder", "/var/www/", owner: "apache", group: "apache"
this will mount the folder "project_folder" which is one level above my vagrant directory to the location "/var/www" inside the virtual machine with the ownership of apache:apache.
This should work.
If you are hosting multiple sites inside the vm I suggest setting this shared folder as the parent of all the sites.

How do I upload files to localhost in XAMPP?

I'm trying to test a WordPress installation in XAMPP for OS X (running version 0.7.3 because I prefer the included version of phpMyAdmin). When I try to upload media files, it returns an error about not having a temporary folder. Same with any upload form I test in other applications.
Is there anything I can do to get it to allow uploads to function normally, as if it were a remote machine?
You'll simply need to create a /tmp and /wwwtmp in your sites root directory.
Check the permissions set for these directories

Vagrant file structure and web root

I've read the docs and a few things still confuse me, mostly related to sync folders and database data.
I want to use the following folder structure on my host machine
ROOT
|- workFolder
||- project1
|||- project1DatabaseAndFiles
|||- project1WebRoot
||- project2
|||- project2DatabaseAndFiles
|||- project2WebRoot
||- project3
|||- project3DatabaseAndFiles
|||- project3WebRoot
And then create VM's where each VM host webroot points to the appropriate projectX/projectXWebRoot folder.
From what I've read, I can only specify one remote Sync DIR. (http://docs.vagrantup.com/v2/synced-folders/). But if I create a new VM I want to specify the project name too, thereby selecting the correct host folder.
Is what I'm describing possible using Vagrant?
If I wanted another developer to use this environment, I'd like for them to have instant access to the database structure/setup etc without having to import any SQL files. Is this possible?
I'm hoping I'm just not understanding Vagrants purpose, but this seems like a good use of shared VM's to me. Any pointers or articles that might help would be very welcome.
From what I've read, I can only specify one remote Sync DIR.
No that is not true. You can always add more shared folders. From the
manual:
This directive is used to configure shared folders on the virtual machine and may be used multiple times in a Vagrantfile.
This means you can define additional shared folders using:
config.vm.share_folder "name", "/path/on/vm", "path/on/host"
If I wanted another developer to use this environment, I'd like for them to have instant access to the database structure/setup etc without having to import any SQL files. Is this possible?
Yes, you can alter the data storage path of, say, MySQL to store it in on a share on the host so that
the data is not lost when the VM is destroyed.
However, this is not as simple as it sounds. If you're using the MySQL cookbook (again, assuming you're using MySQL), you have to modify it so that the shared folder is mounted with the uid and gid of the mysql user or otherwise the user can't write to it. You can mount a share manually like this:
mount -t vboxsf -o uid=`id -u mysql` -o gid=`id -g mysql` sharename /new/data/dir
Also, if you're using Ubuntu or Debian Wheezy, Apparmor needs to be configured differently for MySQL,
as it does not allow writes to the newly configured data directory. This can be done by writing
/new/data/dir r,
/new/data/dir/** rwk,
to /etc/apparmor/apparmor.d/local/usr.sbin.mysqld. This version of the mysql cookbook supports this behaviour already, so you can look up how it does that.

Resources