Configuring multiple HTTP Listeners with Web Server
By sriram on Oct 15, 2007
Some time back, I wrote a blog about how one can take advantage of Solaris 10 and make Sun Web Server 7 to run at port 80 as "non root" user. One customer, who probably read this blog, posted a follow up question on how to get multiple HTTP Listeners working with Web Server 7 and still run at port 80. So, here is a follow up post on the same topic to help this customer.
Here is a step by step instruction to get this done
1. Download Sun Java System Web Server 7 from here
2. It is better to decide on the runtime user of your Web Server before actually installing Web Server on your system. On Linux systems, user used to simply choose 'nobody' as the runtime user of the Web Server.
With Solaris 10 or OpenSolaris , 'webservd' is a default user created by Solaris - so that Web Servers like Apache or Sun Java System Web Server 7 can leverage this as 'non root' user. On Solaris 10 or above, you can run the following command to configure a non root user like 'webservd' to run as non root and still listen at port 80.
# /usr/sbin/usermod -K defaultpriv=basic,net_privaddr webservd
3. Now, kick off Web Server 7 installation and at the time of installation, you will need to choose Web Server 7 runtime user as 'webservd' or whatever the user you chose in the above step.
4. Web Server 7 installer creates a default HTTP listener (most likely the default port number is 80) and a default configuration with the same name as your 'hostname' . This should allow your web site to run at port 80.
5. Now, if you would like to configure multiple HTTP listeners so that your web server can respond to requests like
6. For simplicity , let us use Web Server 7 CLI to get this job done
/sun/webserver7/bin/wadm create-http-listener --user=admin --server-name=<hostname> --listener-port=82 --default-virtual-server-name=<hostname> --config=<hostname>
/sun/webserver7/bin/wadm deploy-config --user=admin <hostname>
Now, your Web Server can listen to HTTP requests comming in at both 80 as well as 82.