How to Install and Configure Squid Proxy Server on Fedora 16

Squid service plays two main roles which mainly act as a caching proxy server between the user and the web. Second role, squid also regularly used as a content accelerator, or reverse proxy, intercepting requests to a server and using a cached version of the page to serve the request. Follow the following steps to install and configure squid 3.2 proxy server on fedora 16.

1. Install Squid proxy using yum command.

[root@fedora16 ~]# yum install squid -y

Examples :

[root@fedora16 ~]# yum install squid -y
Fedora16-Repository                                                          | 3.7 kB     00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package squid.i686 7:3.2.0.16-1.fc16 will be installed
--> Processing Dependency: libecap.so.2 for package: 7:squid-3.2.0.16-1.fc16.i686
--> Running transaction check
---> Package libecap.i686 0:0.2.0-2.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package              Arch              Version                          Repository            Size
====================================================================================================
Installing:
 squid                i686              7:3.2.0.16-1.fc16                updates              2.3 M
Installing for dependencies:
 libecap              i686              0.2.0-2.fc16                     updates               18 k

Transaction Summary
====================================================================================================
Install       2 Packages

Total download size: 2.3 M
Installed size: 7.7 M
Downloading Packages:
(1/2): libecap-0.2.0-2.fc16.i686.rpm                                         |  18 kB     00:00
(2/2): squid-3.2.0.16-1.fc16.i686.rpm                                        | 2.3 MB     00:27
----------------------------------------------------------------------------------------------------
Total                                                                81 kB/s | 2.3 MB     00:28
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libecap-0.2.0-2.fc16.i686                                                        1/2
  Installing : 7:squid-3.2.0.16-1.fc16.i686                                                     2/2

Installed:
  squid.i686 7:3.2.0.16-1.fc16

Dependency Installed:
  libecap.i686 0:0.2.0-2.fc16

Complete!

2. Configure server hosts file :

[root@fedora16 ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.47   fedora16.ehowstuff.local

3. Configure main squid configuration file. Use vi to edit.

[root@fedora16 ~]# vi /etc/squid/squid.conf

3.1 Add your internal network name into the IP networks list where browsing should be allowed. In this example, your internal network name is ehowstuff.

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

Add acl for ehowstuff network as below :

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
acl ehowstuff src 192.168.1.0/24        # ehowstuff network

3.2 Add ehowstuff network in the ACL section list IP networks where browsing should be allowed :

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

Add ehowstuff to http_access allow as below :

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost
http_access allow ehowstuff

3.3 Make sure squid proxy port is uncomment. normal Squid port listed to port 3128. You can change the proxy port to any available port. As an example, other available port is 8080.

# Squid normally listens to port 3128
http_port 3128

4. Configure auto start at boot for squid service :

[root@fedora16 ~]# chkconfig squid on

5. Start and Stop Squid service :
Start Squid Service :

[root@fedora16 ~]# service squid restart
Redirecting to /bin/systemctl  restart squid.service

Stop Squid Service :

[root@fedora16 ~]# service squid stop
Redirecting to /bin/systemctl  stop squid.service

6. Add Squid port to by pass in iptables firewall. Alternativelym, you can disabled the iptables, but it is recommended to implement iptables on server.

[root@fedora16 ~]# service iptables stop
Redirecting to /bin/systemctl  stop iptables.service
[root@fedora16 ~]# service ip6tables stop
Redirecting to /bin/systemctl  stop ip6tables.service

7.Client browser configuration should be as below :
squid

Full Squid 3 Configuration :

#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
acl ehowstuff src 192.168.1.0/24        # ehowstuff network

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost
http_access allow ehowstuff

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320



How to Install Bind Utilities on Fedora 16

Question :
When i try to test mx record using host command and other bind utility command such as nslookup, i get this error :

[root@fedora16 ~]# host -t mx fedora16.local
-bash: host: command not found

Solution :
BIND Utilities is not a separate package, it is a collection of the client side programs that are included with BIND-9. The BIND package includes the client side programs nslookup, dig and host.

Simply run the following command to install bind-utils on Fedora 16 :

[root@fedora16 ~]# yum install bind-utils -y

Examples :

[root@fedora16 ~]# yum install bind-utils -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind-utils.i686 32:9.8.2-1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                 Arch              Version                       Repository            Size
====================================================================================================
Installing:
 bind-utils              i686              32:9.8.2-1.fc16               updates              179 k

Transaction Summary
====================================================================================================
Install       1 Package

Total download size: 179 k
Installed size: 411 k
Downloading Packages:
bind-utils-9.8.2-1.fc16.i686.rpm                                             | 179 kB     00:01
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 32:bind-utils-9.8.2-1.fc16.i686                                                  1/1

Installed:
  bind-utils.i686 32:9.8.2-1.fc16

Complete!

Test DNS using host command example :

[root@fedora16 ~]# host -t mx fedora16.local
fedora16.local mail is handled by 10 mail.fedora16.local.

Test DNS using nslookup command example:

[root@fedora16 ~]# nslookup
> ns.fedora16.local
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   ns.fedora16.local
Address: 192.168.1.47
> mail.fedora16.local
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   mail.fedora16.local
Address: 192.168.1.51

How to Install and Configure Bind Chroot DNS Server on Fedora 16

DNS is the Domain Name System that maintains a database that can help user’s computer to translate domain names such as www.ehowstuff.com to IP addresses such as 184.173.214.97. DNS on CentOS and Fedora is based on the named daemon, which is built on the BIND package developed through the Internet Software Consortium. (More information is available from the BIND home page at www.isc.org/products/BIND.) However, these are RPM packages associated with DNS. But not all required to build Bind Chroot DNS Server. bind Includes the basic name server software, including /usr/sbin/named. bind-chroot Includes directories that isolate BIND in a so-called “chroot jail,” which limits access if DNS is compromised. In this post, i will guide you on how to install and configure Bind Chroot DNS server on linux Fedora 16 server.

1. Simply run this command to install Bind Chroot DNS Server :

[root@fedora16 ~]# yum install bind-chroot -y

Examples :

[root@fedora16 ~]# yum install bind-chroot -y
Fedora16-Repository                                                          | 3.7 kB     00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind-chroot.i686 32:9.8.2-1.fc16 will be installed
--> Processing Dependency: bind = 32:9.8.2-1.fc16 for package: 32:bind-chroot-9.8.2-1.fc16.i686
--> Running transaction check
---> Package bind.i686 32:9.8.2-1.fc16 will be installed
--> Processing Dependency: bind-libs = 32:9.8.2-1.fc16 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: liblwres.so.80 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libisccfg.so.82 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libisccc.so.80 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libisc.so.83 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libdns.so.81 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libbind9.so.80 for package: 32:bind-9.8.2-1.fc16.i686
--> Running transaction check
---> Package bind-libs.i686 32:9.8.2-1.fc16 will be installed
--> Processing Dependency: bind-license = 32:9.8.2-1.fc16 for package: 32:bind-libs-9.8.2-1.fc16.i686
--> Running transaction check
---> Package bind-license.noarch 32:9.8.1-2.fc16 will be updated
--> Processing Dependency: bind-license = 32:9.8.1-2.fc16 for package: 32:bind-libs-lite-9.8.1-2.fc16.i686
---> Package bind-license.noarch 32:9.8.2-1.fc16 will be an update
--> Running transaction check
---> Package bind-libs-lite.i686 32:9.8.1-2.fc16 will be updated
---> Package bind-libs-lite.i686 32:9.8.2-1.fc16 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch              Version                       Repository          Size
====================================================================================================
Installing:
 bind-chroot               i686              32:9.8.2-1.fc16               updates             71 k
Installing for dependencies:
 bind                      i686              32:9.8.2-1.fc16               updates            2.0 M
 bind-libs                 i686              32:9.8.2-1.fc16               updates            860 k
Updating for dependencies:
 bind-libs-lite            i686              32:9.8.2-1.fc16               updates            621 k
 bind-license              noarch            32:9.8.2-1.fc16               updates             72 k

Transaction Summary
====================================================================================================
Install       3 Packages
Upgrade       2 Packages

Total download size: 3.6 M
Downloading Packages:
(1/5): bind-9.8.2-1.fc16.i686.rpm                                            | 2.0 MB     00:18
(2/5): bind-chroot-9.8.2-1.fc16.i686.rpm                                     |  71 kB     00:00
(3/5): bind-libs-9.8.2-1.fc16.i686.rpm                                       | 860 kB     00:07
(4/5): bind-libs-lite-9.8.2-1.fc16.i686.rpm                                  | 621 kB     00:04
(5/5): bind-license-9.8.2-1.fc16.noarch.rpm                                  |  72 kB     00:00
----------------------------------------------------------------------------------------------------
Total                                                               113 kB/s | 3.6 MB     00:32
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : 32:bind-license-9.8.2-1.fc16.noarch                                              1/7
  Installing : 32:bind-libs-9.8.2-1.fc16.i686                                                   2/7
  Installing : 32:bind-9.8.2-1.fc16.i686                                                        3/7
  Installing : 32:bind-chroot-9.8.2-1.fc16.i686                                                 4/7
  Updating   : 32:bind-libs-lite-9.8.2-1.fc16.i686                                              5/7
  Cleanup    : 32:bind-libs-lite-9.8.1-2.fc16.i686                                              6/7
  Cleanup    : 32:bind-license-9.8.1-2.fc16.noarch                                              7/7

Installed:
  bind-chroot.i686 32:9.8.2-1.fc16

Dependency Installed:
  bind.i686 32:9.8.2-1.fc16                      bind-libs.i686 32:9.8.2-1.fc16

Dependency Updated:
  bind-libs-lite.i686 32:9.8.2-1.fc16              bind-license.noarch 32:9.8.2-1.fc16

Complete!

2. Create a file /var/named/chroot/var/named/fedora16.local with the following configuration:

[root@fedora16 ~]# vi /var/named/chroot/var/named/fedora16.local

Examples :

;
;       Addresses and other host information.
;
@       IN      SOA     fedora16.local. hostmaster.fedora16.local. (
                               2012051901      ; Serial
                               43200      ; Refresh
                               3600       ; Retry
                               3600000    ; Expire
                               2592000 )  ; Minimum

;       Define the nameservers and the mail servers

               IN      NS      ns.fedora16.local.
               IN      A       192.168.1.47
               IN      MX      10 mail.fedora16.local.

mail            IN      A       192.168.1.51
ns              IN      A       192.168.1.47

3. Generate an RNDC key :
The rndc tool is used to managed the named daemon. We need to generate a keyfile called /etc/rndc.key which is referenced both by /etc/rndc.conf and /etc/named.conf To do this we use the following command :

[root@fedora16 ~]# rndc-confgen -a -c /etc/rndc.key
wrote key file "/etc/rndc.key"

View the content of the RNDC key :

[root@fedora16 ~]# cat /etc/rndc.key
key "rndc-key" {
        algorithm hmac-md5;
        secret "B2rQEFnrdcAzAt2BiUmBug==";
};

4. Edit the /var/named/chroot/etc/named.conf file for fedora16.local

[root@fedora16 ~]# vi /var/named/chroot/etc/named.conf
options {
       directory "/var/named";
       dump-file "/var/named/data/cache_dump.db";
       statistics-file "/var/named/data/named_stats.txt";
forwarders { 8.8.8.8; };
};
include "/etc/rndc.key";
// We are the master server for fedora16.local

zone "fedora16.local" {
    type master;
    file "fedora16.local";
};

5. Start the DNS service using the following command :

[root@fedora16 ~]# /etc/init.d/named start
Starting named (via systemctl):                            [  OK  ]

6. Make named daemon auto start during boot :

[root@fedora16 ~]# chkconfig named on

7. Before testing, make sure your pc or server using the Bind Chroot DNS Server that has been set up :

Test DNS using host command :

[root@fedora16 ~]# host -t mx fedora16.local
fedora16.local mail is handled by 10 mail.fedora16.local.

Test DNS using nslookup command :

[root@fedora16 ~]# nslookup
> ns.fedora16.local
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   ns.fedora16.local
Address: 192.168.1.47
> mail.fedora16.local
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   mail.fedora16.local
Address: 192.168.1.51

How to Check Routing Tables on Fedora 16

In Linux operating system, routing table is used by the computer networks or servers to stores the routes of the destinations that responsible for forwarding. Routing tables contain a list of IP addresses and each of IP addresses identifies a network gateway. In this post, i will show you three ways to check and display the linux Routing Table on Fedora 16 server.

By using Route Command :
Route manipulates the kernel’s IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured.

By using netstat command :
Netstat prints information about the Linux networking subsystem such as network connections, routing tables and interface statistics.

1. Display routing table using “route -n” :

[root@fedora16 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 p3p1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 p3p1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 p3p1

2. Display routing table using “netstat -rn” :

[root@fedora16 ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 p3p1
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 p3p1
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 p3p1

3. Display routing table using “ip route show” :

[root@fedora16 ~]# ip route show
default via 192.168.1.1 dev p3p1
169.254.0.0/16 dev p3p1  scope link  metric 1002
192.168.1.0/24 dev p3p1  proto kernel  scope link  src 192.168.1.47

How to Install Vim on Fedora 16

Vim is a text editor that is upwards compatible to Vi. Vim can be used to edit all kinds of plain text. It is especially useful for editing programs. In this post, i will show how to install vim on linux Fedora 16 server. This steps has been tested on Fedora 16, it may working on other linux distribution as well.

If your Fedora 16 does not have vim installed, you’ill get the following error :

[root@fedora16 ~]# vim /etc/httpd/conf/httpd.conf
-bash: vim: command not found

To install vim on your Fedora 16, simply run the following command :

[root@fedora16 ~]# yum install vim -y

or

[root@fedora16 ~]# yum install vim-enhanced -y
[root@fedora16 ~]# yum install vim -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.i686 2:7.3.315-1.fc16 will be installed
--> Processing Dependency: vim-common = 2:7.3.315-1.fc16 for package: 2:vim-enhanced-7.3.315-1.fc16.i686
--> Processing Dependency: libgpm.so.2 for package: 2:vim-enhanced-7.3.315-1.fc16.i686
--> Processing Dependency: libruby.so.1.8 for package: 2:vim-enhanced-7.3.315-1.fc16.i686
--> Running transaction check
---> Package gpm-libs.i686 0:1.20.6-21.fc16 will be installed
---> Package ruby-libs.i686 0:1.8.7.357-1.fc16 will be installed
--> Processing Dependency: libreadline.so.5 for package: ruby-libs-1.8.7.357-1.fc16.i686
---> Package vim-common.i686 2:7.3.315-1.fc16 will be installed
--> Processing Dependency: vim-filesystem for package: 2:vim-common-7.3.315-1.fc16.i686
--> Running transaction check
---> Package compat-readline5.i686 0:5.2-18.fc15 will be installed
---> Package vim-filesystem.i686 2:7.3.315-1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                  Arch         Version                    Repository                   Size
====================================================================================================
Installing:
 vim-enhanced             i686         2:7.3.315-1.fc16           Fedora16-Repository         889 k
Installing for dependencies:
 compat-readline5         i686         5.2-18.fc15                Fedora16-Repository         126 k
 gpm-libs                 i686         1.20.6-21.fc16             updates                      29 k
 ruby-libs                i686         1.8.7.357-1.fc16           updates                     1.8 M
 vim-common               i686         2:7.3.315-1.fc16           Fedora16-Repository         5.4 M
 vim-filesystem           i686         2:7.3.315-1.fc16           Fedora16-Repository          14 k

Transaction Summary
====================================================================================================
Install       6 Packages

Total download size: 8.3 M
Installed size: 27 M
Downloading Packages:
(2/6): gpm-libs-1.20.6-21.fc16.i686.rpm                                      |  29 kB     00:00
(3/6): ruby-libs-1.8.7.357-1.fc16.i686.rpm                                   | 1.8 MB     00:22
----------------------------------------------------------------------------------------------------
Total                                                               349 kB/s | 8.3 MB     00:24
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:vim-filesystem-7.3.315-1.fc16.i686                                             1/6
  Installing : 2:vim-common-7.3.315-1.fc16.i686                                                 2/6
  Installing : gpm-libs-1.20.6-21.fc16.i686                                                     3/6
  Installing : compat-readline5-5.2-18.fc15.i686                                                4/6
  Installing : ruby-libs-1.8.7.357-1.fc16.i686                                                  5/6
  Installing : 2:vim-enhanced-7.3.315-1.fc16.i686                                               6/6

Installed:
  vim-enhanced.i686 2:7.3.315-1.fc16

Dependency Installed:
  compat-readline5.i686 0:5.2-18.fc15                gpm-libs.i686 0:1.20.6-21.fc16
  ruby-libs.i686 0:1.8.7.357-1.fc16                  vim-common.i686 2:7.3.315-1.fc16
  vim-filesystem.i686 2:7.3.315-1.fc16

Complete!

To start using vim editor instead of vi as below :

[root@fedora16 ~]# vim /etc/httpd/conf/httpd.conf

How to Install and Getting MySQL Support In PHP5 on Fedora 16

PHP: Hypertext Preprocessor is a widely used, free and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML. PHP applications are commonly found with the filename extensions .php, .php4, or .php5. PHP5 does not included in Fedora 16 with minimum type of installation. You have to install it manually if you really need it.

To install basic PHP5 package, simply run this command :

[root@fedora16 ~]# yum install php -y

To get MySQL support in PHP5, you have to install php-mysql module. Run this command to install phph-mysql. It will help you to install php-mysql dependencies,php-pdo. php-pdo is required to successfully run php-mysql module :

[root@fedora16 ~]# yum install php-mysql -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.i686 0:5.3.10-1.fc16 will be installed
--> Processing Dependency: php-pdo(x86-32) = 5.3.10-1.fc16 for package: php-mysql-5.3.10-1.fc16.i686
--> Running transaction check
---> Package php-pdo.i686 0:5.3.10-1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                 Arch               Version                     Repository             Size
====================================================================================================
Installing:
 php-mysql               i686               5.3.10-1.fc16               updates                77 k
Installing for dependencies:
 php-pdo                 i686               5.3.10-1.fc16               updates                73 k

Transaction Summary
====================================================================================================
Install       2 Packages

Total download size: 150 k
Installed size: 346 k
Downloading Packages:
(1/2): php-mysql-5.3.10-1.fc16.i686.rpm                                      |  77 kB     00:01
(2/2): php-pdo-5.3.10-1.fc16.i686.rpm                                        |  73 kB     00:00
----------------------------------------------------------------------------------------------------
Total                                                                58 kB/s | 150 kB     00:02
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-pdo-5.3.10-1.fc16.i686                                                       1/2
  Installing : php-mysql-5.3.10-1.fc16.i686                                                     2/2

Installed:
  php-mysql.i686 0:5.3.10-1.fc16

Dependency Installed:
  php-pdo.i686 0:5.3.10-1.fc16

Complete!

Note :
php-mysql : A module for PHP applications that use MySQL databases
php-pdo : A database access abstraction module for PHP applications

How to Install “man” Command on Fedora 16

man is the system’s manual pager. Each page argument given to man is normally the name of a program, utility or function. The Linux command “man” is used to display the manual page for other command and also will help you to explain the functions for the commands that commonly used. The term “man” is short for manual. On Fedora 16 minimum installation, “man” command has not been installed. In this post, i will show how to install “man” pages command on Linux Fedora 16 server.

You’ill get the following warning if you type man command on your Fedora 16 server.

-bash: man: command not found

To install “man” command, simply run the following line :

[root@fedora16 ~]# yum install man -y

Examples :

[root@fedora16 ~]# yum install man -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package man-db.i686 0:2.6.0.2-2.fc16 will be installed
--> Processing Dependency: groff for package: man-db-2.6.0.2-2.fc16.i686
--> Processing Dependency: libpipeline.so.1 for package: man-db-2.6.0.2-2.fc16.i686
--> Processing Dependency: less for package: man-db-2.6.0.2-2.fc16.i686
--> Running transaction check
---> Package groff.i686 0:1.21-3.fc16 will be installed
---> Package less.i686 0:444-2.fc16 will be installed
---> Package libpipeline.i686 0:1.2.0-1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package               Arch           Version                   Repository                     Size
====================================================================================================
Installing:
 man-db                i686           2.6.0.2-2.fc16            Fedora16-Repository           563 k
Installing for dependencies:
 groff                 i686           1.21-3.fc16               Fedora16-Repository           1.9 M
 less                  i686           444-2.fc16                Fedora16-Repository           109 k
 libpipeline           i686           1.2.0-1.fc16              Fedora16-Repository            47 k

Transaction Summary
====================================================================================================
Install       4 Packages

Total download size: 2.6 M
Installed size: 9.3 M
Downloading Packages:
----------------------------------------------------------------------------------------------------
Total                                                                18 MB/s | 2.6 MB     00:00
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : less-444-2.fc16.i686                                                             1/4
  Installing : groff-1.21-3.fc16.i686                                                           2/4
  Installing : libpipeline-1.2.0-1.fc16.i686                                                    3/4
  Installing : man-db-2.6.0.2-2.fc16.i686                                                       4/4

Installed:
  man-db.i686 0:2.6.0.2-2.fc16

Dependency Installed:
  groff.i686 0:1.21-3.fc16       less.i686 0:444-2.fc16       libpipeline.i686 0:1.2.0-1.fc16

Complete!

How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on Fedora 16

In this post, i will share on how to install, update and remove RPM packages from CD-ROM/DVD-ROM image or local yum repository on linux Fedora 16 server. This will very useful when you are running on slow internet connection. Instead of go through the internet connection, it is possible to use local repository to install the module and package. Follow these steps to setup your local CD-ROM/DVD-ROM yum repository on linux Fedora 16 server.

1. Mount your DVD into /mnt or /media. It’s depend on you.

[root@fedora16 ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only

2. Enter to /mnt directory and list out the files :

[root@fedora16 ~]# cd /mnt
[root@fedora16 mnt]# ls
GPL       RPM-GPG-KEY-fedora               RPM-GPG-KEY-fedora-ppc    RPM-GPG-KEY-fedora-sparc64
images    RPM-GPG-KEY-fedora-16-primary    RPM-GPG-KEY-fedora-ppc64  RPM-GPG-KEY-fedora-x86_64
isolinux  RPM-GPG-KEY-fedora-16-secondary  RPM-GPG-KEY-fedora-s390   TRANS.TBL
Packages  RPM-GPG-KEY-fedora-arm           RPM-GPG-KEY-fedora-s390x
repodata  RPM-GPG-KEY-fedora-i386          RPM-GPG-KEY-fedora-sparc

3. Create files fedora16.repo under /etc/yum.repos.d and enter the following lines :

[root@fedora16 ~]# vi /etc/yum.repos.d/fedora16.repo

Enter these lines in fedora16.repo :

[Fedora16-Repository]
name=DVD-Fedora16 Repository
baseurl=file:///mnt
enabled=1
gpgcheck=0

Please proceed to step 4 – step 8 when you perform yum command to install the package or module and get the following error :

Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. 
Please verify its path and try again

4. Create repo.disabled inside /etc/yum.repos.d :

[root@fedora16 ~]# mkdir /etc/yum.repos.d/repo.disabled

[root@fedora16 ~]# ls /etc/yum.repos.d/
fedora16.repo fedora.repo  fedora-updates.repo  fedora-updates-testing.repo  repo.disabled

6. Then moved all these 3 repo files into “repo.disabled” folder :

[root@fedora16 ~]# mv /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/repo.disabled
[root@fedora16 ~]# mv /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/repo.disabled
[root@fedora16 ~]# mv /etc/yum.repos.d/fedora-updates-testing.repo /etc/yum.repos.d/repo.disabled

7. List out the updated files and folders inside /etc/yum.repos.d :

[root@fedora16 ~]# ls -l /etc/yum.repos.d/
total 8
-rw-r--r--. 1 root root   92 Mar 18 00:09 fedora16.repo
drwxr-xr-x. 2 root root 4096 Mar 18 01:27 repo.disabled

Note : Only file fedora16.repo and folder repo.disabled should be exist.

8. Run yum clean all to clear up your yum cache directory :

[root@fedora16 ~]# yum clean all
Cleaning repos: Fedora16-Repository
Cleaning up Everything

9. Steps completed. You can start using yum command as usual.

[root@fedora16 ~]# yum install module/package
[root@fedora16 ~]# yum update module/package
[root@fedora16 ~]# yum remove module/package

How to Install wget on Fedora 16

In this post, i will show the quick steps to install wget on linux Fedora 16 server. wget command does not exist on your Fedora 16 with minimum installation. Wget is a free network utility for linux to download files from the Web. Therefore, there is simple step to install the wget command utility into your RHEL 6 server. This post assumed that you have set up local yum repository using your DVDROM.

If you haven’t set up the local yum repository, please proceed to this steps :
How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on Fedora 16

Without wget command installed, you will get this error :

[root@fedora16 ~]# wget
-bash: wget: command not found

Simply run the following command to install wget command :

[root@fedora16 ~]# yum install wget -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package wget.i686 0:1.12-4.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package          Arch             Version                    Repository                       Size
====================================================================================================
Installing:
 wget             i686             1.12-4.fc16                Fedora16-Repository             478 k

Transaction Summary
====================================================================================================
Install       1 Package

Total download size: 478 k
Installed size: 1.8 M
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : wget-1.12-4.fc16.i686                                                            1/1

Installed:
  wget.i686 0:1.12-4.fc16

Complete!

How to Install php-mcrypt on Fedora 16

php-mcrypt is a standard of PHP module that provides mcrypt library support. In linux systems,mcrypt is necessary for installing CMSes like majento. Before you start to install any software such as CMSes like majento, you need to install the mcrypt library. In this post, i will show the quick step on how to install php-mcrypt on linux Fedora 16 server.

Simply run the following command to install php-mcrypt on Fedora 16 :

[root@fedora16 ~]# yum install php-mcrypt -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.i686 0:5.3.10-1.fc16 will be installed
--> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt-5.3.10-1.fc16.i686
--> Processing Dependency: libltdl.so.7 for package: php-mcrypt-5.3.10-1.fc16.i686
--> Running transaction check
---> Package libmcrypt.i686 0:2.5.8-10.fc15 will be installed
---> Package libtool-ltdl.i686 0:2.4-9.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch              Version                     Repository            Size
====================================================================================================
Installing:
 php-mcrypt                i686              5.3.10-1.fc16               updates               32 k
Installing for dependencies:
 libmcrypt                 i686              2.5.8-10.fc15               fedora                93 k
 libtool-ltdl              i686              2.4-9.fc16                  updates               45 k

Transaction Summary
====================================================================================================
Install       3 Packages

Total download size: 170 k
Installed size: 192 k
Downloading Packages:
(1/3): libmcrypt-2.5.8-10.fc15.i686.rpm                                      |  93 kB     00:02
(2/3): libtool-ltdl-2.4-9.fc16.i686.rpm                                      |  45 kB     00:00
(3/3): php-mcrypt-5.3.10-1.fc16.i686.rpm                                     |  32 kB     00:00
----------------------------------------------------------------------------------------------------
Total                                                                31 kB/s | 170 kB     00:05
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libmcrypt-2.5.8-10.fc15.i686                                                     1/3
  Installing : libtool-ltdl-2.4-9.fc16.i686                                                     2/3
  Installing : php-mcrypt-5.3.10-1.fc16.i686                                                    3/3

Installed:
  php-mcrypt.i686 0:5.3.10-1.fc16

Dependency Installed:
  libmcrypt.i686 0:2.5.8-10.fc15                   libtool-ltdl.i686 0:2.4-9.fc16

Complete!

How to Fix “Warning: RPMDB altered outside of yum” Error on Linux Fedora 16 Server

Question :
When i try to install the packages or software using the yum command, the following error or warning message appeared:

Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing :......

Answer :
Some application has altered the rpm database (installed or removed a package) without going through the Yum APIs. To avoid this, it’s recommended to update, install or remove RPM packages using yum command, instead of ” rpm -e” or “rpm -i” or “rpm -ivh” or “rpm -Uvh”.

To fix this, just run this command :

[root@fedora16 ~]# yum clean all
Cleaning repos: Fedora16-Repository
Cleaning up Everything

How to Install “setup” Command on Fedora 16

Question :
When i try to use setup command on linux Fedora 16, i will get the following error :

[root@fedora16 ~]# setup
-bash: setup: command not found

Answer :
“Setup”command is a set of system configuration and setup files. The setup package contains a set of important system configuration and setup files, such as passwd, group, and profile. “Setup” command does not installed automatically on linux Fedora 16 with minimum type of server installation. In order to use setup command utility, you have to rum the following command :

[root@fedora16 ~]# yum install setup -y

Example :

[root@fedora16 ~]# yum install setup -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package setup.noarch 0:2.8.36-2.fc16 will be updated
---> Package setup.noarch 0:2.8.36-3.fc16 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package             Arch                 Version                       Repository             Size
====================================================================================================
Updating:
 setup               noarch               2.8.36-3.fc16                 updates               155 k

Transaction Summary
====================================================================================================
Upgrade       1 Package

Total download size: 155 k
Downloading Packages:
setup-2.8.36-3.fc16.noarch.rpm                                               | 155 kB     00:03
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : setup-2.8.36-3.fc16.noarch                                                       1/2
warning: /etc/shadow created as /etc/shadow.rpmnew
  Cleanup    : setup-2.8.36-2.fc16.noarch                                                       2/2

Updated:
  setup.noarch 0:2.8.36-3.fc16

Complete!

Run the following command to get more information about “setup” :

[root@fedora16 ~]# yum info setup
Installed Packages
Name        : setup
Arch        : noarch
Version     : 2.8.36
Release     : 2.fc16
Size        : 665 k
Repo        : installed
From repo   : anaconda-0
Summary     : A set of system configuration and setup files
URL         : https://fedorahosted.org/setup/
License     : Public Domain
Description : The setup package contains a set of important system configuration and
            : setup files, such as passwd, group, and profile.

Available Packages
Name        : setup
Arch        : noarch
Version     : 2.8.36
Release     : 3.fc16
Size        : 155 k
Repo        : updates
Summary     : A set of system configuration and setup files
URL         : https://fedorahosted.org/setup/
License     : Public Domain
Description : The setup package contains a set of important system configuration and
            : setup files, such as passwd, group, and profile.