How to Install Apache Tomcat in CentOS/Redhat/Fedora

Apache Tomcat is free and open source software that implements a Java-based HTTP web server using Java Servlets and JavaServer Pages (JSP). It is an option to consider when you are implementing a content management system or creating web applications.
There are four main steps to take to get Tomcat ready for use on a dedicated server:
1. Install Java. Note that many Linux distributions will offer Java installations through their package managers. To install on CentOS, see their wiki.
2. Install Tomcat
The easiest option is to install Tomcat from the default YUM repository:
yum install tomcat*
This will provide an older version of Tomcat than is currently available from Apache. If you want the latest, you can download a binary directly from the Apache website.
Source: coreservlets.com
Photo: Wikimedia Commons
Tag: apache, centos, dedicated server, java, linux, servlet, tomcat
New server setup

Question: I want to setup my own server. What software and tools will I need?
Answer: The first major decision to make after you have purchased server hardware is what operating system to use. Many servers come with one already, but if yours does not, you will need to decide on one. Linux or other Unix variants, such as BSD or Solaris are by far the most popular, but there are also many Windows servers out there. If you are on a limited budget, go with a free Linux distribution, such as CentOS.
The next thing to choose is the web server. Choices include Apache, Nginx, and Lighttpd. After that, you will probably one a database server such as MySQL or PostgreSQL Finally, you will want a web-based control panel. Depending on the one you choose, it might also install its own versions of Apache, PHP, and MySQL.
There are many control panel solutions on the market, and most of them are commercial. Popular control panels includ cPanel and Plesk. There are also free solutions available like Virtualmin. Decide what you need for whatever type of websites you plan to have and then choose the software that meets those needs.
Photo: Flickr
Tag: apache, hardware, linux, mysql, php, server, unix, windows
Twitter the latest among big players to leave MySQL for Cassandra

With a name that even sounds like the beautiful love interest of a secret affair, Cassandra appears to be positioning itself to steal the hearts of those once in love with MySQL. Twitter is now set to replace its MySQLdatabase system with the open source home wrecker.
Cassandra was originally developed by Facebook and was released to the public via Google’s code repository in 2008. In 2009, the Apache Foundation added it to its project, and in February of 2010, Apache made it a top-level project. It is designed to work with large amounts of data by spreading the data across multiple servers. Its notable feature is that it has no single point of failure.
Twitter joined a growing list of major companies that have adopted Cassandra. Among them are Digg, Cisco, IBM. Cassandra is free and open source software released under the Apache License 2 and is available for download from Apache.org.
Photo: Flickr
Tag: apache, cassandra, data, database, facebook, mysql, twitter
Monitor Apache web server with mod_status
Problem: Apache HTTP Server on a web hosting system will undoubtedly run multiple virtual hosts. Each of those virtual hosts logs its activity in a separate location making it impossible to effectively monitor each log and each virtual host for errors or security issues.
Solution: Use mod_status to monitor Apache’s activities. This module for Apache allows the system administrator to have real-time viewing of all of the web server’s activity. It is part of the default Apache 2 package on many Linux systems, and you can enable it by doing the following:
1. Make sure you have mod_info module loaded:
a2nmod info
Read More >>
Tag: apache, linux, module, mod_status, web server
How to install Nginx via YUM in CentOS
Nginx (pronounced “Engine X”) is a lightweight web server that offers speed and flexibility without all of the extra features that larger web servers like Apache offer. Although it is a free and open source application, CentOS does not offer the latest version in its default YUM repository. To install it, you need to add the EPEL (Extra Packages for Enterprise Linux) repository, which is part of the Fedora Project.
1. Install the EPEL repository:
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm
2. Install nginx
# yum install nginx
3. You will be asked to install the gpg-key for EPEL. Answer yes
4. Start Nginx
# /etc/init.d/nginx start
5. Check the installation by going to your web server’s default site, either using your ip address or domain name.
Tag: apache, centos, fedora, nginx, redhat, web server, yum
Web server round-up

Over the past year, we have discussed several web servers. For your convenience, here is a quick list of each one we have already mentioned, as well as a couple we did not, including links to their project sites.
Apache – This is the most widely used and the one we have spent the most time covering. It is free and open source and runs on nearly every platform available. It is released under the Apache license.
Microsoft IIS – As Microsoft’s proprietary web server, it only comes with and works on Windows. If for some reason you have to run this but do not have Windows, you will have to consider virtualization.
Sun Java System Web Server – This is Sun’s proprietary web server technology that is primarily intended for Sun appliances. Nevertheless, it is cross-platform, and Sun recently opened some of its code under a BSD license.
Ngnix – This is a lightweight web server that runs on both Unix and Windows machines. It has become the fourth most popular HTTP server and is available under a BSD-style license.
Lighttpd – This lightweight HTTP server is designed to take on heavy loads while maintaining a good balance, low memory and CPU usage. It powers YouTube, Wikipedia, and many other high-traffic sites. It is free and open source under a BSD style license.
Photo: Flickr
Tag: apache, bsd, iis, lighttpd, nginx, sun, unix, web server, windows
What is 127.0.0.1?

Question: I have been setting up my own server, and a lot of help documents refer to the 127.0.0.1 address. What is 127.0.0.1?
Answer: 127.0.0.1 is the standard ip address assigned to the lookback network interface in IPv4. Because it is a standard, all server should conform to it, and you should be able to access any open ports on your own server through that address. It is also known by the hostname “localhost”, and it is actually more common for documentation to use localhost just in case a server happens to use a different ip address.
If you are running Apache on a local machine, you can use 127.0.0.1 or localhost to access it through a web browser or other method. It is also used by MySQL, CUPS, and many other services, all using their own various ports. Even if no other network devices are setup on a Linux server, the “lo” loopback device should still be present. To find out information about it, you can type “ifconfig” from the command line. It should produce output that looks something like this:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:49476 errors:0 dropped:0 overruns:0 frame:0
TX packets:49476 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9790315 (9.7 MB) TX bytes:9790315 (9.7 MB)
Photo Source: Flickr
Tag: 127.0.0.1, apache, ipv4, linux, localhost, mysql, network, server
How to restart Apache in Mac OS X Server
Question: How do I restart Apache HTTP Server on a Mac OS X server?
Answer: Linux other Unix-based servers, you can start and stop Apache from the command line. If you are familiar with Redhat-based systems, then you are used to logging in and then using “su” to become Root. Mac OS Xrelies on “sudo” like many Debian-based systems (such as Ubuntu).
The command for Apache in Mac OS X is “apachectl” (Apache control). To restart Apache, type the following:
$ sudo apachectl restart
To stop Apache, enter:
$ sudo apachectl -k stop
And to start Apache again, type:
$ sudo apachectl -k start
After entering a command with “sudo” you will be prompted for your password. Enter it and continue. You will still need to use “sudo” for each command run as Root, but it will not ask you for the password again until you have stopped using it for a period of time in that session.
Source: nixCraft
Tag: apache, linux, mac os x, root, server, sudo, unix, web server
Apache's DocumentRoot directive

Apache HTTP Server gives you the flexibility to decide where you want to store the web-accessible files for your websites. Most operating systems have their own unique directory structure for their default web server installations, but even those can be changed. The Apache default document root is /usr/local/apache/htdocs.
To change the document root, use the following directive in your httpd.conf or virtual host configuration file:
DocumentRoot directory-path
Replace “directory-path” with the path you want to use. For example:
DocumentRoot /var/www/public_html
Make sure you do not have a trailing slash. With this setup, a file, such as index.html, found in /var/www/public_html/index.html will appear on the web at: http://www.yourdomain.com/index.html. Whatever directory you choose must be readable (but not writable) by outside users.
Source: Apache.org
Tag: apache, directive, directory, document root, web server
How to setup a virtual host in Apache on a Mac OS X Server
So far we have covered Linux, Windows, BSD, and Solaris. Another server operating system worth mentioning is Mac OS X Server. Although most tend to think of OS X as a desktop OS, there is a server version that has the same Unix-like structure and stability as other BSD distributions. The main difference is that it has customized visual configuration utilities.
A virtual host allows an administrator to host multiple websites on a single box. By default, Apache will only host one site. There are three steps to configuring a virtual host in Apache. They are:
1. Edit the DNS
2. Create the stie folder
3. Configure the virtual host
This is standard for Apache, but the process differs depending on the operating system. For example, on Mac OS X, the default folder for websites is /Library/WebServer, which is drastically different from the /var/www common on many Linux distributions. You can change this setting and many others to suit your preferences. For the the full how-to wiki article, see macos-x-server.com.
Source: macos-x-server.com”>macos-x-server.com
Tag: apache, dns, mac os x, server, virtual host, websites