Slashdot Log In
Local Web Server For Web Development?
Posted by
timothy
on Tue Sep 02, 2008 09:06 AM
from the start-the-daemon dept.
from the start-the-daemon dept.
gwilymgj writes "I have been running Apache/MySQL for years using XAMP and WAMP on windows for web development. Recently I switched to using Ubuntu in VMware player, it is much faster and it also introduces me to a 'real' reason to play with Linux (been looking for a 'real' reason for ages). Are there any specific distributions which allow you to have a virtual webserver on your desktop? Any tips and tricks out there for this?"
Related Stories
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
all Linux distros allow this (Score:5, Informative)
You can run apache and listen only on your internal IP. There are plenty to choose from. I'd recommend openSuSE or slackware if you're brave.
Re:all Linux distros allow this (Score:5, Informative)
DragonTHC pretty much nailed it. Nearly every distribution of Linux, BSD, Solaris, <insert your favorite Operating System here> ships with a web server. The darn things are a dime a dozen and can be found on freeware websites, as example code (Java, Python, Perl, C#, take your pick), as part of webapp servers (e.g. J2EE), as programming assignments, etc.
The only real reason to run Apache in a VM is if there are specific applications you wish to configure before deploying them in a production system. e.g. If you're looking at deploying Wordpress or a web forum, you may want to try a test install before sending it to your live server. In that case, the best answer for which OS to run in the VM is: Whatever you're planning on deploying the app on.
Otherwise there is precious little difference between deploying a web server in a VM and deploying it on your desktop. (Regardless of what OS you use.) You can pick and choose to your heart's content. You can even run Apache, IIS, and J2EE on the same box without clobbering each other. (Just make sure you configure the ports to not conflict.)
Heck, I've caught myself running as many as three web servers simultaneously while doing development. (Don't ask. You probably don't want to know.) When I'm done with them, I just shut them down and forget about them until the next time I need them.
So go pick your favorite OS [distrowatch.com] and have fun. There's no need to shy from any of them, especially when you are using a virtual machine. And remember! FreeBSD is the Power to Serve(TM). </kidding!>
Parent
Re:all Linux distros allow this (Score:5, Funny)
To put it (slightly) more consisely:
Pick any distro.
Type "apt-get install apache" at the command line.
If that doesn't work, try "yum -i apache" (I think that's it, silly RPM-based distros).
If it's still not working, you may be running Gentoo. Don't worry, it will be OK. Type "emerge apache". Go make some coffee. Maybe see a movie. Come back. Should be done.
If that doesn't work, you're running Slackware. HERE BE DRAGONS!
Parent
Don't knock RPM/YUM if you've never used them ;) (Score:2)
Errmmm... that would be an absolutely and completely incorrect option to give to YUM. It's probably best to withhold giving advice about programs you've never used. The correct command would be:
yum install apache
See man yum for more details. Thanks to YUM the "silly RPM-based distros" (yes, I know it's a joke) have absolutely no problems with what people used to call "dependency hell" years ago. YUM is fast and easy
Re: (Score:2)
I have used YUM, it's just been a few years :)
Whoa, I guess a lot has changed!
I remember waiting so long for it to resolve dependencies that my (much slower) Gentoo machine could have already downloaded, compiled, and installed everything I needed :) Seriously, I'm glad to hear it's made progress. Back then, the only possible use I could see for it was as an avenue to install APT for RPM.
Re: (Score:2)
Oh, and incidentally, I believe I was thinking of "rpm -i [package-filename]". So that didn't just come from no-where. :)
Re: (Score:2)
Re:all Linux distros allow this (Score:4, Informative)
Or "apt-get install apache2" if you don't want to be in the web server stone age.
Parent
Re: (Score:2)
Oooh, yeah. I always forget about that and have to uninstall the damned thing. One of the few areas where Ubuntu's behavior isn't what I'd expect it to be. Make the nuts type "apt-get install apache1" or something. "apache" should mean "Apache 2"
Re:all Linux distros allow this (Score:5, Insightful)
Parent
Re:all Linux distros allow this (Score:4, Funny)
Gotta hate those apply fans. They're not happy until they've entered every competition and tried to get an interview for every job...
Parent
Re: (Score:2)
Why is parent modded troll, he has a valid point.
And, on top of that, Leopard's Apache doens't come with GD "out of the box".
Re: (Score:2)
Because buying a whole new computer, from any manufacturer, just to run a local web server is a ridiculous suggestion for the submitter's needs.
Re: (Score:2)
Nevermind, I was talking about the guy that dais "why would he buy a whole new computer just for a web server". it was modded troll. I've replied the wrong message. Anyway, he's not troll anymore...
Re: (Score:2)
Ahh... Ok. When I read your post he was no longer modded troll, which I guess caused my confusion.
Sorry for the mix up, it seems that you and I are in agreement after all.
Re:all Linux distros allow this (Score:5, Funny)
Translation: Women don't talk to me; they must be lesbians.
Parent
Re: (Score:2)
Macs come with a webserver installed and running at boot by default?
That sounds like a horrible idea.
OTOH, a single command (or a quick search->highlight->install in Synaptic, if you want the GUI route) will download, install, and give a best-guess default configuration for Apache in Ubuntu.
I'm betting it takes at least that much work to get the web server running on a fresh-out-of-the-box Apple machine, since I find it hard to believe that every single Mac out there is throwing away memory and cycles
Re: (Score:2)
Apache isn't running as default - you need to check the box marked 'Web Sharing' in the 'Sharing' panel of System Preferences to get it to run.
Getting an OpenSSH daemon to run is similarly complicated - there's a 'Remote Login'
Re: (Score:2)
Note though that the built in Mac apache is compiled in 64-bit mode but PHP always tries to compile to 32-bit mode. So if you try to upgrade the PHP module, you will get errors. The way around this is to force PHP to use the 64 bit architecture (but not darwin, you have to use a generic 64-bit), or recompile apache in 32 bit mode. You'll have to do the same for any shared modules that interact with Apache on the Mac.
Re: (Score:2)
They come with a webserver installed and ready to run at boot by default. You've gotta hit the Enable button first =)
Re: (Score:2)
No.
I was responding to the implication that Apple computers had something "out of the box" that was identical to what I was talking about, when they don't.
On many Linux distros, including most of the popular ones, it's a couple clicks or one line in a terminal to both install and start running at boot an apache webserver. I was responding to, "Or
Re: (Score:2)
Just a small detail: You don't "install" the OS when you get a Mac. You plug it in, your power it on, it works.
So yes you are right, Apache is taking space on the hard drive of every Mac user (unless they deleted it). But enabling Apache is a simple checkbox, too. How much room does Apache take, an
Re: (Score:2)
Oh, right. Duh. I guess it's just that most of the times I'm in contact with OSX, it's to install it or upgrade it :)
Re: (Score:2)
Or: buy a Mac, and it works out of the box.
So wait, a Mac comes with apache installed and active by default? That sounds like a pretty dangerous security hole.
Re: (Score:2)
Re: (Score:3, Interesting)
It's kind of hard to understand why, if he already had XAMP and WAMP, he'd want to be using anything else as a simple development environment. For testing prior to deployment a VM is great; even better—if downtown would actually cost you enough money it's worth doubling up—get a second hosting just like your production one and call it staging.
Also, it's worth pointing out that Gentoo has great support for CMSes and similar things via the webapp-config command. It took me a few tries to realize h
Why virtual? (Score:2)
Just install whatever webserver you were going to use. If you're nervous, configure it to only listen on localhost.
Er, LAMP? (Score:2)
LAMP is supported in most (if not all) GNU/Linux distributions, and it is certainly supported in both the server and desktop versions of Ubuntu.
Re:Er, LAMP? [sic] (Score:2)
Why the single P? I'm pretty sure it's XAMPP, WAMPP, and LAMPP.
Also I second LAMPP. Since you're already familiar with XAMPP, LAMPP will not take you long to get used to.
Re: (Score:2)
IIRC, the original acronym was LAMP-- Linux, Apache, MySQL, and PHP*, which is a completely usable setup as it is. Perl* (the extra "P") is often found in most _AMP packages, so-- especially when referring to an offering or package, as opposed to a requirement-- _AMPP is used.
* Or is that the other way around? Did the "LAMP" terminology arise with Perl or PHP?
Define 'virtual webserver'. (Score:4, Informative)
There's nothing wrong with running a local-only web server. I do it all the time -- just bind it to localhost, rather than in_addr_any, and no one else can see your development system.
I have no idea what you mean by 'virtual webserver' in this context. If you're attempting to run virtual hosts through a local web server for development purposes, you can adjust /etc/hosts (or whatever the mechanism is on your OS) so that the domain names point to 127.0.0.1, and your web browser will send the Host header.
Re: (Score:2)
And if you have a static IP and your router/firewall supports NAT (which doesn't these days), you could even access your development site remotely through a proper DNS name.
Depending on your needs you'll want to add some security/safety measures, which can be as little as a local robots.txt file such as:
RewriteCond %{HTTP_HOST} (dev|localhost).example.(.*) /robots.local.txt [L]
RewriteRule ^robots.txt
or a proper authentication system.
How more virtual can you get? (Score:3, Insightful)
Sounds like you already have what you're asking for. I run a full linux web dev environment in vmware on windows. It's very convenient, having its own IP address and saving me the hassle of running a separate machine. I have my web folders accessible through samba and can experiment freely without worrying about botching anything up.
Am I missing something about the question?
what i like about vmware (Score:1)
What i like about vmware is that i can set up a server environment on my desktop in vmware using windows2003 server, and run it as is. This allows me to develop the code for web dev in vs2005 and then try to run it on the server as is, this will also bring up any issues should there be any that could be unforeseen as a developer using his own machine, therefor letting me know what needs to be configured on the server to run before giving it to my client.
In your case, i imagine the same applies, however it i
Why not use a real one? (Score:2)
Run Apache (or whatever else you intend to use), set it up to listen only on localhost, and you're good to go. Admittedly, distros could make this particular setup a little easier, but it's been possible for years.
It's more the webserver app than the distro (Score:4, Informative)
> you to have a virtual webserver on your desktop?
> Any tips and tricks out there for this?
I use FreeBSD myself, it's rather well documented (in my experience most of the documentation is better than or on par with Linux), even if the tools aren't as slick and GUI.
That being said, in the end, the OS choice really should be that of the user. I've used Apache/MySQL in Windows, Linux and FreeBSD. My preferences are towards Windows and FreeBSD. Both (for me) are easy to admin, and while the latter is incredibly fast, the peformance hit with the former on small scale testing isn't that bad. I tend to be more concerned with ease of administration and the UI performance because on any of the operating systems, the web server performance is more than sufficient for small and medium scale testing (depending on hardware, YMMV).
That being said:
(1) Jailed/Sandboxed/VMed environments are a nice security touch to help keep your system safe.
(2) If MySQL and Apache are on the same server, you may want to turn of networking and use local sockets for some extra security. This is well documented in the config file comments.
(3) Likewise, you can turn off the remote access for Apache. If you are using a jailed/sandboxed/VM environment, then this may not be an option unless you want to open the browser from within the jail/sandbox/VM.
Currently I'm playing with some stuff (a friend wants me to get [not so-]Zen Cart working for him) on my desktop. I have apache/php/mysql in a jail under FreeBSD. I'm behind a firewall, so I don't bother much with port restriction on Apache. With PHP I used the secure/recommended config file, and with mysql, I turned off networking (using a local socket). There are instructions for generating self signed certificates using OpenSSL if that has relevance to your work. It's not hard, and google can get you what you need quickly, if it's relevant.
Hope that helps.
Environment (Score:1)
So what's wrong with XAMP (Score:2)
When I read the title, I thought, "XAMP". It's really the easiest way there is. I can't imagine what you'd have been doing with it to make it slow for development work.
And then, VMWare. Sounds like you have it working. What do you need it to do, that it's not already doing?
Use whatever you deploy to in production (Score:2)
If your servers are running on Ubuntu use that. Just use whatever most closely matches your production environment. One less potential source of problems.
Then share out your needed directories from the virtual machine via samba, edit up your hosts file, and away you go.
http://paulmarsh.net/rails-development-under-windows-xp-or-osx-or-any-other-os [paulmarsh.net]
Haven't tried it but for your SQL backend.... (Score:2)
Development Environmnet on EC2 (Score:1)
Might as well take the big step (Score:2)
If you have a spare machine and only a few machines on your home network, you might as well have a dedicated machine for development.
Any distro will work... if you are familiar with Ubuntu already, that's fine. Install Apache, MySQL (and/or your preferred database), your scripting languages of choice (PHP, Python, Ruby, Perl, etc), and whatever else you need. Learning real system administration never hurts.
I have my dev box set up to use vhosts. I handle DNS via HOSTS files on each box, as I only have ab
All allow this (Score:2)
http is peasy u lamer : (Score:2)
bash [blogspot.com]
rc [proweb.co.uk]
or python, or perl or awk or anything really.
If you want to learn, write your own, http isn't that hard unless you plan to get fancy
I don't get it (Score:2)
You've been using apache and mysql for years, yet you've been looking for a "real" reason to use linux for years? You had a couple good ones right there, man...
As for the phrase "virtual webserver on your desktop": That means nothing. You want a real (ie, "non-virtual") webserver, because you want to serve files. You don't want a webserver anywhere near your desktop, as apache's not a GUI application. So I suppose the answer is "No, you have to have a real webserver, but you can probably access it via a
Linux software (Score:2)
Seriously, why does the post have to be so...complex? It's called Apache. It's a web server. You want to run it on a virtual host or run the program virtually, that's your business.
Funny, we do the opposite (Score:3, Interesting)
Run XP in Qemu/kvm on Debian. I guess windows give you IIS development.
I vote "whatever" with many. You've used Ubuntu, stick with Ubuntu.
Two Words: Virtual Appliance (Score:2)
Most distros ... all the major ones (Score:2)
Most Linux distributions include some kind of web server. By default that will be Apache on all the major ones. Some will include LIGHTTPD, too, which you may be able to consider using instead of, or in addition to, Apache. Just do a minimal server install of a favorite major Linux distribution (or BSD) in a virtual machine. Do two virtual machines while you are at it, and you have an extra one to experiment with while not disrupting your web server testing.
Grandma's LAMP (Score:2)