вторник, 25 сентября 2012 г.

apache subdomain virtualhosts

Пример конфига для апача когда есть сабдомены на одном айпи

NameVirtualHost *
<VirtualHost *>
        ServerName articleaday.com
        DocumentRoot /var/www/html/articleaday/
        CustomLog logs/articleaday.access.log combined
        ErrorLog logs/articleaday.error.log
        ServerAlias www.articleaday.com
     <Directory "/var/www/html/articleaday/">
        Options +Indexes +FollowSymLinks +ExecCGI
        AllowOverride All
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
<VirtualHost *>
        ServerName postfixadmin.articleaday.com
        DocumentRoot /var/www/html/postfixadmin/
</VirtualHost>
<VirtualHost *>
        DocumentRoot /var/www/html/mail/
        ServerName webmail.articleaday.com
</VirtualHost>
<VirtualHost *>
        ServerName phpmyadmin.articleaday.com
        DocumentRoot /var/www/html/phpMyAdmin/
</VirtualHost>





понедельник, 3 сентября 2012 г.

2 свича - 2 линка и MST

На обоих свичах конфигурация

Глобально включить MST и зайти в режим настройки MST выполнив команду
spanning-tree mode mst 
spanning-tree extend system-id
spanning-tree mst configuration
name MST (Имя региона MST)
 revision 1 (MST revision number)
 instance 1 vlan 1-99, 200-299, 400-499, 600-699, 800-899, 1000-1099, 1200-1299
 instance 1 vlan 1400-1499, 1600-1699, 1800-1899, 2000-2099, 2200-2299
 instance 1 vlan 2400-2499, 2600-2699, 2800-2899, 3000-3099, 3200-3299
 instance 1 vlan 3400-3499, 3600-3699, 3800-3899, 4000-4094
 instance 2 vlan 100-199, 300-399, 500-599, 700-799, 900-999, 1100-1199
 instance 2 vlan 1300-1399, 1500-1599, 1700-1799, 1900-1999, 2100-2199
 instance 2 vlan 2300-2399, 2500-2599, 2700-2799, 2900-2999, 3100-3199
 instance 2 vlan 3300-3399, 3500-3599, 3700-3799, 3900-3999

как видим создали 2 MST instance для балансировки вланов по портам, чтобы оба порта работали. Теперь конфигурация интерфейсов

interface GigabitEthernet1/0/1
 description ODF-2 
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport nonegotiate
 speed nonegotiate
 spanning-tree link-type point-to-point
 spanning-tree mst 1 port-priority 112
 spanning-tree mst 2 port-priority 144
end

interface GigabitEthernet1/0/2
 description ODF-3 
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport nonegotiate
 speed nonegotiate
 spanning-tree link-type point-to-point
 spanning-tree mst 1 port-priority 144
 spanning-tree mst 2 port-priority 112

Как видим разные MST instance имет разные приоритеты на портах - причину смотрим выше.
Объяснение еще одной команды

spanning-tree link-type {point-to-point | shared}
no spanning-tree link-type

Syntax Description
 point-to-point
 Specify that the link type of an interface is point-to-point. 
 shared
 Specify that the link type of an interface is shared.

Defaults
The switch derives the link type of an interface from the duplex mode. A full-duplex interface is considered a point-to-point link, and a half-duplex interface is considered a shared link.
()

Увидеть это также можно вот так

#show spanning-tree interface gi 1/0/1 detail  
 Port 1 (GigabitEthernet1/0/1) of MST00 is designated forwarding 
   Port path cost 20000, Port priority 128, Port Identifier 128.1.
   Designated root has priority 32768, address 001b.0c51.7580
   Designated bridge has priority 32768, address 001b.0c51.7580
   Designated port id is 128.1, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 4
   Link type is point-to-point, Internal
   Bpdu filter is enabled internally
   BPDU: sent 12217849, received 905090

 Port 1 (GigabitEthernet1/0/1) of MST01 is designated forwarding 
   Port path cost 20000, Port priority 112, Port Identifier 112.1.
   Designated root has priority 32769, address 001b.0c51.7580
   Designated bridge has priority 32769, address 001b.0c51.7580
   Designated port id is 112.1, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 4
   Link type is point-to-point, Internal
   Bpdu filter is enabled internally
   BPDU: sent 12217849, received 905090

 Port 1 (GigabitEthernet1/0/1) of MST02 is designated forwarding 
   Port path cost 20000, Port priority 144, Port Identifier 144.1.
   Designated root has priority 32770, address 001b.0c51.7580
   Designated bridge has priority 32770, address 001b.0c51.7580
   Designated port id is 144.1, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 3
   Link type is point-to-point, Internal
   Bpdu filter is enabled internally
   BPDU: sent 12217849, received 905090

#show spanning-tree summary
Switch is in mst mode
Root bridge for: MST00-MST02
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is enabled
UplinkFast                   is disabled
BackboneFast                 is disabled
Configured Pathcost method used is short (Operational value is long)

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
MST00                        0         0        0          8          8
MST01                        0         0        0          7          7
MST02                        0         0        0          6          6
---------------------- -------- --------- -------- ---------- ----------
3 msts                       0         0        0         21         21

На другом свиче все аналогично только в конфиге свича добавлена одна строка

interface GigabitEthernet1/0/2
 description ODF-3
 switchport trunk encapsulation dot1q
 switchport mode trunk
 speed nonegotiate
 spanning-tree link-type point-to-point
 spanning-tree mst pre-standard
 spanning-tree mst 1 port-priority 144
 spanning-tree mst 2 port-priority 112

When you connect the prestandard MST switch with the standard MST switch, you need to configure spanning-tree mst pre-standard in the interface of the standard MST switch. 
Catalyst 3550/3560/3750: TheMST implementation in Cisco IOS Release 12.2(25)SEC is based on the IEEE 802.1s standard. The MST implementations in earlier Cisco IOS releases are prestandard. 
То есть если у вас версия => 12.2(25)SEC то эта командочка не нужна.

Все это также можно посмотреть если заюзать команду

#show spanning-tree mst

###### MST00        vlans mapped:   none
Bridge      address 001b.0c51.7580  priority  32768 (32768 sysid 0)
Root        this switch for CST and IST
Configured  hello time 2, forward delay 15, max age 20, max hops 20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi1/0/1          Desg FWD 20000     128.1    P2p
Gi1/0/2          Desg FWD 20000     128.2    P2p
Fa1/0/1          Desg FWD 200000    128.3    P2p Bound(PVST)
Fa1/0/3          Desg FWD 200000    128.5    Shr
Fa1/0/6          Desg FWD 200000    128.8    P2p
Fa1/0/22         Desg FWD 200000    128.24   P2p
Fa1/0/23         Desg FWD 200000    128.25   P2p
Fa1/0/24         Desg FWD 200000    128.26   P2p

###### MST01        vlans mapped:   1-99,200-299,400-499,600-699,800-899
                                     1000-1099,1200-1299,1400-1499,1600-1699
                                     1800-1899,2000-2099,2200-2299,2400-2499
                                     2600-2699,2800-2899,3000-3099,3200-3299
                                     3400-3499,3600-3699,3800-3899,4000-4094
Bridge      address 001b.0c51.7580  priority  32769 (32768 sysid 1)
Root        this switch for MST01

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi1/0/1          Desg FWD 20000     112.1    P2p
Gi1/0/2          Desg FWD 20000     144.2    P2p
Fa1/0/1          Boun FWD 200000    128.3    P2p Bound(PVST)
Fa1/0/3          Desg FWD 200000    128.5    Shr
Fa1/0/6          Desg FWD 200000    128.8    P2p
Fa1/0/23         Desg FWD 200000    128.25   P2p
Fa1/0/24         Desg FWD 200000    128.26   P2p

###### MST02        vlans mapped:   100-199,300-399,500-599,700-799,900-999
                                     1100-1199,1300-1399,1500-1599,1700-1799
                                     1900-1999,2100-2199,2300-2399,2500-2599
                                     2700-2799,2900-2999,3100-3199,3300-3399
                                     3500-3599,3700-3799,3900-3999
Bridge      address 001b.0c51.7580  priority  32770 (32768 sysid 2)
Root        this switch for MST02

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi1/0/1          Desg FWD 20000     144.1    P2p
Gi1/0/2          Desg FWD 20000     112.2    P2p
Fa1/0/1          Boun FWD 200000    128.3    P2p Bound(PVST)
Fa1/0/3          Desg FWD 200000    128.5    Shr
Fa1/0/22         Desg FWD 200000    128.24   P2p
Fa1/0/24         Desg FWD 200000    128.26   P2p