High Performance Muli-Processor Support Webserver Solution

Linux OS Topics
Post Reply
User avatar
nwclasantha
Posts: 75
Joined: Wed Apr 24, 2013 12:57 am
Location: Malabe

High Performance Muli-Processor Support Webserver Solution

Post by nwclasantha » Sun Jan 26, 2014 5:05 pm

High Performance Muli-Processor Support Webserver Solution
info.png
High Performance Muli-Processor Support Webserver Solution.pdf
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: High Performance Muli-Processor Support Webserver Solution

Post by Neo » Thu Jan 30, 2014 12:29 pm

Dear Chanaka

Very nice that you have introduced Nginx web server here. It is now becoming popular due being light weight and speed. I run Apache at the moment on my dedicated servers and found that it is convenient for my requirement. Could you share your personal experience with Nginx please. What are the advantages and disadvantages over Apache? How difficult it is to setup by removing Apache on a already running server? Last time I remember that Nginx lacks virtual server support, where one IP allow multiple domains to run in a single machine. How is the current situation ? Hope your advise would help me to decide installing Nginx :)
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Re: High Performance Muli-Processor Support Webserver Solution

Post by Saman » Thu Jan 30, 2014 12:35 pm

You are right Neo. Nginx doesn't have Virtual Hosts since it is a Apache term. It has something called Server Blocks that use the server_name and listen directives to bind to tcp sockets. Here are some notes about those.

Two Server Blocks, Serving Static Files

Code: Select all

http {
  index index.html;
 
  server {
    server_name www.domain1.com;
    access_log logs/domain1.access.log main;
 
    root /var/www/domain1.com/htdocs;
  }
 
  server {
    server_name www.domain2.com;
    access_log  logs/domain2.access.log main;
 
    root /var/www/domain2.com/htdocs;
  }
}
A Default "Catch All" Server Block

Code: Select all

http {
  index index.html;
 
  server {
    listen 80 default_server;
    server_name _; # This is just an invalid value which will never trigger on a real hostname.
    access_log logs/default.access.log main;
 
    server_name_in_redirect off;
 
    root  /var/www/default/htdocs;
  }
}
Wildcard Subdomains in a Parent Folder
This is just a really easy way to keep adding new subdomains, or to add new domains automatically when DNS records are pointed at the server. Note that I have included FCGI here as well. If you want to just serve static files, strip out the FCGI config and change the default document to index.html. Rather than creating a new vhost.conf file for every domain, just create one of these:

Code: Select all

server {
  # Replace this port with the right one for your requirements
  listen 80 default_server;  #could also be 1.2.3.4:80
 
  # Multiple hostnames separated by spaces.  Replace these as well.
  server_name star.yourdomain.com *.yourdomain.com; # Alternately: _
 
  root /PATH/TO/WEBROOT;
 
  error_page 404 errors/404.html;
  access_log logs/star.yourdomain.com.access.log;
 
  index index.php index.html index.htm;
 
  # static file 404's aren't logged and expires header is set to maximum age
  location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
    access_log off;
    expires max;
  }
 
  location ~ \.php$ {
    include fastcgi_params;
    fastcgi_intercept_errors on;
    # By all means use a different server for the fcgi processes if you need to
    fastcgi_pass   127.0.0.1:YOURFCGIPORTHERE;
  }
 
  location ~ /\.ht {
    deny  all;
  }
}
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: High Performance Muli-Processor Support Webserver Solution

Post by SemiconductorCat » Sun Feb 02, 2014 12:32 am

So that, would you saying that modified server architecture like that would completely wipe out the WSO2 carbon like kernel out from the market?

Then there is absoulately no need a kernel like Carbon at all. But as a middleware WSO2 would remain as it is.

And those features like sendfile are already on the apache server. Since Apahce is maintained by lots of developers know.
Post Reply

Return to “Linux”