Virtual host problem apache2
: 06 maja 2015, 12:10
Kod: Zaznacz cały
Dla czego mi to nie dziła ;( zawsze otwiera się domena.pl a nie domena.com
Plik: /etc/network/interfaces
##############################
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 92.222.16.206
netmask 255.255.255.0
gateway 92.222.16.254
iface eth0 inet6 static
address 2001:41D0:0052:0BFF:0000:0000:0000:06a8
netmask 64
post-up /sbin/ip -f inet6 route add 2001:41D0:0052:0BFF:FFFF:FFFF:FFFF:FF7F dev eth0
post-up /sbin/ip -f inet6 route add default via 2001:41D0:0052:0BFF:FFFF:FFFF:FFFF:FF7F
pre-down /sbin/ip -f inet6 route del default via 2001:41D0:0052:0BFF:FFFF:FFFF:FFFF:FF7F
pre-down /sbin/ip -f inet6 route del 2001:41D0:0052:0BFF:FFFF:FFFF:FFFF:FF7F dev eth0
#auto eth0:0
#iface eth0:0 inet static
#address 37.187.201.35
#netmask 255.255.255.0
#broadcast 37.187.201.255
post-up /sbin/ifconfig eth0:0 37.187.201.35 netmask 255.255.255.255 broadcast 37.187.201.255
post-down /sbin/ifconfig eth0:0 down
#post-up /sbin/ifconfig eth0:1 IP.FAIL.OVER1 netmask 255.255.255.255 broadcast IP.FAIL.OVER1
#post-down /sbin/ifconfig eth0:1 down
Plik: /etc/hosts
###################################
127.0.0.1 localhost
92.222.16.206 vps138861.ovh.net
# Virtual Hosts
37.187.201.35 domena.pl
92.222.16.206 domena.com
Plik: /etc/apache2/apache2.conf
####################################
dodałem: ServerName *
Plik: /etc/apache2/ports.conf
##################################
#NameVirtualHost *:80
Listen *:80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
###NameVirtualHost 92.222.16.206:443
Listen *:443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
Plik: /etc/apache2/sites-available/virtalhost.conf
###################################
##domena 1
<VirtualHost 37.187.201.35:80>
ServerName domena.pl
ServerAlias [url=http://www.domena.pl]www.domena.pl[/URL]
DocumentRoot /var/www/prestashop/
<Directory "/var/www/prestashop/">
Order deny,allow
Deny from All
Allow from 37.187.201.35
</Directory>
</VirtualHost>
###################################
########domena 2
<VirtualHost 92.222.16.206:80>
ServerName domena.com
# ServerAlias [url=http://www.domena.com]www.domena.com[/URL]