Potrzebuje skonfigurowanego Apache'a tak aby udostępniona była jedna prosta strona. Oprócz Apache na tym samym serwerze będzie działał Dnsmasq zapewniając DHCP oraz przekierowania zapytań DNS'owych. Serwer posiada dwa interfejsy sieciowe dlatego musiałem stworzyć dodatkowy interfejs wirtualny (interfejs dla sieci lokalnej został zajęty przez Dnsmasq). Oto moja konfiguracja sieciowa:
Kod: Zaznacz cały
ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:d0:71:c8
inet addr:172.16.151.247 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::a00:27ff:fed0:71c8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29307 errors:0 dropped:49 overruns:0 frame:0
TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2337110 (2.2 MiB) TX bytes:21434 (20.9 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:fb:61:65
inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::a00:27ff:fefb:6165/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:798 (798.0 B)
eth1:0 Link encap:Ethernet HWaddr 08:00:27:fb:61:65
inet addr:10.0.0.2 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
http://pastebin.com/NsGiVTY0
Następnie konfiguracja wirtualnego hosta /etc/apache2/sites-available:
Kod: Zaznacz cały
1 <VirtualHost 10.0.0.2:80>
2 # The ServerName directive sets the request scheme, hostname and port that
3 # the server uses to identify itself. This is used when creating
4 # redirection URLs. In the context of virtual hosts, the ServerName
5 # specifies what hostname must appear in the request's Host: header to
6 # match this virtual host. For the default virtual host (this file) this
7 # value is not decisive as it is used as a last resort host regardless.
8 # However, you must set it for any further virtual host explicitly.
9
10 ServerName www.access_denied.com.pl
11
12 ServerAdmin krzyszpien.mateusz@epk.com.pl
13 DocumentRoot "/var/www/vhosts/access_denied"
14
15 <Directory /var/www/vhosts/access_denied>
16 Options Indexes FollowSymLinks
17 AllowOverride None
18 Require all granted
19 </Directory>
20
21 # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
22 # error, crit, alert, emerg.
23 # It is also possible to configure the loglevel for particular
24 # modules, e.g.
25 LogLevel info
26
27 ErrorLog "${APACHE_LOG_DIR}/error.log"
28 CustomLog "${APACHE_LOG_DIR}/access.log" combined
29
30 # For most configuration files from conf-available/, which are
31 # enabled or disabled at a global level, it is possible to
32 # include a line for only one particular virtual host. For example the
33 # following line enables the CGI configuration for this host only
34 # after it has been globally disabled with "a2disconf".
35 #Include conf-available/serve-cgi-bin.conf
36 </VirtualHost>
37
38 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Kod: Zaznacz cały
1 127.0.0.1 localhost
2 127.0.1.1 serv-dhcp-dns
3 10.0.0.2 www.facebook.com
4 10.0.0.2 https://pl-pl.facebook.com/
5 10.0.0.2 allegro.pl
6 10.0.0.2 www.allegro.pl
7 10.0.0.2 facebook.pl
8 10.0.0.2 facebook.com
9 10.0.0.2 www.access_denied.com.pl
10
11 # The following lines are desirable for IPv6 capable hosts
12 ::1 localhost ip6-localhost ip6-loopback
13 ff02::1 ip6-allnodes
14 ff02::2 ip6-allrouters
