mack - 4:38 pm on Mar 9, 2010 (gmt 0)
Today I feel a lot more comfortable using the OS than I did yesterday. On my laptop Linux is simply used for surfing and email. I have had to set the desktop up in a way that allows me to be productive. Because I do a lot of development work using PHP/MySql it was vital that I had not only the tools but also the development environment set up. On my windows machine I achieve this by installing Xampp. The same option is true on Linux, but I decided to see what I could install through the package managers that are included along with Ubuntu.
The Ubuntu distribution comes with two package managers. “Ubuntu software center” and “Synaptic package manager” Ubuntu software center reminds me a lot of an on-line apps store. Similar to what you would use on an iPhone or through the Android market to obtain apps. You browse applications by category and choose that apps you would like to install. It also displays your installed apps with the option to remove them. When ever you install an application the package manage detects any dependencies and installs they along with your chosen app, The Ubuntu software center contains popular applications. However if you are looking for something more specialized then the Synaptic package manager is where you should look. I simply typed in apache and it located apache 2 and its dependencies and market them to be installed. I did the same for PHP and MySql. I also installed Phpmyadmin. The install went very smooth and after it had finished I was able to go to localhost and see the test page.
By default Apache creates its document root at var/www For a single user system this wouldn't be a problem. All I need to do is create the root of my work at that location, or so I thought!
Ever tried being logged in as a user and trying to save anything that far down the file system :) It wasn't a fun experience. It was possible using shell, but not practical. What I did was create a virtual host entry to point www root to home/mack/Public_html There are GUI based tools that will do this for you, but the entry below works fine for me.
Now when I browse to localhost I see the contents of home/mack/Public_html. Note this directory doesn't exist by default and I had to create it. I now have a work space and an HTTP server to display it. Now its time to check that PHP and MySql are working as billed.
localhost/phpmyadmin brings up my standard phpmyadmin page and I am able to connect to the DB as normal.
I then ran an extremely complicated php script :)
echo"Yay! php is working";
This echoed my text and displayed the system info related to PHP. As far as I am concerned I now have a local development environment set up and running. Now its time to actually do some work.
A new site that I am working on is PHP/MySql based. The project requires a fairly simple CMS like system so I guess its time to get to work, but first I need to work out what tools to use. On Windows I general use Expressions Web. I like it because it uses one interface for multiple languages. I also use notepad and have experience with “PHP Edit” and various other text editing packages. Under Linux in the past I have used “Quanta “ and “Blue Fish” Both of these are available through the Ubuntu software center so I have downloaded and installed them.
Everything on Linux comes down to personal choice and for me I like the interface that Blue Fish offers. The simple menu system for inserting code snippets is impressive. For example if you want to connect to a MySql database from within Blue Fish all you need to do is select the PHP tab, select MySql > Connect. Fill out the blanks and it places your connection string within the code. Bluefish also works well for editing/creating HTML/CSS, but you do need to have an understanding of what you are doing. There are menus for adding code snippets, but the majority of your work will be hand coding. I don't think there is a true WYSIWYG HTML editor for Linux, but perhaps that isn't a bad thing. You learn as you go.
Today has been mainly set up. Getting the Linux OS set up as a development environment. But I did manage to get a few hrs of work done. I now have the rough layout for the site, I have the database structure set up and have done a little bit of work on the administration side. Today wasn't quite as productive as I had hoped, but I think the time spend getting things working correctly was time well spent.