Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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 127.0.0.1 then i could change the other 2 web servers,, it would be now 127.0.0.1:8000 and 127.0.0.1:6969. but i dont know how to do this. can you elaborate more? –  iDarine 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
2  
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
add comment

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.

APACHE

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

NGINX

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;
        }
}

LIGHTTPD

server.port = 82
share|improve this answer
add comment

Your Answer

 
discard

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.