In Ubuntu, you create init scripts using the SysV init system. Details are here. In this article, I will create a very simple script to start and stop Tomcat.
How should one store date in Couchbase? So far, I have come across two options. I will discuss their relative merits here.
Couchbase has a web based console that is accessed using port 8091. If you are running Couchbase in an EC2 instance you could open up port 8091. But a more secure option is to use SSH tunnel.
If you are running a web application in Amazon EC2, then SES is a great option for an outgoing SMTP mail server.
Normally, I use chkconfig tool in SUSE or RedHat to manage init scripts. This tool is missing in Ubuntu. The alternative is to use the sysv-rc-conf tool.
First, install the tool:
sudo apt-get install sysv-rc-conf
To check the configuration of an init script, such as apache2, run:
sudo sysv-rc-conf --list apache2
To disable a script, such as apache2:
sudo sysv-rc-conf apache2 off
To enable it again:
sudo sysv-rc-conf apache2 on
To create a new script manually, use the same syntax as for chkconfig.
Take these steps to quickly install Couchbase 2.2.0 in Ubuntu server 13.04.
1. Install Nginx:
sudo apt-get install nginx
2. Where are the files?
dpkg -L nginx-full dpkg -L nginx-common dpkg -L nginx
3. Starting and stopping:
cd /etc/init.d sudo ./nginx start sudo ./nginx stop
4. Go on a test drive. Start the server, then,
Default document root is /usr/share/nginx/html. Change index.html there and make sure changes are picked up by the server.
View the access log file: /var/log/nginx/access.log.
4. Edit basic settings like document root
5. Edit advanced settings like worker process, log file location:
Note: total number of HTTP requests served = worker_processes X worker_connections.
When you front a Tomcat/TomEE with Apache web server, you have a choice of using http or ajp protocol. In most cases ajp is recommended. It has a few additional features. For me, more importantly, ajp performs better.
At times, you need to run multiple Tomcat or TomEE processes. In this article, we will find out how to do that.
Quick guide to using the Derby database server.