Make a Netbeans project that runs in shared folder VirtualBox does not upload

0

I have a VirtualBox running an Ubuntu / Apache / PHP web server. I configured the application folder in apache as / var / sf_www / this is a folder shared with my host machine.

I configured Run Configuration in Netbeans as Remote Web Site, to access the ip of my virtual machine.

Whenever I run the application on Netbeans it will upload the changed files to the application server, but this is not necessary as I edit the files on my local machine which are shared by the application folder of my web server .

How do Netbeans run the remote server without uploading the files?

    
asked by anonymous 06.02.2014 / 05:04

2 answers

1

To do this, go to the settings of your virtual machine and create a shared folder.

Settings dialog > Shared Folders

In this example name the shared folder as "Server". In the options let only marked "Make permanent".

Now run the virtual machine and install additional virtualbox programs on linux

Devices > CD/DVD Devices > VBoxGuestAdditions.iso

Mount the CD with the

sudo mount /dev/cdrom /cdrom

run the command below to download some packages needed to install the virtualbox tools

sudo apt-get install build-essential linux-headers-'uname –r'

Soon afterwards we go to the installation of the tools

Para 32bit: sudo /cdrom/VBoxLinuxAddition-x86.run
Para 64bit: sudo /cdrom/VBoxLinuxAddition-amd64.run

Restart the machine

sudo reboot

So that you do not have work to change or create virtualhosts in apache, mount your shared folder in / var / www

sudo mount -t vboxsf -o rw,uid=33,gid=33 Server /var/www;

Pay attention to the uid=33,gid=33 part that represents the user code and group in which the apache runs. Usually www-data . Change if apache is set to use another user, otherwise you will have problems with permission when running your scripts.

So you do not need to mount your shared folder every time you start the virtual machine, add a startup script.

cd /etc/init.d/
sudo vi sharedfolder.sh

Paste the code below into the file and save it by pressing ESC > :wq > ENTER

#!/bin/bash
sudo mount -t vboxsf -o rw,uid=33,gid=33 Server /var/www;

You can now allow Netbeans to run your projects directly from a local folder. So it will not upload the project.

To configure XDebug on the virtual machine and enable Netbeans to run the debug normally, change the XDebug settings in php.ini as follows

xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host={IP da maquina virtual}
xdebug.remote_port=9000
xdebug.remote_autostart=0

Ready, configured environment.

    
10.02.2014 / 04:16
0

You can change the upload to manual in the project properties, depending on the link link

    
09.02.2014 / 01:33