Powracam z tematem po dziesiątkach prób różnych konfiguracji.
Nie mogę za nic uzyskać dostępu do nowej strony przez wpisanie samego adresu domenowego, muszę wpisać adres IP i port
IP:8080, działa również po adresie domenowym i porcie
strona2.moja.domena.pl:8080Nie wiem gdzie szukać przyczyny, może na routerze jest coś źle przekierowane, chociaż próbowałem różnych konfiguracji. Pozwolę sobie przedstawić jak to wygląda teraz, może ktoś znajdzie chwilę na wytknięcie błędów.
Chciałem zrobić to samemu, żeby była satysfakcja, ale widać czegoś tu nie kumam niestety.
Plik
/apache2/sites-enabled/000-default.conf:
<VirtualHost *:8080>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin ja@moja.domena.pl
ServerName strona2.moja.domena.pl
DocumentRoot /var/www/strona/web
<Directory />
Options FollowSymLinks
AllowOverride none
</Directory>
<Directory /var/www/portal/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Kiedy gwiazdkę * w zapisie <VirtualHost *:8080> zastąpiłem adresem nowej stronki/adresem IP, to w przeglądarce strona w ogóle się nie ładuje, nie działa też lokalnie.
Dodanie
"Listen 8080" na początku pliku również tego nie zmienia.
Konfiguracja pliku
ports.conf# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 8080
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Na routerze mam tak przekierowane połączenie:
/sbin/iptables -t nat -A PREROUTING -p tcp -d mojeIP --dport 8080 -j DNAT --to 10.100.200.203:8080
10.100.200.203 to adres lokalny maszyny wirtualnej, na której stoi nowa wersja stronki.
Będę wdzięczny za obejrzenie konfiguracji i ewentualne porady.
Pozdrawiam!