Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to install three Linux web servers on my laptop, but I want to ask if there are guides on how to do this? I heard that you will change ports, but I don't know how. Can you provide me?

The three web servers I want to install are

  • apache (already installed)
  • nginx (not installed yet)
  • lighttpd (not installed yet)

With these three web servers, I will put each of them a Wordpress template. In which I'll try to access later, but my only problem will be the installation of these three web servers without creating any conflict in my laptop.

share|improve this question
up vote 3 down vote accepted

Quite simply, you use different ports for them internally, then have the websites accessed by different ports or set up either ngnix or apache (or another proxy) to act as a proxy - say with a setup similar to this, to pass on requests to the right server.

For testing, using different ports is the way to go

Alternately, use 3 VMs and use seperate ip addresses for them (the best way to do so would be bridged networking with a cable for ethernet access for the laptop). This would need somewhat more resources, but be infinitely easier to troubleshoot.

share|improve this answer
hmm. that maybe the case.. but i am thinking that if my apache server is accessed through then i could change the other 2 web servers,, it would be now and but i dont know how to do this. can you elaborate more? – RedKing Jan 8 '12 at 12:55
just add the well, thats how you do it, precisely. I haven't set up a proxy before, so i'm not sure of the details. For running on seperate ports, install, it won't start, so just go into the config, change it, and then start the process – Journeyman Geek Jan 8 '12 at 12:59
Ewww - you don't need to install 3 separate VMs to use a separate IP on each web server! The IP address used by the web server will be specified in the configuration file, such as by the Apache Listen directive. – MikeyB Jan 8 '12 at 14:17
well, he'd need three interfaces wouldn't he? I suppose the best setup depends on how he wants to use it. – Journeyman Geek Jan 8 '12 at 14:38

By changing the configuration files of each server, you have have them listening on different ports. This way they will not conflict with each other returning a Port in Use error. However, I do agree with Journeyman Geek as running multiple VMs is ideal in my opinion. You could use something like VirtualBox's Export/Import Appliance feature that will allow you to quickly get the other two VMs copied and running. Much easier in separating the three servers in troubleshooting. Only reason why I can see you wanting to have different servers for different ports is if you were making an administrative backend to an application, but then why not just use Virtual Hosts.


Usually in your /etc/apache2/ports.conf there is a line that tells apache which port to listen on. You will want to change this to your applicable port.

Listen 80


When you setup this server, you'll have a configuration similar to this one where you're listening on port 81.

server {
        listen       81;
        server_name  localhost;

        access_log  logs/localhost.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;


server.port = 82
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.