RHCE Series: SSH and NTP

SSH

  • Configure key-based authentication.
  • Configure additional options described in documentation.

NTP

  • Synchronize time using other NTP peers.

In Red Hat 6 (and I’m sure in 5 as well), public key authentication is enabled by default, but if you’re unsure, you can uncomment the option and verify that it is set to yes.

 

Once that is complete. We can go to our client pc, generate keys, and copy the public key over.

 

Once that has completed, we can ssh to 192.168.1.1 (server1) from client1 without a password, but use a private / public key exchange.

Now, let’s configure ntp.

 

If you want to use other peers, you can modify the ‘server’ directive in /etc/ntpd.conf. Besure to use ‘chkconfig’ to make ntpd persistent.

October 27, 2012

Posted In: Linux, NTP, OpenSSH, RHCE Study Notes, SSH

RHCE Series: HTTP

  • Configure a virtual host.
  • Configure private directories.
  • Deploy a basic CGI application.
  • Configure group-managed content.

Install apache:

yum -y install httpd httpd-manual links

The httpd-manual is a great resource for information, but isn’t needed. The links package is needed for the server-status utilities.

First, let’s create our virtual hosts. We’ll need to create our DocumentRoot directories.

 

Next, you’ll need to edit the /etc/httpd/conf/httpd.conf

 

When you enable virtual hosts in apache, the default website in /var/www/html will not work. You will have to add another virtual host if you want to serve content from that directory. In this configuration, apache will intercept the http headers and look at the destination url and direct traffic based upon that information.

Now that the httpd.conf has been modified, we’ll need to restart apache.

 

You’ll notice that you can use the ‘httpd -S’ command to show the virtual hosts residing on the server. Let’s create some content to view in the virtual hosts.

 

Now, let’s try to view the content.

 

A quick peak at the error_log shows why we can’t view the page(s).

Notice, that I labeled the index files index.htm. Be default, index.html and index.html.var are the default index pages AND apache, by default, doesn’t print a directory listing as a default index page if a index.html or index.html.var page doesn’t exist. So, to fix this, I had to add index.htm to the “DirectoryIndex” directive in the httpd.conf

Now, let’s try this again.

Now, the sites are working. So, let’s go on to the next objective of configuring private directories.

We’ll set up vhost.server1.example.com to create a private directory with.

 

Now, let’s go ahead and set up group managed content, then we’ll deploy a cgi application.

 

This time, the user ‘james’ was allowed because the user was in the ‘sysadmin’ group. Now the cgi application.

The last and final objective, though not on the RHCE offical list, it’s a useful tool for working with httpd servers. Setting up the server-status tool.

First, you’ll need to edit the httpd.conf.

You can use ‘apachectl status|fullstatus’ to get real time statistics of the web server utilization.

October 27, 2012

Posted In: Apache, http, Linux, RHCE Study Notes