Sunteți pe pagina 1din 19

Configuration of apache web serverServer side[root@tyit Desktop]# rpm -q httpd httpd-2.2.15-5.el6.

i686 [root@tyit Desktop]# cd /var/www/html [root@tyit html]# vim index.html [root@tyit html]# vim /etc.httpd/conf/httpd.conf <VirtualHost tyit.com:80> # ServerAdmin webmaster@dummy-host.example.com DocumentRoot /var/www/html ServerName tyit.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> [root@tyit html]# service httpd restart Stopping httpd: Starting httpd: [root@tyit html]# Client side[ [ OK OK ] ]

Configuration of ftp serverServer side[root@tyit Desktop]# rpm -q vsftpd vsftpd-2.2.2-6.el6.i686 [root@tyit Desktop]# cd /var/ftp/pub [root@tyit pub]# touch f1 f2 [root@tyit pub]# cat > f3 this is file 3 content [root@tyit pub]# cd [root@tyit ~]# chmod 775 /var/ftp/pub [root@tyit ~]# vim /etc/vsftpd/vsftpd.conf 12 anonymous_enable=YES 27 anon_upload_enable=YES 28 # 29 # Uncomment this if you want the anonymous FTP user to be able to create 30 # new directories. 31 anon_mkdir_write_enable=YES [root@tyit ~]# service vsftpd restart Shutting down vsftpd: ] Starting vsftpd for vsftpd: ] [root@tyit ~]# chkconfig vsftpd on [root@tyit ~]# [root@tyit ~]# touch f4 [root@tyit ~]# chmod 757 /var/ftp/pub [root@tyit ~]# setenforce 0 [root@tyit ~]# ftp 192.168.11.14 Connected to 192.168.11.14 (192.168.11.14). 220 (vsFTPd 2.2.2) Name (192.168.11.14:root): ftp 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd pub 250 Directory successfully changed. ftp> put f4 local: f4 remote: f4 227 Entering Passive Mode (192,168,11,14,75,216).

[ [

OK OK

150 Ok to send data. 226 Transfer complete. ftp> ls 227 Entering Passive Mode (192,168,11,14,38,26). 150 Here comes the directory listing. -rw-r--r-1 0 0 0 Sep 25 -rw-r--r-1 0 0 0 Sep 25 -rw-r--r-1 0 0 22 Sep 25 -rw------1 14 50 0 Sep 25 226 Directory send OK. OutputClient side-

02:15 02:15 02:16 02:39

f1 f2 f3 f4

Configuration of nfs server[root@tyit Desktop]# rpm -q nfs-utils nfs-utils-1.2.2-7.el6.i686 [root@tyit Desktop]# mkdir /source [root@tyit Desktop]# vim /source/sourcefile [root@tyit Desktop]# chmod 777 /source [root@tyit Desktop]# ifconfig eth1 eth1 Link encap:Ethernet HWaddr 00:0C:29:BA:3A:25 inet addr:192.168.11.14 Bcast:192.168.11.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:feba:3a25/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1142 errors:0 dropped:0 overruns:0 frame:0 TX packets:34 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:125224 (122.2 KiB) TX bytes:5342 (5.2 KiB) Interrupt:19 Base address:0x2000 [root@tyit Desktop]# vim /etc/exports /source 192.168.11.0/24(rw,sync) [root@tyit Desktop]# service nfs restart Shutting down NFS mountd: ] Shutting down NFS daemon: ] Shutting down NFS quotas: ] Shutting down NFS services: ] Starting NFS services: ] Starting NFS quotas: ] Starting NFS daemon: ] Starting NFS mountd: ] [root@tyit Desktop]# chkconfig nfs on [root@tyit Desktop]# mkdir /mp2 [root@tyit Desktop]# vim /etc/fstab [ [ [ [ [ [ [ [ OK OK OK OK OK OK OK OK

tmpfs /dev/shm 0 0 devpts /dev/pts gid=5,mode=620 0 0 sysfs /sys 0 0 proc /proc 0 0 192.168.11.14:/source /mp2 nfs defaults 0 0 [root@tyit [root@tyit [root@tyit sourcefile [root@tyit my name is [root@tyit Desktop]# mount -a Desktop]# cd /mp2 mp2]# ls mp2]# cat sourcefile pravesh shukla mp2]#

tmpfs devpts sysfs proc

defaults

defaults defaults

Configuaration of samba server[root@tyit ~]# rpm -q samba samba-3.5.4-68.el6.i686 [root@tyit ~]# mkdir /dirsamba [root@tyit ~]# vim /dirsamba/f1 [root@tyit ~]# chmod 777 /dirsamba [root@tyit ~]# vim /etc/samba/smb.conf workgroup = RRAAHHUULL server string = Samba Server Version %v netbios name = samba server [share] path = /dirsamba readable = yes writable = yes browseable = yes hosts allow = 192.168.1.0/24 [root@tyit ~]# service smb restart Shutting down SMB services: [FAILED] Starting SMB services: [ ] [root@tyit ~]# chkconfig smb on [root@tyit ~]# setenforce 0 [root@tyit ~]# useradd u7 [root@tyit ~]# smbpasswd -a u7 New SMB password: Retype new SMB password: Added user u7. [root@tyit ~]# smbclient //192.168.1.50/share -U u7 Enter u7's password: Domain=[RRAAHHUULL] OS=[Unix] Server=[Samba 3.5.4-68.el6] smb: \> ls . D 0 Tue Sep 24 16:14:07 2013 .. DR 0 Tue Sep 24 16:13:31 2013 f1 28 Tue Sep 24 16:14:07 2013 39371 blocks of size 262144. 12241 blocks available smb: \>

OK

configuration of proxy server(squid)server side[root@tyit Desktop]# rpm -q squid squid-3.1.4-1.el6.i686 [root@tyit Desktop]# ifconfig eth1 eth1 Link encap:Ethernet HWaddr 00:0C:29:BA:3A:25 inet addr:192.168.11.14 Bcast:192.168.11.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:feba:3a25/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:24623 errors:0 dropped:0 overruns:0 frame:0 TX packets:48 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2276714 (2.1 MiB) TX bytes:7649 (7.4 KiB) Interrupt:19 Base address:0x2000 [root@tyit Desktop]# vim /etc/squid/squid.conf uncomment lines 5 acl localhost src 192.168.11.0/24 57 http_access allow all 64 http_port 3128 [root@tyit Desktop]# service squid restart Stopping squid: ................ Starting squid: . [root@tyit Desktop]# [ [ OK OK ] ]

Client sideClick on edit menu and select preferences

Firewall and secutrity configuration[root@localhost Desktop]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:0C:29:D7:8E:BD inet addr:192.168.73.81 Bcast:192.168.73.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fed7:8ebd/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:280 errors:0 dropped:0 overruns:0 frame:0 TX packets:28 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:26847 (26.2 KiB) TX bytes:4765 (4.6 KiB) Interrupt:19 Base address:0x2000 [root@localhost Desktop]# ping 192.168.73.81 PING 192.168.73.81 (192.168.73.81) 56(84) bytes of data. 64 bytes from 192.168.73.81: icmp_seq=1 ttl=64 time=0.078 ms 64 bytes from 192.168.73.81: icmp_seq=2 ttl=64 time=0.039 ms 64 bytes from 192.168.73.81: icmp_seq=3 ttl=64 time=0.048 ms 64 bytes from 192.168.73.81: icmp_seq=4 ttl=64 time=0.527 ms 64 bytes from 192.168.73.81: icmp_seq=5 ttl=64 time=0.075 ms ^C --- 192.168.73.81 ping statistics --5 packets transmitted, 5 received, 0% packet loss, time 4209ms rtt min/avg/max/mdev = 0.039/0.153/0.527/0.187 ms [root@localhost Desktop]# ftp 192.168.73.81 bash: ftp: command not found [root@localhost Desktop]# cd /Packages/ [root@localhost Packages]# rpm -ivh ftp* warning: ftp-0.17-51.1.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Preparing... ########################################### [100%] 1:ftp ########################################### [100%] [root@localhost ~]# ftp 192.168.73.81 Connected to 192.168.73.81 (192.168.73.81). 220 (vsFTPd 2.2.2) Name (192.168.73.81:root): ftp 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd pub 250 Directory successfully changed.

ftp> bye 221 Goodbye. [root@localhost ~]# iptables -I INPUT -s 192.168.73.81 -d 192.168.73.81 -j REJECT [root@localhost ~]# ftp 192.168.73.81 ftp: connect: Connection timed out ftp> bye [root@localhost ~]# ping 192.168.73.81 PING 192.168.73.81 (192.168.73.81) 56(84) bytes of data. ^C --- 192.168.73.81 ping statistics --8 packets transmitted, 0 received, 100% packet loss, time 7966ms [root@localhost ~]# [root@localhost ~]# Chain INPUT (policy target prot opt iptables -F iptables -L ACCEPT) source

destination destination

Chain FORWARD (policy ACCEPT) target prot opt source

Chain OUTPUT (policy ACCEPT) target prot opt source destination [root@localhost ~]# iptables -I INPUT -p tcp --dport 20 -s 192.168.73.81 -d 192.168.73.81 -j REJECT [root@localhost ~]# ping 192.168.73.81 PING 192.168.73.81 (192.168.73.81) 56(84) bytes of data. 64 bytes from 192.168.73.81: icmp_seq=1 ttl=64 time=0.103 ms 64 bytes from 192.168.73.81: icmp_seq=2 ttl=64 time=0.062 ms 64 bytes from 192.168.73.81: icmp_seq=3 ttl=64 time=0.079 ms 64 bytes from 192.168.73.81: icmp_seq=4 ttl=64 time=0.077 ms ^C --- 192.168.73.81 ping statistics --4 packets transmitted, 4 received, 0% packet loss, time 3449ms rtt min/avg/max/mdev = 0.062/0.080/0.103/0.016 ms [root@localhost ~]# ftp 192.168.73.81 Connected to 192.168.73.81 (192.168.73.81). 220 (vsFTPd 2.2.2) Name (192.168.73.81:root): ftp 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> bye 221 Goodbye.

[root@localhost ~]# iptables -I INPUT -p tcp --dport ftp -s 192.168.73.81 -d 192.168.73.81 -j REJECT [root@localhost ~]# ftp 192.168.73.81 ftp: connect: Connection refused ftp> bye [root@localhost ~]# ssh 192.168.73.81 The authenticity of host '192.168.73.81 (192.168.73.81)' can't be established. RSA key fingerprint is 63:4c:83:48:ae:e9:b0:b2:8c:0d:f5:f8:8a:2a:94:ea. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.73.81' (RSA) to the list of known hosts. root@192.168.73.81's password: Permission denied, please try again. root@192.168.73.81's password: [root@localhost ~]# logout Connection to 192.168.73.81 closed. [root@localhost ~]# iptables -A INPUT -p tcp --dport ssh -s 192.168.73.81 -d 192.168.73.81 -j REJECT [root@localhost ~]# ssh 192.168.73.81 ssh: connect to host 192.168.73.81 port 22: Connection refused [root@localhost ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination REJECT tcp -- 192.168.73.81 192.168.73.81 tcp dpt:ssh reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination [root@localhost ~]# sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 24 Policy from config file: targeted [root@localhost ~]# getenforce Enforcing [root@localhost ~]# setenforce 0 [root@localhost ~]# getenforce Permissive [root@localhost ~]# lokkit --disabled [root@localhost ~]# lokkit --enabled [root@localhost ~]# lokkit --disabled [root@localhost ~]# lokkit --selinux=enforcing

Installation of packages[root@harshali ~]# rpm --version RPM version 4.4.2 [root@harshali ~]# rpm --test -e squid [root@harshali ~]# rpm -q --requires squid /bin/bash /bin/sh /bin/sh /bin/sh /bin/sh /bin/sh /bin/sh /sbin/chkconfig /usr/bin/perl bash >= 2.0 chkconfig config(squid) = 7:2.6.STABLE6-3.el5 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.2.3) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.3.2) libc.so.6(GLIBC_2.3.4) libcrypt.so.1 libcrypt.so.1(GLIBC_2.0) libcrypto.so.6 libdl.so.2 liblber-2.3.so.0 libldap-2.3.so.0 libm.so.6 libm.so.6(GLIBC_2.0) libnsl.so.1 libnsl.so.1(GLIBC_2.0) libpam.so.0 libpam.so.0(LIBPAM_1.0) libpthread.so.0 libpthread.so.0(GLIBC_2.0) libpthread.so.0(GLIBC_2.1) libpthread.so.0(GLIBC_2.2) libpthread.so.0(GLIBC_2.3.2) librt.so.1 libsasl2.so.2 libssl.so.6 libz.so.1

logrotate perl >= 0:5.003 perl(File::Basename) perl(Getopt::Std) perl(URI::URL) perl(getopts.pl) perl(strict) perl(vars) rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rtld(GNU_HASH) shadow-utils shadow-utils [root@harshali ~]# rpm -q --provides nfs package nfs is not installed [root@harshali ~]# rpm -q --provides nfs-utils config(nfs-utils) = 1:1.0.9-16.el5 knfsd knfsd-clients knfsd-lock nfs-server nfs-server-clients nfs-utils = 1:1.0.9-16.el5 [root@harshali ~]# rpm -q httpd nfs-utils vsftpd httpd-2.2.3-6.el5 nfs-utils-1.0.9-16.el5 vsftpd-2.0.5-10.el5 [root@harshali ~]# rpm -q --qf '%-20 {name}\t %10{version}\n' rpmq: no arguments given for query [root@harshali ~]# rpm -q --qf '%-20{name}\t%10{version}\n' rpmq: no arguments given for query [root@harshali ~]# rpm -q --qf '%-20{name}\t%10{version}\n' httpd nfs-utils vsftpd httpd 2.2.3 nfs-utils 1.0.9 vsftpd 2.0.5 [root@harshali ~]# rpm -qa Fortune-mod* [root@harshali ~]# rpm -qa |grave Fortune-mod* bash: grave: command not found [root@harshali ~]# rpm -qa |grep Fortune-mod* [root@harshali ~]# rpm -qa |grep samba-mod* [root@harshali ~]# rpm -qa |grep samba samba-client-3.0.23c-2 system-config-samba-1.2.39-1.el5 samba-3.0.23c-2 samba-common-3.0.23c-2 [root@harshali ~]# vim /etc/exports

[root@harshali ~]# chmod 770 /etc/exports [root@harshali ~]# useradd u1 [root@harshali ~]# chown u1 /etc/exports [root@harshali ~]# chgrp u1 /etc/exports [root@harshali ~]# rpm -V nfs-utils [root@harshali ~]# vim /etc/vsftpd/vsftpd.conf [root@harshali ~]# chown u1 /etc/vsftpd/vsftpd.conf [root@harshali ~]# chgrp u1 /etc/vsftpd/vsftpd.conf [root@harshali ~]# rpm -V vsftpd .....UGT c /etc/vsftpd/vsftpd.conf [root@harshali ~]#

Configuration of TCP/IP[root@tyit Desktop]# setup

[root@tyit Desktop]# service network restart *******************************output*************************** ********* Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] [root@tyit Desktop]#vim /etc/sysconfig/network-scripts/ifcfgeth0

[root@tyit Desktop]#vim /etc/sysconfig/network

[root@tyit Desktop]#system-config-network

[root@tyit Desktop]# ifconfig eth0 198.162.11.10 netmask 255.255.255.0 broadcast 198.162.11.255 [root@tyit Desktop]# ifconfig eth0 *******************************output*************************** ********* eth0 Link encap:Ethernet HWaddr 00:0C:29:E6:F6:0F inet addr:198.162.11.10 Bcast:198.162.11.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fee6:f60f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1363 errors:0 dropped:0 overruns:0 frame:0 TX packets:37 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:117748 (114.9 KiB) TX bytes:5775 (5.6 KiB) Interrupt:19 Base address:0x2000 ****************************************************************

S-ar putea să vă placă și