Slashdot Mirror


Local Web Server For Web Development?

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

9 of 82 comments (clear)

  1. all Linux distros allow this by DragonTHC · · Score: 4, 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.

    --
    They're using their grammar skills there.
    1. Re:all Linux distros allow this by AKAImBatman · · Score: 4, 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 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!>

    2. Re:all Linux distros allow this by Fallingcow · · Score: 4, 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!

    3. Re:all Linux distros allow this by theelectron · · Score: 4, Insightful

      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.

    4. Re:all Linux distros allow this by dintech · · Score: 3, Funny

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

    5. Re:all Linux distros allow this by Anonymous Coward · · Score: 5, Funny

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

    6. Re:all Linux distros allow this by Matt+Perry · · Score: 3, Informative

      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.

      --
      Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
  2. Define 'virtual webserver'. by oneiros27 · · Score: 3, 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.

    --
    Build it, and they will come^Hplain.
  3. It's more the webserver app than the distro by ByOhTek · · Score: 3, Informative

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

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).