Engine23
blogBannerImage
By Engine23

Setup Ubuntu 12.04, LAMP, PhpStorm, Adminer, SVN and prep for Magento

Part 1 - Ubuntu

  1. Download iso from http://www.ubuntu.com/download/desktop and burn it to a disc or you can use http://www.pendrivelinux.com/ if you have boot from flash drive support
  2. Stick in the disc, start your computer and press F12 during boot, then select to boot from cd ( this step may be different for your computer )

    The install will take a good 20 minutes..

  3. I highly recommend plugging in your laptop and a wired internet connection to get the updates and 3rd party software during install
  4. I go and figure out what updates I want to install at this point, as I havn't invested a bunch of time and depending on your hardware they could cause problems that are easiest to fix by reinstalling. You do this by going to the top right icon and "Software Up to Date". If you run into troubles with the updates, I recommend going into settings and turning off "Indepent updates" under other software and all but "Important security updates". Then trying all of the above again.

 

Part 2 - LAMP

  1. Install LAMP: sudo apt-get install lamp-server^   

    Don't miss the "^" at the end

  2. Create a user for web work:

    sudo adduser <yourusername> www-data

    sudo chown -R www-data:www-data /var/www

    sudo chmod -R g+rw /var/www

  3. Create vhosts folder to hold your sites - This is just because it is standard practice

    mkdir /var/www/vhosts

  4. Setup packages for Magento

    sudo apt-get install php5-gd

    sudo apt-get install php5-curl

    sudo apt-get install php5-mcrypt

    sudo a2enmod rewrite

    sudo service apache2 restart

Part 3 - Adminer because it's the most awesome php gui

  1. Create folder local.adminer.com inside vhosts with: mdir /var/www/vhosts/www.adminer.org

  2. Download adminer at www.adminer.org, place it int the www.adminer.org folder and rename it to index.php

  3. Setup the site-available

    cd /etc/apache2/sites-available

    sudo gedit local.adminer.com

  4. Change all "AllowOverride None" to "AllowOverride all" so rewrites will work, save and exit

    sudo cp default local.adminer.com

    sudo gedit local.adminer.com

    1. Add ServerName local.adminer.com just above DocumentRoot
    2. Change instances of /var/www to /var/www/vhosts/local.adminer.com
    3. Change ErrorLog file name error.log to adminer-error.log
    4. Change CustomLog file name access.log to adminer-access.log
  5. Setup hosts file

    sudo gedit /etc/hosts

    Add line 127.0.0.1 local.adminer.com, save, exit

  6. Enable site

    sudo a2ensite local.adminer.com

    sudo service apache2 reload

    Access adminer through firefox at local.adminer.com

    Create mysql user with full priviledges other than root for normal use.

part 4 - PhpStorm

  1. Before you install Java JD, remove OpenJDK, if you have it installed:

    sudo apt-get purge openjdk*

  2. To install Java do this:

    1. sudo apt-get install software-properties-common

    2. Add the PPA, and be careful not to do a typo on this step: sudo add-apt-repository ppa:webupd8team/java

    3. Update the repo index: sudo apt-get update

    4. Install Java 8:sudo apt-get install oracle-java8-installer
  • Download PhpStorm from http://www.jetbrains.com/phpstorm/download/index.html

  • Extract file

  • run /bin/phpstorm.sh inside the file

  • Install xdebug: sudo apt-get install php5-xdebug

  • Add xdebug.remote_enable = 1 to /etc/php5/apache2/conf.d/xdebug.ini

You can now use phpstorm's debugger with the bookmarks.

part 5 - setup subversion

  1. Grab SVN for version control: sudo apt-get install subversion

  2. Make directory for website: mkdir /var/www/vhosts/local.<custom>.com

  3. Checkout site: svn checkout https://custom.unfuddle.com/svn/custom/trunk /var/www/vhosts/local.<custom>.com

-Ryan