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?"
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.
Just install whatever webserver you were going to use. If you're nervous, configure it to only listen on localhost.
Don't thank God, thank a doctor!
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.
Any fool can talk, but it takes a wise man to listen.
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.
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 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)
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.
> 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).
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.
-- Brought to you by Carl's JR
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?
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
-- taking over the world, we are.
I thought this project looked very promising : https://launchpad.net/mysql-sandbox Instantly run one or many SQL Servers as a back end, will even do clustering for you if you want. YMMV
Slashdot, where armchair scientists get shouted down and armchair theologians get modded up.
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.
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/.
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
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.
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
Whatever operating system you use, you can run apache on it. Distro is more of a personal choice.
Sudheer Satyanarayana
www.techchorus.net
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
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.
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!!
Think Deeply.
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.
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.
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.
A.I. Research. The peculiar science in which we know the question and we know the answer, but can't show the working
bash
rc
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
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
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/
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
Ash and Hickory, straight-grained and true, make excellent bludgeons, dandy for the cudgeling of vegetarians.
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.
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?
Information wants to be free.
Entertainment wants to be paid.
You just want to be cheap.
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.
Promote true freedom - support standards and interoperability.
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.
Oh, and incidentally, I believe I was thinking of "rpm -i [package-filename]". So that didn't just come from no-where. :)
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.
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.
If you are already running VMWare, then I would recommend downloading a pre-configured virtual appliance. 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.
will work for Karma
./manage.py runserver 8080
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.
now we need to go OSS in diesel cars
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.
Yup YUM has changed a lot over the years. Seth Vidal and friends have been constantly refining it.
...to pay your $699 licensing fee you cock smoking teabaggers!
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.
Thank a veteran -- George
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
I like Grandma's LAMP. It's a full LAMP VM that runs completely out-of-the-box without any tinkering.
No, I will not work for your startup
See man yum for more details.
Sorry, no man yum for me.
.
.
.
.
Not that there's anything wrong with that.