Configuring, Tuning and Debugging Apache
Once your Apache server is compiled, installed, configured and running, you might still encounter some problems. apachectl configtest is a good way to ensure that all of the directives are legal—but this does not ensure that they will work, nor that they are the values you really want.
A good tool for checking that a server is working in the right way is telnet. Telnet is probably familiar to most Linux users as a way to log into one computer while sitting at another. However, telnet can open a TCP connection on any port, not just the default port 23 used for the “telnet” protocol. You can thus use telnet for SMTP (port 25), POP (port 110) and even HTTP (port 80). This is a great way to test web servers to see if they're running, as well as run some basic tests.
The key to this technique is understanding that every TCP/IP service is associated with an IP address and port on both the origin and destination computers. Thus, a telnet connection between two computers will almost certainly include two IP addresses, an arbitrary port on the client, and the well-known port 23 on the server. Similarly, an SMTP connection carrying e-mail between two computers will normally include a connection from an arbitrary port on the client to port 25 on the server. For a list of well-known ports, including many that should not be changed without good reason (such as FTP, SMTP, telnet), look at the standard file /etc/services on any computer running Linux.
To use the telnet program to connect to an arbitrary port, simply indicate the port number (or name, if one appears in /etc/services). For example, to connect to the HTTP server running on port 80 of the computer www.lerner.co.il, simply say telnet www.lerner.co.il 80.
If the server is running on a different port, as defined by the Apache Listen and Port directives, simply specify a different number. For example, if the server is running on port 8080, we can connect to it with telnet www.lerner.co.il 8080.
Of course, a single Apache process can handle input on two or more port numbers, so long as they are specified correctly in httpd.conf.
If no server is running on the specified port, then telnet will exit with a fatal “connection refused” error. In such a case, consult the Apache error logs, normally placed in /usr/local/apache/logs/error_log, to determine the source of the problem.
If an HTTP server is indeed running on the specified port, then telnet will display a message indicating how to exit back into the telnet command prompt (usually with CONTROL-]), and will then connect you. What prompt you see depends on the type of server to which you connect; while SMTP, FTP and POP all greet an incoming user with the name of the server computer, HTTP is unusually silent. The assumption is that you know the name of the server to which you have connected, and that the connection was obviously successful.
At this point, you can issue an HTTP request. The simplest form of request is GET /, followed by a single newline character. This is an HTTP request of the most primitive sort, which is no longer used but is built into HTTP servers in order to ensure backward compatibility with older clients. Soon after pressing ENTER, you should see the contents of the root (or “index”) page of the site to which you connected. It may be difficult to read the unparsed HTML at first, but remember that this is a simple debugging method.
A more sophisticated request uses HTTP/1.0, the first version of HTTP to include headers in the request and response. The request and response are each preceded by one or more “header” lines, containing a header name, a colon and a text string. The headers and request/response body are separated by a single blank line.
Our simple request can thus be rewritten as GET / HTTP/1.0, with the latter part tacked on to indicate that our client understands a more sophisticated version of HTTP. We then have to press ENTER twice—once to indicate the end of this line, and a second time to indicate that we don't want to send any headers between the command line and the body of the HTTP request.
You can also submit name-value pairs to the server with telnet, separating each name from its corresponding value with “=”, and each pair with an ampersand. Normally, such arguments are passed in a GET request to a CGI program or other dynamic content producer. For example:
GET /cgi-bin/foo.pl?name1=val1&name2=val2 HTTP/1.0
After pressing ENTER twice, you should see a set of response
headers, followed by whatever output is produced by the CGI program
foo.pl.
You can also pass headers along with the request. After pressing
ENTER following the initial GET line, type one or more
headers, with a new line after each one. For example:
GET /cgi-bin/foo.pl?name1=val1&name2=val2 HTTP/1.0 Accepts: text/html Accept-language: text/html Following the final header, press ENTER twice—once to finish the header, and again to indicate that the request is complete.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Home, My Backup Data Center
- A Topic for Discussion - Open Source Feature-Richness?
- What's the tweeting protocol?
- Dart: a New Web Programming Experience
- Developer Poll
- May 2013 Issue of Linux Journal: Raspberry Pi
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




1 hour 5 min ago
3 hours 37 min ago
4 hours 55 min ago
5 hours 29 min ago
5 hours 52 min ago
10 hours 40 min ago
11 hours 27 min ago
13 hours 1 min ago
14 hours 38 min ago
16 hours 35 min ago