background image

Content tagged with: ide

Eric's picture

I do all of my development on a Parallels virtual machine 1) to keep my host operating system stable at all times; and 2) so I can run the same operating system as our production servers (to reduce the differences in configuration & chance of a deployment issue). I'm a fan of RPM based operating systems (vs APT) so I prefer Centos. To improve performance I do not run a GUI (KDE, Gnome, etc) and I install the bare minimum set of packages. My linux server philosophy has always been: if you don't use it or don't know what it does, don't install it; and if you don't know it does, Google it. My preferred IDE is Eclipse, so I install that on my host operating system (OSX). So how do I edit my files on my virtual machine? Samba. Here's how I setup a basic samba configuration:

Install Samba (as necessary)

sudo yum install samba

Create a backup of the original samba configuration file, just in case

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.orig

Here's a basic smb.conf file I use with a description for each config setting:

[global]
    # workgroup should match your network that your host operating system is on
    workgroup = MYWORKGROUP
    # server string is description of samba server
    server string = MY CENTOS VM
    # default security level
    security = user
    # performance tuning
    socket options - TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
[homes]
    # share comment for user's home directories
    comment = Home Directories
    # hides shares to users without permission
    browseable = no
    # allows privileged users to modify files
    writable = yes
[Vhosts]
    # I share my entire vhosts folder
    comment = Vhosts
    # to be more secure, I only allow my primary user from my host operating system access
    valid users = eric
    # allows privileged users to modify files
    writeable = yes
    # this is the path to my Apache vhosts
    path = /var/www/vhosts
    # setting a umask will ensure permissions will be set correctly on files created across a samba share
    directory mask = 775
    create mask = 664

Create a samba user that matches your host operating system

sudo smbpasswd -a eric

Restart Samba

sudo /etc/init.d/smb restart

Now, from your host operating you can connect to your vhosts share and edit your files. From OSX, I use the "connect to server" command in the finder menu and specify the IP address of my virtual machine. The samba share will now be mounted in /Volumes/IPOFYOURVM. When I create a new project in Eclipse, I uncheck the default location and choose to create the project on my virtual machine. tah-dah

Eric's picture

For PHP development, I use Eclipse and the PDT Plugin. I always use the "update manager" functionality of Eclipse to install my plugins. PDT has some dependency issues, so here's how to get it installed...

First, add the following update sites...

- EMF - http://download.eclipse.org/modeling/emf/updates/releases/
- GEF - http://download.eclipse.org/tools/gef/update-site/releases/site.xml
- PDT - http://download.eclipse.org/tools/pdt/updates/site.xml
- WTP - http://download.eclipse.org/webtools/updates/

The dependency chain goes as follows:
PDT -> WTP -> GEF -> EMF

Start by installing the EMF plugins required by GEF...

EMF -> EMF SDK 2.3.2(EMF + SDO + XSD)
- Eclipse Modeling Framework (EMF) - org.eclipse.emf.common
- Eclipse Modeling Framework (EMF) - org.eclipse.emf.ecore
- Eclipse Modeling Framework (EMF) - org.eclipse.emf.edit
- Eclipse Modeling Framework (EMF) - org.eclipse.emf.ecore.edit
- Eclipse Modeling Framework (EMF) - org.eclipse.xsd.edit
- Eclipse Modeling Framework (EMF) - org.eclipse.xsd
- Eclipse Modeling Framework (EMF) - org.eclipse.emf.edit.ui
- Eclipse Modeling Framework (EMF) - org.eclipse.emf.common.ui

Second, install GEF...

GEF -> Eclipse DSK R3.3.2 -> Graphical Editing Framework

Third, install WST...

WTP -> Web Tools Platform (WTP) -> Web Standards Tools (WST) Project

Finally, you can install PDT...

PDT -> PDT Features -> PDT Feature