Fail to clear cache with Symfony on Vagrant - symfony

I'm using Vagrant on Windows with a box created on PuPHPet (Debian 7 and PHP 5.4). I installed a new project with Symfony 2 and there is some errors to clear the cache like "Cannot rename" or "Failed to remove directory".
I used the default configuration but also tried to:
enable NSF
follow the "Setting up Permissions" part on the Symfony guide
specify www-data as user/group for /var/www
change vagrant as apache user/group
and nothing changed, still the same errors.
How can I set the right permissions on the Symfony's cache with Vagrant?
Thank you

PHPStorm (there's Community Edition) has auto upload feature, which I successfully used for Vagrant file sharing. However you need to disable Vagrant's file sharing (NFS doesn't work with Windows out of the box anyway).
This is one say sync, thus you need to clear cache from inside of box.
Settings > Deployment (path to settings page depends on IDE version) add deployment server:
Connection tab:
Type: SFTP
Host: box IP
Port: 22
Username: vagrant
Password: vagrant
If I recall correctly PuPHPet disables password login in favor of key
based access, so use appropriate method (key was publicly stored in puphpet's repo).
Mapping tab:
Local path: project root locally
Deployment path: project root in box
Settings > Deployment > Options:
Upload automatically: Always
Upload external changes: Yes
Delete target items when source does not exist: Yes
There's NFS Vagrant plugin for Windows, but I could not get it to run as of March 2015.
There's also rsync sync method from Vagrant which offers one way sync as well, but I liked PHPStorm's autoupload more.

Related

WP2Static cURL error: Could not resolve host: statics.mydomain.com

I have a problem, with the plugin WP2Static in wordpress, when generating statics files, the folder is created well but not the files.
Export log:
cURL error: Could not resolve host: statics.mydomain.com
I'm using a VPS with Debian 9.
wordpress version: 5.2.1
WP2Static version: 6.6.5
I use Docker to generate my wordpress.
PS: The domain name used does not exist (statics.mydomain.com), I add it to the hosts file.
Target Directory:
/var/www/html/statics/site1
I installed the project on a VirtualBox and the plugin works fine. The problem must come from the DNS but I can not find the solution!
Have you ever had this problem ? Do you have any suggestions?
Thank you so much!
This is as you suspect a DNS resolution issue.
When you add the entry to your hosts file, I presume this is on your host.
The docker container running your application also needs to know where statics.mydomain.com resolves to.
Add an entry to the hosts file within your container running WordPress. You can then test by running cURL on CLI within that container.
WP2Static uses WordPress's knowledge of the Site URL and Home URLs from its Settings area. Ensure that these are also set to statics.mydomain.com and not overridden via wp-config.php.

Where to locate Symfony project created in Vagrant?

Hey guys I'm new to vagrant. I have used Homestead box. I have created Symfony4 Project but seems I can't locate the project folder..
Create Project In.
vagrant#homestead:~$ composer create-project symfony/website-skeleton Symfony-Demo
Homestead.yaml Config
folders:
- map: C:\homestead
to: /home/vagrant/homestead
sites:
- map: Symfony-Demo.test
to: /home/vagrant/Symfony-Demo/public
type: symfony4
Symfony-Demo.test is running well in browser.
Your application is now ready. You can start working on it at:
/home/vagrant/Symfony-Demo/
The problem is I don't know where the project is located.. C:\homestead is just empty..
Folder sharing in windows is just tricky...
did you first create the folder on windows? vagrant guest reads what's on the host, not the other way around as usually implied in the doc
did you switch to using winRM, which is a lot more efficient for windows?
are you kicking up vagrant from a command window run as administrator? are you using an administrator-level account to log in to winRM?

How do I read a file from the local file system from inside a meteor app?

I have a meteor app that needs to periodically read a file located on the host's file system, outside of the app package. I am using node's fs to accomplish this, and it works fine on my (macOS) development machine.
However, when I run mup deploy to deploy it to my (Ubuntu 14) server, mup returns the following error after starting meteor:
Error: ENOENT: no such file or directory, open '/home/sam/data/all_data.json'
at Object.fs.openSync (fs.js:652:18)
at Object.fs.readFileSync (fs.js:553:33)
Does anyone know why this might be happening?
you should follow mup documentation closely. Have you seen volumes setup in mup config? Try this to solve your issue.
Reason: mup runs app in docker without any access to host file system unless specified. Volumes setup does this for you with mup deployment.
Below is the part of mup config from http://meteor-up.com/docs.html, Everything Configured, read more to get a better idea.
name: 'app',
path: '../app',
// lets you add docker volumes (optional). Can be used to
// store files between app deploys and restarts.
volumes: {
// passed as '-v /host/path:/container/path' to the docker run command
'/host/path': '/container/path',
'/second/host/path': '/second/container/path'
},
The user you have that is running your meteor build on the server needs to have access to that folder - read access. I would store the file in a different directory than the home one, because you don't want to mess it up. Either way doing something like chmod -R 444 /home/sam/data should give read access to any user for all files in that directory. You are probably running meteor as your local user(sam?) in development mode on your macOS, but the built up gets run as meteor or some other user on ubuntu, because of mup and forever.

Nexus3 OSS: Installing Multiple Instances on Windows

This is actually an informational post to show some undocumented abilities of the windows nexus.exe. If anyone wants to provide some other useful information about Nexus3 OSS installation and/or configuration on Windows that is not readily available in the online books/documentation, that would be great!
I needed to install Nexus3 along side our current Nexus2.x to take advantage of the new repository formats, but Nexus2.x is already running under the default service name of "nexus". How can I provide the service name that Nexus3 will run under on Windows?
Nexus 3 Documentation as of 2017/09/12
https://help.sonatype.com/display/NXRM3
The documentation now includes instructions to clarify how to install multiple instances for Nexus 3:
https://help.sonatype.com/display/NXRM3/Installation#Installation-RunningasaServiceonWindows
Nexus 2 Documentation as of 2017/09/12
https://help.sonatype.com/display/NXRM2/Repository+Manager+2
In order to install Nexus3 under a different service name on windows, you will need to use the archive(zip file) download for windows instead of the windows executable installer. Then you simply provide the name you want the service to have as the last parameter of the normal install command.
More specific instructions:
Unpack the zip file into the desired location.
Open a command prompt with elevated permissions (run as administrator) and navigate to the bin directory of the unpacked nexus3 folder.
To create the service:
nexus.exe /install YourUniqueServiceName
To remove the service:
nexus.exe /uninstall YourUniqueServiceName
Note: Creating/Removing the service this way will not delete the nexus installation nor data files; they only affect the windows service. Conversely the windows installer provides an uninstaller executable that will delete the installation files and optionally will also delete the data directory.
Here is some other useful configuration options for changing the port and the data directory location, which you will want to do when installing multiple instances (as in the use case above). Be sure to stop the service if you've already installed it.
To change the port:
Navigate to the "etc" directory under the nexus installation location, and open the "org.sonatype.nexus.cfg" configuration properties file.
Change the "application-port" property to the desired port value.
To change the Data Directory and/or the java.io temporary directory:
Add or modify the following commandline arguments to the "nexus.vmoptions" file in the bin directory:
-Dkaraf.data=InsertDesiredDataDirectoryHere
-Djava.io.tmpdir=InsertDesiredTmpDirectoryHere

Correct way to setup Virtualbox 4.3 to use symlinks on guest (for meteor)

I use Windows 8 and installed Virtualbox so i can access to a Linux (Ubuntu) System.
The most i still did to do this - so at this moment i have a working Virtualbox with Ubuntu 14.04 LTS.
In my case i need this Virtualbox with Linux for meteor.
The problem:
meteor uses nodejs and so i need to have symlinks access (i think its symlinks - i read a few about it)
Reference: How to run meteor app inside an Ubuntu VrtualBox and edit using an editor on a Windows host?
He describes the same problem i have now:
Error: EROFS, read-only file system '/media/sf_Shared/Dropbox/dev_uhurajr/chat/.meteor/local/.build320446.build/programs/server/npm/logging/main/node_modules'
So i tried to enabled Symlinks on my host (windows) this way:
VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1
Reference: http://www.ahtik.com/blog/fixing-your-virtualbox-shared-folder-symlink-error/
This works fine! When i check the extradata for my VM the field SharedFoldersEnableSymlinksCreate is on 1
I set this value for 2 folders. The shared folder on Windows and also the name of the shared folder on my Linux VM.
But .. the same problem. The following error occurs everytime meteor tries to write symlinks:
Error: UNKNOWN, unknown error '/media/Projekte/test/.meteor/local/.build320446.build/programs/server/npm/logging/main/node_modules'
So whats the right way to get this working ?
Guessing you were using Virtualbox version after 4.0, please:
Enable symlinks VBoxManage.exe setextradata YOUR_VM VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOUR_SHARED_FOLDER 1
Run VirtualBox 'as admininstrator' on Windows.
Replace the YOUR_VM and YOUR_SHARED_FOLDER with your own value. You can check the value via VBoxManage.exe getextradata YOUR_VM enumerate
VirtualBox enabled symbolic for shared folder since 4.0, it's Windows permissions blocking you. You can either enable the permission for user or simply run VirtualBox as an administrator.
Please to refer the Virtualbox documentation:
Doc updated, please refer to the doc Shared Folders:
Starting with version 4.0, VirtualBox shared folders also support symbolic links (symlinks), under the following conditions:
The host operating system must support symlinks (i.e. a Mac, Linux or Solaris host is required).
Currently only Linux and Solaris Guest Additions support symlinks.
I made a development vm with setup and run scripts.
https://github.com/gfk-ba/meteor-dev-vm
Just put your meteor app in the app directory and follow the instructions in the readme.md

Resources