Auf meinem Server habe ich sowohl ein Tomcat7 und ein Apache2 installiert. Ich habe den tomcat7-Dienst gestoppt und möchte mit apache2 auf Port 80 (auch für Test mit 8082 versucht) und Port 443 (und auch mit 442 getestet) hören. Bevor ich tomcat7 aufgehört habe, habe ich es mit 8082 probiert und konnte einen Webseitenaufruf machen und habe die Webseite bekommen. Aber nachdem ich tomcat7 gestoppt habe und mit apache2 auf die Ports 80 und 443 hören wollte, konnte ich keinen Webseitenaufruf aufbauen (auch nicht nochmal wenn ich es nochmal mit 8082 und 442 probierte).Probleme mit dem Öffnen des Ports für Apache2
Ein netstat -tulpe gab den folgenden:
[email protected]<hostname>:/etc/apache2$ netstat -tulpe
(No info could be read for "-p": geteuid()=1000 but you should be root.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 <hostname>.stratoser:8082 *:* LISTEN root <number> -
tcp 0 0 *:ssh *:* LISTEN root <number> -
tcp 0 0 localhost:smtp *:* LISTEN root <number> -
tcp6 0 0 [::]:ssh [::]:* LISTEN root <number> -
tcp6 0 0 localhost:smtp [::]:* LISTEN root <number> -
tcp6 0 0 [::]:https [::]:* LISTEN tomcat7 <number> -
tcp6 0 0 localhost:8005 [::]:* LISTEN tomcat7 <number> -
tcp6 0 0 [::]:http [::]:* LISTEN tomcat7 <number> -
Mein ports.conf:
[email protected]<hostname>:/etc/apache2$ cat 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 8082
<IfModule ssl_module>
Listen 442
</IfModule>
<IfModule mod_gnutls.c>
Listen 442
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
und die 000-default.conf
[email protected]<hostname>:/etc/apache2$ cat sites-available/000-default.conf
<VirtualHost _default_:8082>
# 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 [email protected]
DocumentRoot /var/www/html
# 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
ein Service -status- alle zurückgegeben:
[ + ] apache2
[ - ] tomcat7
Das Fehlerprotokoll zeigt:
[Sun Jun 19 08:08:09.325184 2016] [core:notice] [pid 18254:tid 139964856280960] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 19 08:08:21.312066 2016] [mpm_event:notice] [pid 18254:tid 139964856280960] AH00491: caught SIGTERM, shutting down
[Sun Jun 19 08:09:47.916405 2016] [mpm_event:notice] [pid 18466:tid 140331437791104] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Sun Jun 19 08:09:47.916530 2016] [core:notice] [pid 18466:tid 140331437791104] AH00094: Command line: '/usr/sbin/apache2'
(? Es scheint, dass diese Linien nur Warnungen)
Ich habe versucht, auf dem Terminal des Servers ein wget und bekam das Recht answere beide mit:
[email protected]<hostname>:~$ wget http://<server-ip>:8082
--2016-06-19 08:21:38-- http://<server-ip>:8082/
Connecting to <server-ip>:8082... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11510 (11K) [text/html]
Saving to: ‘index.html’
100%[====================================================================================>] 11.510 --.-K/s in 0s
2016-06-19 08:21:38 (370 MB/s) - ‘index.html’ saved [11510/11510]
und die gleichen mit dem Servernamen. Aber nicht auf einem Webbrowser auf einer anderen Maschine. Warum nicht?
BTW: Ein lsof-i gab zurück. Warum nicht?
Server-Version: Ubuntu, 14.04.4 LTS
Vielen Dank für Ihre Antwort! Ich habe bereits die SSL-Konfigurationsdatei hinzugefügt. Aber es war wirklich die Firewall, die gelöst werden konnte mit: 'sudo iptables -A INPUT -p tcp --dport 8082 -j ACCEPT' –