Beginner here, stuck wondering what I need to do to learn development in different web environments. Say, for instance I want to play around in PHP & MySQL. But I also want to try things with Ruby on Rails and maybe even server things with Python. Do I need a different environment for each platform? Am I required to have a virtual machine to do so? Is it easy to uninstall and start over for each endeavor for a Windows 7 machine?
Or, better yet, would it just be easier to throw Linux in a virtual environment?
I started off with php and mysql, it's a lower-level then the rest of the environments like Django and Ruby on Rails; so it's much easier to understand what is really happening.
If you want to get into web development, php is a solid foundation and has easy bundle installers such as WAMP, and has a massive community.
However if understanding the core of web applications is not your goal and you want some magic to make your application quicker and speed through development, you would want to use a web application framework environment, my favorite here is Ruby on Rails.
Ruby on Rails is a little difficult for the newbie to setup, it typically sucks running in Windows, so you'd be better off with an install on top of a UNIX environment such as Linux, Mac OS, BSD.
If you do want to go the rails route, I suggest installing Ruby with a ruby manager called RVM which is very helpful for playing around with Ruby environments.
Django is a good solid framework but it's playing catch up with Rails and in my honest opinion, doesn't have all those power magic that Rails has such as database migrations.
It is theoretically possible to install all of these on a single web server instance, but I imagine it might be an awfully hard thing to do. (Update: As Col. Shrapnel says, it is not impossible though. See the comments.)
You could take a look into the BitNami stack. It consists of installable packages that promise modularity (i.e. the possibility to add languages like PHP and Ruby to one server instance) and pre-configured virtual machines for the most popular development environments.
I would go the vitual road (VMware or virtual box). Multiple enviroments have a lot of dependencies, so its just much much easier with vitual hosts.
Related
I've finally committed to really learning the software design process correctly in order to advance my skills and grow my business. This means embracing version control (git), setting up a development-staging-production environment and keeping these environments as similarly configured as possible.
I'm getting really caught up with the last step, in picking a solution to automate and sync my server settings. I've looked into Chef, Puppet & Fabric, but for my purposes they all seem overly complex. I am:
Developing a small web app on a single server
Will be developing in a LAMP environment with intermediate PHP & UNIX skills
Won't be heavily modifying environmental variables (primarily php.ini, apache configs)
I would appreciate any recommendations on solutions that would be easier to implement than mastering the complex Chef environment or learning Python to use Fabric. I can do this if necessary, but am hoping there is a more basic / elegant solution given my very simplistic needs.
In the company I work for, where we have more or less the same needs, we just setup a couple of bash script.
Basically it sets up the git repo (local, and distant bare), install apache2 and PHP5 (and some php extensions), configure the apache's vhost, php.ini, install frameworks and bootstrap project if needed (for us it's symfony).
We have another script, that fire some EC2 instance, run the previously mentionned script, launch the test suite, and download the report of these scripts.
Chef & Puppet works well, but it's a little overkill, unless you have many projects that runs in the same time.
Edit :
If you want to run a script after commiting/pushing (like deploy to staging/pre-production server, launching your continuous integration build, etc), there's a way to do this using git call post-hook, see Deploy a project using Git push
I'd strongly recommend having a look at Ansible for this purpose.
It is a full solution, which means it can handle configuration management, deployment and so forth. However, it is far easier to learn in my experience than Chef or Puppet as you can start by doing basic shell command execution and move on from there.
There's no need to learn a new language; all the configuration and specification you would be doing is done in YAML, which is just structured text.
Overall, Ansible will give you much of what Chef or Puppet will at your level and hopefully you will find it more straightforward to get started with.
If you're serious about professional web development, I would strongly recommend taking a second look at Chef. It works really great for us (me and my co-workers). I know it may seem like overkill, but in my opinion, the advantages far outweigh the learning curve. It's a lot more work to try to maintain different server environments (and local development environments among co-workers). Plus, Chef makes it super easy to install Apache, PHP, and MySQL since there are already cookbooks/recipes available.
Also, make sure you check out Vagrant. It works with Chef and VirtualBox, making it really simple to set up a local development environment.
Also, if you're working on a Zend Framework project, you may be interested in the Zend Framework Boilerplate project which is an all-in-one LAMP development environment which uses Vagrant.
For Simple LAMP Development you don't need anything at all. It is not that simple development can't be automated, it's because for simple development it is usually sufficient (easier and faster) to write some scripts yourself (even in Python).
When you realise that your custom scripts are hard to maintain or not enough, you are ready for tools like Fabric (shell command automation) and/or Chef/Puppet (server configuration management). They are not easy to learn, because system interconnections that they are managing are not simple (which is not your case, obviously).
For your single server, I'd say README + Mercurial (Git if you need GitHub) plus some symlinking should be more than enough to manage configs, sources and server setup. For automation and deployment just write a script that uploads your site to FTP/SSH, restarts server, executes tests, whatever - you decide. That is Simple Deployment for Simple Development. If you'd rather avoid writing PHP for that and don't know shell - then Fabric will save some time for you.
Once your scripts are ready, you already know your problems, you can learn Chef/Puppet in background to see if it is worth complicating things for your environment.
If you choose to try Chef - don't start with Chef Solo - it's a poisonous snack for a starter - use Hosted Chef + Client - it is free for your setup. Can't say anything for Puppet - I chose Chef because my mom said I need to know how to cook.
I started web development some time ago, but have invested essentially all my time in learning PHP, MySQL/SQLite, (X)HTML/XML (XPath, XQuery, XSL), etc. I went with an out-of-the-box XAMPP install, everything was pretty straightforward, and I could focus my learning on languages.
Now, however, I'm looking to learn Ruby and Python (and more Perl) but to my dismay, have discovered that I know essentially nothing about Apache configuration, or any related tasks associated with setting up an environment for embedded PHP, Perl, Python and Ruby.
I posted recently a question that I thought would take me in the correct direction. Having read the mod_wsgi and mod_rails docs, I'm more confused than I was to start.
I'm running Windows 7 x64 with an existing XAMPP installation, just grabbed Ruby and Python, just installed NetBeans; and I'm wondering:
Should I start with a fresh Apache install, or is XAMPP fine to pile additional modules on?
Where can I find some information about configuring Apache to support these modules? I'm thinking step-by-step to build an environment that supports some of, all of, or more than the aforementioned languages.
I suppose my question can be summarized to; What are some suggested reading/learning resources for configuring an Apache based multi-language web application development environment?
I hope this question isn't regarded with high subjectivity or generality; I'm just lost and don't want to waste time staring blankly at configuration files or the like.
I really appreciate any insight, and forgive my noob factor. I am surprised I am as unfamiliar with this territory as I am, and quickly need to change that.
I would recommend the following:
Make your home in the Ubuntu environment within the VM you mentioned
Essentially all of the technologies you mentioned started out in Unix-based systems, and, while the playing field is leveling, there are still significant advantages to developing with these technologies in a Unix-based OS (such as the Ubuntu install you mentioned.)
Additionally, Ubuntu is very well documented online, has active forums, and has very nice install systems (apt-get, aptitude.)
Learn Nano
You can use other IDE's or text editors, but Nano is really, really easy to use, so you can focus on learning the technologies you're interested in, not a complex text editor such as vim or emacs (which are both fantastic, but learning sessions in and of themselves.)
Get yourself a cheap cloud server to pound on
Many companies offer great cloud servers. The nice thing about this is that you can play with the every aspect of the environment, including the networking capabilities, such as getting a firewall running, etc.
For instance, Rackspace Cloud Servers work great and the Wiki pages walk you through a vast number of installs and configurations (I just pointed you to the Ubuntu docs cuz that's what you mentioned already running):
Rackspace Cloud Server Wiki
Build up your web server from scratch (and keep a log of the build steps, so if something doesn't go well, you could redo things quickly.)
Start building (and breaking) your next great app
Start making a cool app using the technology of choice. If you want to focus on Ruby next, crank out an ROR app, or even dig down and use RACK to set up you're own baby framework for handling web requests:
Rack: a Ruby Webserver Interface
Or, if python is your next learning project, try out Django, or even jump down to CherryPy for a low level web server implementation that helps you see all the moving parts:
CherryPy
Join the mailing lists of the technologies you're most interested in
Mailing lists provide great insights into the strengths and weaknesses of technologies. Just joining a list to listen to the daily banter can significantly help your understanding of the technology and the challenges that you'll likely face in the future.
These are all things I've done (different language focuses, but same techniques) and they've helped me greatly. Hopefully, they help you, too :) Happy coding!
Just an additional info, XAMPP has mod_perl included since version 1.7.2.
To setup this quickly on Windows, already prepared stacks built by BitNami can help:
Ruby + Rails
Python + Django
I've spent some time now developing a web application in php. It has mostly been just for the fun of learning as a side project, but the app now has a few users which I don't want to upset by breaking things as I develop.
At the moment, I have a very rudimentary method for managing the development - I use a text editor (ultraedit) to write the code and use its built in ftp to upload the files to the server. In terms of version control I have 2 domains, and only push files to the "live" domain when they work, but that's it. The domains are hosted on a cPanel shared hosting site which I have some doubts about its ability to handle even minor spikes in traffic. I looked at slicehost yesterday for something more scalable but that looks like a bit of a learning curve from where I am now.
I know I could do better than this, but where to start? I think I need advice on three things
1 - code writing tool
2 - version control / management
3 - scalable hosting
I've deliberately asked these in the same question as I'd like to know if one choice impacts another. Is there a good integrated solution?
Thanks in advance as ever.
Each part of your question has been answered before. The list below lists some of the common tools to use and links to appropriate searches on StackOverflow. There is no all in one package and going into details about these tools in one question is out of scope, so I am afraid you have to do some digging:
SVN, Git or Mercurial
UnitTesting (PHPUnit or SimpleTest)
Continuous Integration
Phing (for deployment)
phpqatools.org
Netbeans or Eclipse (for an IDE)
Disclaimer: list is not meant to be complete and order is not important
There is a lot going on here. I'll give you my two cents though.
I used to use ultra edit. Now I use netbeans, its a fully integrated development environment and it makes my life soooo much easier. Its free too. I can't imagine ever going back to UltraEdit. Also, which brings me to number two, netbeans has SVN and CVS integration
I would use subversion for version control. In my experience it does everything you need for version control. Others use ones like git and mercurial, but I think SVN is widely supported and easy enough to set up. As far as pushing code to the server, i've begun using svn for this too. I first ssh into the server and checkout the code into the public_html directory, and then set up an alias to do svn updates through the command line... its way easier than ftping in my opinion. There are other deployment methods, but i've never used them. see this question:
What is your preferred php deployment strategy?
obviously shared hosting is not going to handle traffic as well as a dedicated server. But there are lots of things you can do to improve performance before moving to a dedicated server. Check out this article: http://developer.yahoo.com/performance/rules.html
It seems that you're after a robust deployment strategy as opposed to a development one. But, correct me if I'm wrong.
In terms of 'code writing tool', and
IDE choice is a subjective
discussion. Feel free to work with
the one you are most comfortable
with, for me this is Netbeans.
As for a deployment strategy, I think it was best summed up in this answer.
Your point about scalable hosting is fairly broad. We will need much better forcasted metrics to give better advice. However, for now, if scalable hosting is a worry then maybe look into some sort of Cloud Hosting.
Have you looked at using wamp/xamp/mamp/lamp for development locally? Uploading via ftp for every change is a pain.
You could do that for local and see that everything works, then push it to your test domain and run through it again and then finally push live.
Might want to look at something like SpringLoops for doing your version control - this has the advantage of doing the deploy and then if it goes pear shaped you can revert it (free account gets 3 deploys a day).
I wouldn't worry about scaleable hosting just now, just focus on the site and the coding, you've only got a few users - wait till it starts becoming a problem before moving (however, I suggest looking into options) but don't try and get all cloud ready - might not ever be a problem.
ps, go with Linode over Slicehost.
I think use Aptana Studio ( http://www.aptana.org ). It is an Eclipse based IDE with all the tools you need integrated in it. It has integrated PHP development tools, GIT or SVN for version control.
I've used shared hosting as well. Once an other site on the same server had DoS atacks and my site became unreachable as well. Otherwise it could work in reasonable speed after some optimization. It served 1000-3000 users per day.
Dedicated servers are much better. Or you can use Amazon web services. I know they are more expensive.
1 - code writing tool
Zend Studio. I would recommend Linux as well if you are going to use linux servers.
2 - version control / management
SVN + phing (if you are going to build serious applications).
3 - scalable hosting
Amazon or RackSpace.
For your editor, just use what you are comfortable and productive with. You most definitely should have version control in place. You never know when you need to rollback a version or two.
I always keep at least 3 versions on the production server. I use symlinks to point the web server at the latest version. If there is a problem, you just need to recreate the symlink to point to an older version.
As for shared hosting, you'd be surprised out how much bandwidth you can get. I have a $10/month shared host that gets about 500K page views a month. Generally, it's not that your shared host can't handle the load, it's that the hosting provider puts too many "shares" on the same server. So it depends on how much resources everyone else on the same server is using. If you are having issues, you can always ask to be moved to a different server.
I have an existing CakePHP that runs on a LAMP environment and need to install it on a USB drive for mass public distribution.
There are a few requirements:
Protect the source code
No installation required
Windows support essential
MAC & Linux would be a bonus
Must run offline, without Internet connection
Ability to sync with server for data transfer and updates
I have conducted a large amount of research into the options and am keen to learn what other developers think.
Potential solutions:
- Flash / XML
- Adobe AIR app
- USB webserver (Server2Go, Portable Apps XAMPP)
Has anyone used any of the above, any comments would be greatly appreciated.
Thanks
Similar thread here :
Portable USB Webserver
If you ask me, XAMPP should do, because it offers a "plain unzip" version. There's lots of variety out there - Bitnami also offers a nice bunch of stacks, although they may not be good for this particular task.
To keep the same scripts in both Windows and Linux, you could consider using UnxUtils which is a port of all common Linux commands. This will be very handy if you are good at Linux bash shell scripting but not good at Windows batch files.
Protecting the source code is a bit troublesome. Do you really, really need to do so? Because there's a ton of great open source code out there which already does practically everything in most common business domains - sourceforge.net.
And if someone's taking your code and calling it their own, you can just name them on the internet if you can prove it. That itself will be bad publicity for them. That said, I obviously don't know your specific need. So that is just my opinion.
You will have problems with this, no matter how you go about it. Each step is a little more unusual it seems.
You'll need to use a source code obfuscator to protect your source. I recommend the one by Zend, not from experience, but because Zend makes awesome products. Never used a source protector myself.
You'll need three custom LAMP/MAMP/XAMP installs, one for each target OS. They should point to a directory that is shared on the USB drive. Make sure you configure them to use an unprotected port, otherwise the user will need admin privileges to run the server software. And getting the server stuff up and running will likely result in a few hiccups as well.
I would actually recommend finding something that will allow you to distribute a binary, or something like an AIR app that is intended for this type of distribution. You may have to rewrite lots of code, but it'll be easier to fix than all the niggling little install errors you'll see on the client end. To package scripts into binaries without rewriting stuff, check out http://www.scriptol.com/apollo.php and similar products.
But I'd suggest you make a standalone app in adobe air that will sync with your server (maybe even some google gears integration, to have it function offline). Don't try to force a PHP app into this distribution model, it'll create nightmarish problems.
This is what I used to run a CakePHP app from a DVD. Worked on USB too (while I was still developing it).
http://www.server2go-web.de/
Server2Go is a Webserver that runs out of the box without any installation and on write protected media. This means that web applications based on Server2Go can be used directly from cdrom, a usb stick or from any folder on a hard disk without the hassle of configuring Apache, PHP or MySQL.
Server2Go allows you to create a standalone working web site or PHP application on a CD-ROM.
It's really nice.
You can use MAMP for Mac, you'll just need to edit the config to properly point the sites directory.
however you would have the problem that the mysql db would not necessarily work with windows. if you switched the db to sqlite, you could sync the sqlite db file fairly easily.
XAMPP would work for the windows side
sorry dont know about the linux side.
Out there is a CakePHP InstaWeb Server
http://bakery.cakephp.org/articles/view/the-cakephp-instaweb-webserver
that runs on python and doesn't need an installation. This plus some additional goodies should get you already half the way.
I am doing a clean install of OS X Snow Leopard and I was wondering what people think should go into the ideal web developer environment?
Can I get a good rundown of things you would do when setting up a clean system?
My main focus is HTML, CSS, PHP, and Actionscript work. But I would also like to dabble in other languages and frameworks as well (including Ruby and Python, Rails and Django).
The main goals
Cleanly and rationally organized
Efficient to add new frameworks, project source code and packages
Easy to disable components, frameworks and parts of the environment
Ability to host multiple projects simultaneous without too many conflicts or dependencies
Effective source control over all projects and environment configurations
Somewhat idiot proof for a non system administrator, but sufficient power to customize
Easy to isolate and debug environment configurations.
I am aware of MAMP and XAMPP. And I use Git.
I was thinking about using macports for setting up various tools and packages. I also want to cleanly manage frameworks. But I also want to be able to experiment with unknown frameworks without fear of cluttering or breaking my normal day to day working environment.
I know the command line but I am by no means a system administrator. With all that said what would you recommend for managing the hosting environment? Apart from VM are their tools for conveniently sandboxing configurations (different versions of frameworks, databases, webservers, etc) and linking these to a particular client's project code?
It seems like macports by putting everything in /opt is the way to go. I don't have to worry about mucking up the system binaries. And if I make a mistake or want to start over I can blow away /opt anytime I want to.
Are there tools to manage changes to your local web environment? For example if I install a particular package can I conveniently see "what has changed". Basically a way to do a diff on part of or even the whole system to know what implications are in place as I add new a new framework or update a package like PHP, Ruby, Perl, MySQL, Apache, etc. What about snapshots and backups of the configuration? can I version control this? If I setup PHP and Apache in a specific way to work with a specific clients hosting environment needs can I undo that configuration to quickly switch over to a different project?
Feel free to mention or link other related questions or answers if this question has any overlap. And I am not sure if this question should go on serverfault or superuser. But I am mostly interested to hear what other web developers have to offer.
Also, in particular I am curious to learn from people's mistakes. The main gist is, if you were starting over what would you do differently? Knowing what you know now?
For snapshotting entire setups including servers VM's would be the way to go. In Linux I often use chroots to isolate an install, but then the Apache ports etc are still shared.