Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Local Web Server For Web Development?

timothy posted about 6 years ago | from the start-the-daemon dept.

PHP 82

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?"

cancel ×

82 comments

Sorry! There are no comments related to the filter you selected.

all Linux distros allow this (4, Informative)

DragonTHC (208439) | about 6 years ago | (#24842467)

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 (4, Informative)

AKAImBatman (238306) | about 6 years ago | (#24842643)

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!>

Re:all Linux distros allow this (4, Funny)

Fallingcow (213461) | about 6 years ago | (#24843281)

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!

Re:all Linux distros allow this (-1, Troll)

Otter (3800) | about 6 years ago | (#24843709)

Or: buy a Mac, and it works out of the box.

Re:all Linux distros allow this (4, Insightful)

theelectron (973857) | about 6 years ago | (#24843933)

It sounds like he already has the hardware, why would he buy a whole new computer just for a web server? You sound like an apply fan with the 'just buy a new one' upgrade/install path.

Re:all Linux distros allow this (0)

Anonymous Coward | about 6 years ago | (#24844267)

But if he buys a Mac, he'll be "cool" and isn't that the real reason we all use computers? For the pink ipod toting chicks?

Re:all Linux distros allow this (0)

Anonymous Coward | about 6 years ago | (#24844353)

The pink iPod toting chicks already have girlfriends of their own. You can recognize them by the matching Birkenstocks.

Re:all Linux distros allow this (5, Funny)

Anonymous Coward | about 6 years ago | (#24844653)

Translation: Women don't talk to me; they must be lesbians.

Re:all Linux distros allow this (3, Funny)

dintech (998802) | about 6 years ago | (#24844341)

You sound like an apply fan

Gotta hate those apply fans. They're not happy until they've entered every competition and tried to get an interview for every job...

Re:all Linux distros allow this (1)

chord.wav (599850) | about 6 years ago | (#24844473)

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:all Linux distros allow this (1)

bonehead (6382) | more than 5 years ago | (#24846387)

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:all Linux distros allow this (1)

chord.wav (599850) | more than 5 years ago | (#24849103)

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:all Linux distros allow this (1)

bonehead (6382) | more than 5 years ago | (#24849245)

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 (0)

Anonymous Coward | more than 5 years ago | (#24851243)

That doesn't mean he's a troll- he's just stupid.

Re:all Linux distros allow this (0, Offtopic)

poopdeville (841677) | about 6 years ago | (#24844767)

It sounds like he already has the hardware, why would he buy a whole new computer just for a web server? You sound like an apply fan with the 'just buy a new one' upgrade/install path.

Because he might need a new one anyway? Because he's using Windows for "unix-ish" development (blah, putty)? Because used Mac Mini's are overpowered for this application, and very cheap? Because somebody else who needs a new computer and development environment might be reading?

Why bother saying anything at all? You sound like one of those "talkers" with your "talking".

Re:all Linux distros allow this (0)

Anonymous Coward | more than 5 years ago | (#24846137)

Well, I say the submitter should buy VW Passat even though that has nothing to do with his question, because someone reading this might be contemplating what make and model of car they should use to get to their programming job.

Re:all Linux distros allow this (0)

Anonymous Coward | more than 5 years ago | (#24853727)

Passats are nice, but not particularly relevant to development environments. OS X, on the other hand, is related to development environments (since it is one). Let us know when VW ships Passats with Apache, vim, and the rest.

Re:all Linux distros allow this (1)

Fallingcow (213461) | about 6 years ago | (#24844689)

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 on a webserver by default, even if it's being used for video editing.

Re:all Linux distros allow this (1)

Ford Prefect (8777) | about 6 years ago | (#24845455)

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 on a webserver by default, even if it's being used for video editing.

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' box to click. Basically all the available-but-not-running desktop servery stuff is like that...

Re:all Linux distros allow this (1)

inKubus (199753) | more than 5 years ago | (#24854375)

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:all Linux distros allow this (0)

Anonymous Coward | about 6 years ago | (#24845657)

Macs come with a webserver installed...

Yes.

...and running at boot by default?

No.

That sounds like a horrible idea.

It would be, which is why they're not doing it.

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,

Just my opinion, but I think opening System Preferences and turning on a Apache via a single checkbox is at least slightly less work; less typing, less clicking, less waiting.

...since I find it hard to believe that every single Mac out there is throwing away memory and cycles on a webserver by default, even if it's being used for video editing.

I find it hard to believe that anyone would believe that every single Mac is running a webserver by default. I think you are feigning ignorance in a troll attempt.

Re:all Linux distros allow this (1)

Fallingcow (213461) | more than 5 years ago | (#24847303)

I find it hard to believe that anyone would believe that every single Mac is running a webserver by default. I think you are feigning ignorance in a troll attempt.

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: buy a Mac, and it works out of the box." In point of fact, it installed out of the box, but it does not work out of the box, at least not in any way that is meaningfully different from how Apache "works" in, say, Ubuntu. I'll admit that the Mac way means maybe 30-40 seconds less waiting, but then again the Mac is wasting disc space by having Apache installed but disabled by default, not to mention that you *did* have to wait for it to install, it was just done during the system install--probably a wash, in other words.

There's no need for people to talk up Apple products at every single opportunity, even when it's wrong. In this case, it was even harmful to the Apple cause: "it [Apache] works out of the box". A) No it doesn't. B) if that were true, holy hell what is Apple thinking!

Saying "Or any Mac, which already has Apache installed, and you just have to enable it" would have been fine. We could then discuss which is better, if either. Whatever. The poster instead spread misinformation. THAT is what I was responding to. My feigned ignorance was no troll attempt, it was rather a form of reductio ad absurdum; I illustrated the statement's falsehood by expounding on what it implied.

Re:all Linux distros allow this (1)

Yvan256 (722131) | more than 5 years ago | (#24854419)

[...] but then again the Mac is wasting disc space by having Apache installed but disabled by default, not to mention that you *did* have to wait for it to install, it was just done during the system install [...]

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, anyway? I'd guess it's no more than one or two MP3 files, so who cares?

Re:all Linux distros allow this (1)

Fallingcow (213461) | more than 5 years ago | (#24854579)

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.

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:all Linux distros allow this (1)

Sunnz (1120513) | more than 5 years ago | (#24857011)

You don't "install" the OS when you get a Mac. You plug it in, your power it on, it works.

Actually, you power it on, watch the Welcome movie (compulsory), fill out some forms, THEN it works.

Going to the shops, buy a Mac, then come back doing the above, is going to take more money and time then just insert a Linux/BSD CD and startup apache.

Re:all Linux distros allow this (1)

log0n (18224) | more than 5 years ago | (#24845719)

They come with a webserver installed and ready to run at boot by default. You've gotta hit the Enable button first =)

Re:all Linux distros allow this (1)

isorox (205688) | about 6 years ago | (#24845431)

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:all Linux distros allow this (1)

Otter (3800) | more than 5 years ago | (#24847533)

No, Apache is open source so nothing can go wrong.

Re:all Linux distros allow this (0)

Anonymous Coward | about 6 years ago | (#24845119)

Thank you for making me choke on my cigarette in laughter.

Don't forget... (0)

Anonymous Coward | more than 5 years ago | (#24855165)

...to pay your $699 licensing fee you cock smoking teabaggers!

Don't knock RPM/YUM if you've never used them ;) (1)

crush (19364) | more than 5 years ago | (#24846059)

If that doesn't work, try "yum -i apache" (I think that's it, silly RPM-based distros).

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 to use these days. In some cases faster and easier than other package managers.

Re:Don't knock RPM/YUM if you've never used them ; (1)

Fallingcow (213461) | more than 5 years ago | (#24847465)

I have used YUM, it's just been a few years :)

YUM is fast and easy to use these days

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:Don't knock RPM/YUM if you've never used them ; (1)

Fallingcow (213461) | more than 5 years ago | (#24847515)

Oh, and incidentally, I believe I was thinking of "rpm -i [package-filename]". So that didn't just come from no-where. :)

Re:Don't knock RPM/YUM if you've never used them ; (1)

crush (19364) | more than 5 years ago | (#24853499)

Yup YUM has changed a lot over the years. Seth Vidal and friends have been constantly refining it.

Re:Don't knock RPM/YUM if you've never used them ; (0)

Anonymous Coward | more than 5 years ago | (#24935509)

See man yum for more details.

Sorry, no man yum for me.
.
.
.
.
Not that there's anything wrong with that.

Re:all Linux distros allow this (0)

Anonymous Coward | more than 5 years ago | (#24846457)

And on Arch Linux, it's:

pacman -S apache

Re:all Linux distros allow this (0)

Anonymous Coward | more than 5 years ago | (#24846805)

Ubuntu is even easier (not that the others are particularly hard), and will set up the entire stack for you (this is because its available on the server CD as an installation option).

sudo tasksel
choose LAMP server
hit... apply or ok or whatever.

Re:all Linux distros allow this (3, Informative)

Matt Perry (793115) | more than 5 years ago | (#24847923)

Type "apt-get install apache" at the command line.

Or "apt-get install apache2" if you don't want to be in the web server stone age.

Re:all Linux distros allow this (1)

Fallingcow (213461) | more than 5 years ago | (#24849831)

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 (1)

zunicron (1344365) | more than 5 years ago | (#24896661)

on redhat based systems, youd do apt-get install httpd instead of apache.

Re:all Linux distros allow this (0)

Anonymous Coward | more than 5 years ago | (#24962115)

Go Slackware!
If you download 'apt' for slackware, you can issue:

slapt-get --install httpd

But, slackware already has apache (and most other cool stuff) by default.

Re:all Linux distros allow this (2, Interesting)

mstahl (701501) | about 6 years ago | (#24843327)

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 how much more convenient it is. It just puts all the vhost stuff in a new file in /etc/apache2/vhost.d/ directory to reflect what it installed. Very convenient! I *think* it supports nginx too if you want to turn to the dark side.

Re:all Linux distros allow this (1)

the_denman (800425) | about 6 years ago | (#24843731)

Or you can configure it so that each vm has it's own ip address and then there are no port conflicts (assuming that you have a server per vm)

Re:all Linux distros allow this (0)

Anonymous Coward | more than 5 years ago | (#24848287)

I suggest this Linux distribution:

DVL 1.5 [damnvulnerablelinux.org]

Why virtual? (1)

SanityInAnarchy (655584) | about 6 years ago | (#24842481)

Just install whatever webserver you were going to use. If you're nervous, configure it to only listen on localhost.

Er, LAMP? (1)

AccUser (191555) | about 6 years ago | (#24842511)

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] (1)

The MAZZTer (911996) | about 6 years ago | (#24845235)

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:Er, LAMP? [sic] (1)

FLEB (312391) | more than 5 years ago | (#24846169)

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'. (3, Informative)

oneiros27 (46144) | about 6 years ago | (#24842513)

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:Define 'virtual webserver'. (1)

Rob Kaper (5960) | about 6 years ago | (#24843483)

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.(.*)
RewriteRule ^robots.txt /robots.local.txt [L]

or a proper authentication system.

How more virtual can you get? (2, Insightful)

SendBot (29932) | about 6 years ago | (#24842515)

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 (1)

hesaigo999ca (786966) | about 6 years ago | (#24842597)

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 is best to use the same environment as your client does to debug installations (prior to debugging actual code)

Why not use a real one? (1)

Millennium (2451) | about 6 years ago | (#24842607)

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 (3, Informative)

ByOhTek (1181381) | about 6 years ago | (#24842663)

> Are there any specific distributions which allow
> 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 (1)

drpimp (900837) | about 6 years ago | (#24842755)

From what I understand your environment is a virtual machine with Ubuntu, and you are wanting a web server to run for development. Like many of the other people Apache "may" be your best best since it sounds like you are familiar with it from WAMP. I am not sure what you mean by virtual webserver unless you mean you want your virtual machines web server to be exposed to your host machines browser. If that is the case you need to see first which IP your virtual machine has been bound to, see which IP apache has bound to, then see if you can pull that up via IP. If you can then see that, if you want you can always add an entry to your local hosts file to create an alias for your virtual machine if you feel like it. Again your description of what you exactly what is slightly vague but perhaps I hit at least one point.

So what's wrong with XAMP (1)

slim (1652) | about 6 years ago | (#24842911)

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 (1)

aliens (90441) | about 6 years ago | (#24842975)

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.... (1)

Seraphim_72 (622457) | about 6 years ago | (#24843171)

I thought this project looked very promising : https://launchpad.net/mysql-sandbox [launchpad.net] Instantly run one or many SQL Servers as a back end, will even do clustering for you if you want. YMMV

httpd (0)

Anonymous Coward | about 6 years ago | (#24843431)

I personally use lighttpd when I don't require every feature in Apache (some specific modules!)

P.S.: Configuring Apache on openSUSE is a snap with YaST.

Development Environmnet on EC2 (1)

Crazy14720 (1356011) | about 6 years ago | (#24843591)

Nptlabs is currently in development on an online Wed Development Environment located on EC2. It uses nxserver to function as though it is local. If you are interested check out http://projectcodemonkey.wetpaint.com/ [wetpaint.com] .

He meant virtual domains - NameVirtualHost (1, Informative)

Anonymous Coward | about 6 years ago | (#24843849)

the term "virtual domains" used to apply to what we now called shared hosting. I think that's what he was talking about.

If that is the case, yes, you can configure multiple separate websites on the same server, all pointing to 127.0.0.1 (localhost) and with fake domain entries in /etc/hosts pointing to 127.0.0.1

It's simply a matter of enabling the NameVirtualHost option in httpd.conf

You just need a tutorial on configuring httpd.conf

If you really want to replicate the shared server environment, you should also install suphp, which is pretty much standard on hosting isps (including the one I run)

I have a fresh install of LAMP via source tarballs -- I like to have the most recent version, the performance is faster with a custom compile, and I get to apply patches manually. I use apt-get or yum (depending on the box) to install base libraries like libbz2-dev (bzip2-devel) so I don't have to manage the dependency chain.

No matter what you do, you should be running Linux to do it, running PHP on a Windows box is a stupid computer trick.

If you have the RAM (ie >= 2GB) using vmware player to run CentOS 5.2 or Ubuntu 8.04 in the background is perfectly acceptable, just do /sbin/ifconfig within the virtual server to find the ip it has obtained from the vmware player's dhcp server, it will always be the same unless you move/copy the image. Then configure that ip in your c:\windows\system32\drivers\etc\hosts file with your fake domain entries

Might as well take the big step (1)

Dracos (107777) | about 6 years ago | (#24844145)

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 about a dozen sites on my dev box. If you want a good challenge, try setting up a local install of the W3C validator.

Virtual host or virtual web server? (0)

Sudheer_BV (1049540) | about 6 years ago | (#24844433)

As stated in above comments virtual host is running multiple websites on a single server. Example, mysite1.example.com, mysite2.example.com, example2.com, etc all running on the same server and can even share same IP address. Refer to name virtual hosts in apache httpd documentation.

If you want to run virtual web server on one hardware box you need something like Xen, KVM, QEMU etc.

If you want to use Fedora/CentOS or alike RPM based distros the below link will help.

http://lampcomputing.com/content/how-to-install-lamp [lampcomputing.com]

Whatever operating system you use, you can run apache on it. Distro is more of a personal choice.

Could you rephrase the question? (1)

pbulteel73 (559845) | about 6 years ago | (#24844443)

You're not very clear with what you want. A virtual webserver could mean many things. Do you want to run it in a virtual environment like you're doing now? Even if you're running Linux as your host system you can use VMWare or VirtualBox (which is Open Source and runs on Windows too.) This would allow you to run another instance of Linux with your webserver.

You could also just have multiple virtual hosts or virtual directories as part of your original Apache install. This would allow you to have a directory used for one application, another one for another, and so on. All with their own domain name (or subdomain.) This is something you can also do with your current VM installation BTW.

Now your question asked which distribution has this functionality and like some other posts point out, any and every distribution allows you to install Apache on it.

I hope this answers whatever your question was.

-P

Eclipse? (1, Interesting)

Anonymous Coward | about 6 years ago | (#24844933)

Have you looked into Eclipse development? The WTP (Web Toolkit Plugin) makes it real easy to configure and deploy various types of web (and app) servers, all within the Eclipse VM.

All allow this (1)

olddotter (638430) | about 6 years ago | (#24844983)

I would like to point out that you want to run versions that are as close to what you will use in production as possible. I do this in a corporate environment where we got so tired of helping developers remove "c:" from the paths of application to be deployed on unix. We created a VMware version of the web server to run in linux. Makes life much easier!!

I just have to ask (-1, Flamebait)

Anonymous Coward | about 6 years ago | (#24845103)

Why does it need to be in a virtual host? Because you have heard of doing that? Nonsense

lighttpd + php5-cgi (1)

kapouer (1215366) | about 6 years ago | (#24845111)

Configuration is quite simple, memory usage is less than apache, and it starts faster. If you do php debugging, php5-xdebug will help you. Also sudo lighttpd-enable-mod 10-fastcgi.conf will enable php as fcgi.

Re:lighttpd + php5-cgi (1)

Ant P. (974313) | more than 5 years ago | (#24848669)

I second this. Lighttpd + Postgres takes about 10-20 minutes to set up and config in Ubuntu, and I've had less bugs with it - Ubuntu's mod_php seems to throw a fit with my PHP code even though it's not using any nonstandard stuff.

xampp (1)

awrowe (1110817) | about 6 years ago | (#24845271)

I have just gone through pretty much this scenario myself. I wanted a web development server which I could access from out and about with my laptop and I wanted to be able to access the machine using ssh.

First I tried 'sudo tasksel install lamp' which did its thing, but somehow failed completely to get php working. Then I decided I would give xampp a go and went down the 'sudo tasksel'/remove lamp selection/hit ok/find ubuntu bug which removes entire gnome desktop as well as lampp/report bug while reinstalling gnome' route.

I then installed xampp and apart from having to do some fiddling to get webmin to realise it was there, the process couldn't have gone any smoother. Forward the ports on the router, open an account on dyndns and install the ip notifier thingy and I'm happily working away on my home linux box using putty and webmin. Also managed to scare my wife by playing some iron maiden tracks at home when I was at work, which was a bit of fun.

In short, the guys at apachefriends have a really good little dev server system there.

http is peasy u lamer : (1)

DrSkwid (118965) | more than 5 years ago | (#24845731)

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 (1)

Wee (17189) | more than 5 years ago | (#24845811)

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 desktop icon or whatever".

Take a look here: http://httpd.apache.org/docs/2.2/vhosts/ [apache.org]

That will show you how to set up a thing called "virtual hosts", which is pretty close to what I think you want. In a nutshell, you can have multiple document roots with various versions of a web site all served by the same apache daemon. You should be able to set it up so that, using .htacess files, you can test all sorts of server directives, play with mod_rewrite, etc without affecting the other virtual hosts. (Note the "virtual" there: That's apache basically simulating you having multiple servers, when in fact you only have one. That may be close to what you meant.)

You can also set up multiple instances of apache on your machine. Just have them all listen on a different port. The effect is the same, mostly, as having one server with many vhosts.

-B

Linux software (1)

Yfrwlf (998822) | more than 5 years ago | (#24847257)

Download and install Apache for Linux.

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.

Cause all distros do this pick an OS that you like (0)

Anonymous Coward | more than 5 years ago | (#24848385)

You basically sound like a MS power user that is interested in getting into Linux. Because all distributions can load Apache, you might want to do some research and see which distribution is probably right for you. A lot of new users right now are using Ubuntu, and because of that fact it is pretty easy to find info for that distribution when you run into a problem. Also instead of running the OS in a virtual machine you might try qtparted or gparted and resize and add a repartition to your drive for a fresh linux install.

Funny, we do the opposite (2, Interesting)

smchris (464899) | more than 5 years ago | (#24848697)

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 (1)

blurfus (606535) | more than 5 years ago | (#24849111)

If you are already running VMWare, then I would recommend downloading a pre-configured virtual appliance [vmware.com] . They are ready-to-go VM W/X/LAMP installs that sometimes even offer a slimmed down version for minimal footprint; pick one that resembles the target production environment and you are ready to go.

Django (0)

Anonymous Coward | more than 5 years ago | (#24849519)

./manage.py runserver 8080

Most distros ... all the major ones (1)

Skapare (16644) | more than 5 years ago | (#24850415)

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.

extremely easy choice (1)

powerspike (729889) | more than 5 years ago | (#24853013)

I think the best path is, if your going to be releasing on the web, get the distro you'll be deplying onto, also make sure you have the same configuration files setup. I use this setup, it's fast and simple, and if items change on your live servers, it's easy to update your local (just copy files) instead of trying to "translate" the setup and configuration.

Web server the easy way (1)

SilverPDA (823317) | more than 5 years ago | (#24855259)

With Ubuntu you can easily do this by installing a single package that provides Apache, MySQL and PHP otherwise known as LAMP. Run the Synaptic package manager. Select the "Edit" menu and select "Mark packages by task". Select "LAMP server" and click Apply. Create /etc/apache2/httpd.conf with the following two line to enable PHP. AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps Run "sudo /etc/init.d/apache2 restart" and the configuration will be made.

Virtualization for development (0)

Anonymous Coward | more than 5 years ago | (#24884951)

A fairly standard web development system could include many services running on various network ports.
        caches, mail, ftp, timeserver, monitoring, https, http, system configuration, ruby, fastcgi, db, ssh, webdav, source control, etc..
Running these services should in no way be impacted by availability of packages on any given platform.
These should in no way conflict with any system services built into each OS.
A new upgrade should never break any of these services.
The standard services should never conflict with any other package install needed.
The easiest way to accomplish this is with OS virtualization.

It is standard practice to multiboot into different operating systems for testing or hardware/application requirements and/or issues.
While booted in any OS you should be able to access all standard development services, without virtualization you'd need to configure and possibly synchronize for each OS.

Virtualization - definitely
    Experiment without affecting the base system, already using standard packages and ports for daily workflow.
    Easy transfer between machines, work and home, friends, etc. Virtual machines work regardless of underlying hardware, OS or Virtual Server Platform differences. Everything works instantly after hardware/software upgrade. *occasionally need to tweak the virtual software on updates.
    Rescue system can launch vm's from a live-cd with vmplayer. Can launch common vm client's from an alternate rescue boot partition.
    A virtual system will be able to run the most pre-configured demos available including every standard live-cd or install-cd and every virtual appliance/client available from any and all virtual platforms.
    Emulate production environment. Develop on one OS, deploy on another, test on vm client running production OS and apps first.
    Use freely available converters and you can use almost any Linux virtual machine on any virtual platform.
    There are many available virtual appliances/virtual machines available online. These will often have many software packages pre-configured for demo or testing. Great if only for configuration comparison to a working copy when installing/building your own copy on another system.
    Developers and development are the best fit for virtualization.
                    Often low concurrent load across virtuals, only a few virtuals clients needed running at a time.
                    Backups, checkpoint copies, beta builds, evaluation software
                    OS compatibility testing, istalls and testing concurrent to machine's normal use rather than multiboot
                    When multibooting alternate OS's, provide standard source control management services available to every base system
                    OS/Kernel level Debugging using virtual API's
                    Multiple OS's, using best fit for each task

>>Are there any specific distributions which allow you to have a virtual webserver on your desktop?
All distro's including windows/osx/solaris/BSD's and linux's will have a web server installable.

A Standard developer virtual build would include 11 or more virtual client installations of various distributions.
        *A single distro/virtual client may cover more than one area below depending on your requirements.

Virtual Client #1. Easiest distro for "you" to development in. Integrated development tools, editors, debugging, logging, monitoring, help files, etc.
                    Everyone is more produtive in their comfort zone. Transitioning to a "better" system may increase productivity but usually only after effort is applied.

2. Easiest distro to use for specific tasks. ( freenas, ipcop, jumpbox )
                    Usually determined by quality of configuration management tools included or determined by the preferred OS of the original package developer(s) for each program.

3. Distribution with the most available up to date packages in standard package management. Debian or FreeBSD overall, although some binary packages are only in specific distros.
                    Easiest way to test relatively new software is from a binary package in a popular distribution.

4. Distribution with the most available up to date packages in source format in standard package management. Gentoo, Debian or FreeBSD
                    Easiest way to custom compile relatively new software without dependency issues is from a source package in a popular distribution.

5. Distribution with the most available up to date packages in binary format from 3rd party sources. More 3rd party RPM based available, Redhat, Mandriva, openSuse
                    Easiest way to test relatively new software not available in any distribution is from a binary package in a popular distribution's 3rd party software repository.

6. Distribution copy of final production system (or equivalent - centos for redhat enterprise, opensuse for suse enterprise, etc.)
                    You should always do a final beta test on as close to actual software/config setup as possible. Great for config backups and disaster recovery.

7. GUI copy of server distribution, for graphical configuration and package management
                    Best way to explore a new distribution release is through the graphical install.
                    Best way to use systems on virtual is with text based installs and access over SSH only and not thru any virtual console, mimic a real deployed server.

8. Copy of base system OS. Once code/app is configured and tested on virtual, deploy on base system, use virtual for testing each update/addition before applying to base OS.
                    Great way to test updates and new software without crufting up the base system.

9. Windows end-user browser test client, probably a few of these - XP, XP64, Vista, etc.
10. MacOSX end-user browser test client (runs on the free vmware server)
11. Solaris end-user browser test client, if you care to include the solaris browser clients for testing.
                Better testing on actual client systems. IE on wine with flash is do-able but there are still differences between wine and an actual windows install.

4gigs disk space each on average for a total of 40gigs, with 500gb disks ~ $60 this is well worth the investment.
512mb ram needed per virtual running plus 1gb for base system. 2gb is minimal, 4gb is comfortably for 3 or 4 virtual clients running 24/7.
Maximum performance - one processor core for the base, one core for the manager and each extra core for each virtual. This means phenom triple core or any quad-cores are the best consumer chips available currently.
A quad-core chip can easily handle two loaded vm's and a loaded base system with extra to spare for occasional virtual switching of a third or forth virtual client with low activity.
A single core chip will work fine but timing glitches can occur during task switching. On a single core or dual-core you should have a database on each virtual instead of a single shared database.
With a quad-core chip a single shared database may now make more sense if enough mulitple sources are using it. If you tend to only have one application use the database at a time you may still do better with individual db's installed on each virtual.

Once the Virtual server software is running clients are a simple install on many distributions. Virtual clients can be added as easily as booting to a live-cd or downloading and powering-up a virtual appliance.
Once a virtual is installed and configured it can easily be copied and shared for a community, geek programmer friends, workplace, school, etc..

Check the virtual appliances clients available from the various virtual vendors.
Check the live-cd ditributions available from various sources.
Virtual pc, virtual box, xen, vmware and few others are freely interchangeable (minor conversions or some just re-create machine and attach disk file)
You'll find many pre-built systems in all areas of web services.
Virtuals available of most of the popular blog and template system, joomla, drupal, wordpress, oscommerce, typepad, xoops, sugarcrm and too many more to bother listing.
Virtuals available of most of the popular internet non-webserver systems, firewall, email with anti-spam, anti-virus, calendaring, media servers, VOIP, monitoring, etc..

http://www.bagside.com/bagvapp/
http://wikis.sun.com/display/Appliance/Appliance+Downloads
http://www.vmware.com/appliances/
http://forums.virtualappliances.net
http://virtualappliances.net/downloads/

http://www.frozentech.com/content/livecd.php
http://www.linux-live.org/#
http://www.livedistro.org/
http://www.livecdlist.com/
http://www.knoppix.net/wiki/Knoppix_Customizations
http://www.livecdnews.com/

>> Are there any specific distributions which allow you to have a virtual webserver on your desktop? Any tips and tricks out there for this?
A little confused on what you're really asking here. If the question is "tips or trick for virtualhosted webserver(s)" the answer might be
Any distribution that support(s) or any distro recommended by virtual hosting configuration management software - syscp, webmin with virtualmin, dtc, vhost, baifox, ispconfig, vhcs, etc..

Recommended Virtual clients -
        Freenas - shared file space, FreeBSD for any "FreeBSD binary only available" apps.
                install redmine - source control management, ruby based can run on any other system or it's own.
        debian - web server development, has the most binary packages available
                You'll run/test the majority of virtual hosts here.
                install syscp or webmin with virtualmin or other virtualhost control panel for automated configuration of virtual hosts
                single form - one click install of:
                        DNS domain
                        IP Addresses if needed (multihomed on a single NIC, eth0:1, eth0:2, eth0:3, etc..)
                        Email domain and admin user
                        Email addresses for default system addresses
                        Antispam, Antivirus
                        Virtual Domain(s) for http and https servers
                        Default index.htm pages for Virtual hosts.
                        SQL database per domain or per virtual hosts
                        FTP server and default directories and users
                        Source Control Management System, web access and webdav access
                        System Configuration User
        centos - matches commonly available virtual hosting solutions
        suse groundworks - monitoring, logging, watchdogs, xen conversion tools, RPM based
        LFS - custom server builds can easily fit 50mb without the cruft, docs, extra apps, etc..
                The main reason for this before was for an optimized kernel rather than a single common binary kernel.
                These days, most distributions will ship server, rtc, multimedia and laptop specific kernels.
                An optimized server class vendor supplied kernel and a server class build with package management can be a very usable and cost effective system.
                Custom compiling can definetly solve specific problems or get the last 25% of performance from the machine, but these days space and CPU are cheaper.
                In many situations the cost of man hours to custom compile and test will be higher than throwing 25% more dollars of hardware at the problem.
        windows - browser testing
        osx - browser testing
        Development system - OS of your choice if development IDE and tools cannot be installed in base system.

Other tips, virtual or not:
Demo every viable IDE choice for whatever language you currently write in, php,java,asp, etc.
For instance, if you program primarily in PHP.
Compare trial versions of PHPed, nushere, komodo, zend and any other major players and judge against eclipse, kdevelop, kompozer, bluefish and other opensource offerings.
Find the most cost effective/productive environment(s) for you to work in.
Use logging and monitoring to facilitate debugging. Check out munin, monit, groundwork, nagios, awstats, webmin, etc..
Experiment with higher performance web systems, reverse cache, memcache, load balancers, fastcgi, high speed web servers, clusters, etc..
Use a backup solution and source-control management system.

Avoid commercial offerings until you validate their worth to your overall production.
Don't hesitate to pay for something that makes you more money.

Grandma's LAMP (1)

GWBasic (900357) | more than 5 years ago | (#24893613)

I like Grandma's LAMP. It's a full LAMP VM that runs completely out-of-the-box without any tinkering.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>