IP -> Apache2

Locked
User avatar
Fiesi
Posts: 136
Joined: Wed 15. Nov 2017, 12:32

IP -> Apache2

Post by Fiesi »

Moin,

standardmäßig läuft ja der Apache2 auf allen IP's.

Wenn ich nun die .confs durch gehe und ihn sage er soll nur auf einer IP lauschen, werden sie immer wieder überschrieben beim neuen anlegen einer domain?

Wäre viell doch mal ne gute Idee, KeyHelp zu sagen welche IPs er nehmen soll für den Indianer und Co ;)

Hab das Problem das sich nen anderer dienst auf einer anderen IP nun beißt - der auch port 80 und 443 haben will :D (azuracast)

Viell hat ja noch jemand nen tip wie ich das ohne große Aufwände bewerkstelligen kann
Ein Systemadministrator schläft nicht. Er root! :)
User avatar
Jolinar
Community Moderator
Posts: 3602
Joined: Sat 30. Jan 2016, 07:11
Location: Weimar (Thüringen)
Contact:

Re: IP -> Apache2

Post by Jolinar »

Fiesi wrote: Thu 31. Jan 2019, 09:37 Viell hat ja noch jemand nen tip wie ich das ohne große Aufwände bewerkstelligen kann
Du könntest die manuell veränderten Configs durch Setzen des Immutable-Bits vor Veränderungen schützen und damit Update-resistent machen. Allerdings müßtest du bei Updates dann auch prüfen, ob du diese Configs noch manuell anpassen mußt.
Wenn jemand inkompetent ist, dann kann er nicht wissen, daß er inkompetent ist. (David Dunning)

Data Collector für Community Support
___
Ich verwende zwei verschiedene Schriftfarben in meinen Beiträgen /
I use two different font colors in my posts:
  • In dieser Farbe schreibe ich als Moderator und gebe moderative Hinweise oder begründe moderative Eingriffe /
    In this color, I write as a moderator and provide moderative guidance or justify moderative interventions
  • In dieser Farbe schreibe ich als Community Mitglied und teile meine private Meinung und persönlichen Ansichten mit /
    In this color, I write as a community member and share my personal opinions and views
User avatar
Fiesi
Posts: 136
Joined: Wed 15. Nov 2017, 12:32

Re: IP -> Apache2

Post by Fiesi »

Den gedanken hatte ich au schon ;)

Bloß muss ich erstmal gefühlte 100 Vhosts durchwühlen und * durch IP ersetzen xD

Bei meheren IP's auf den der apache lauschen soll, mit , trennen oder einfach nur leerzeile?
stehe gerade aufm schlauch :D

Er soll nur auf 2 IPs lauschen...
Last edited by Fiesi on Thu 31. Jan 2019, 10:05, edited 1 time in total.
Ein Systemadministrator schläft nicht. Er root! :)
User avatar
Jolinar
Community Moderator
Posts: 3602
Joined: Sat 30. Jan 2016, 07:11
Location: Weimar (Thüringen)
Contact:

Re: IP -> Apache2

Post by Jolinar »

Fiesi wrote: Thu 31. Jan 2019, 10:02 Bloß muss ich erstmal gefühlte 100 Vhosts durchwühlen und * durch IP ersetzen xD
Hier wäre sed das Mittel der Wahl. ;)
Wenn jemand inkompetent ist, dann kann er nicht wissen, daß er inkompetent ist. (David Dunning)

Data Collector für Community Support
___
Ich verwende zwei verschiedene Schriftfarben in meinen Beiträgen /
I use two different font colors in my posts:
  • In dieser Farbe schreibe ich als Moderator und gebe moderative Hinweise oder begründe moderative Eingriffe /
    In this color, I write as a moderator and provide moderative guidance or justify moderative interventions
  • In dieser Farbe schreibe ich als Community Mitglied und teile meine private Meinung und persönlichen Ansichten mit /
    In this color, I write as a community member and share my personal opinions and views
User avatar
Fiesi
Posts: 136
Joined: Wed 15. Nov 2017, 12:32

Re: IP -> Apache2

Post by Fiesi »

aber auch blöd - denn wenn nen Kunde ne Sub z..b anlegt, wird ja wieder * eingetragen und Apache2 motzt rum weil ja belegt ist.

ALso ist die lösung auch net die beste.

Wäre nicht schlecht, wenn man Keyhelp wirklich sagen könnte welche IPs er benutzen soll...
Ein Systemadministrator schläft nicht. Er root! :)
User avatar
Jolinar
Community Moderator
Posts: 3602
Joined: Sat 30. Jan 2016, 07:11
Location: Weimar (Thüringen)
Contact:

Re: IP -> Apache2

Post by Jolinar »

Fiesi wrote: Thu 31. Jan 2019, 10:15 aber auch blöd - denn wenn nen Kunde ne Sub z..b anlegt, wird ja wieder * eingetragen und Apache2 motzt rum weil ja belegt ist.

ALso ist die lösung auch net die beste.
Bis ein solches Feature möglicherweise in Keyhelp integriert ist, könntest du dir als Workaround mit einem kleinen Cron-Script helfen, welches z.B. minütlich läuft und die entsprechenden Config-Files umschreibt. So könntest du auch auf das Setzen des Immutable-Bits verzichten.
Wenn jemand inkompetent ist, dann kann er nicht wissen, daß er inkompetent ist. (David Dunning)

Data Collector für Community Support
___
Ich verwende zwei verschiedene Schriftfarben in meinen Beiträgen /
I use two different font colors in my posts:
  • In dieser Farbe schreibe ich als Moderator und gebe moderative Hinweise oder begründe moderative Eingriffe /
    In this color, I write as a moderator and provide moderative guidance or justify moderative interventions
  • In dieser Farbe schreibe ich als Community Mitglied und teile meine private Meinung und persönlichen Ansichten mit /
    In this color, I write as a community member and share my personal opinions and views
User avatar
pitsch
Posts: 7
Joined: Wed 13. Feb 2019, 16:53

Re: IP -> Apache2

Post by pitsch »

habe azuracast per docker container installiert der mit portainer auf port 9000 verwaltet wird.
das funktioniert soweit ganz gut.

nun moechten wir weiterhin keyhelp benutzen, eigentlich nur als fallback fuer die basisinstallation, also ist es kein problem wenn die standardports nicht verfuegbar sind.
habe 443 und 80 ersetzt mit 4443 und 8080
ebenfalls manuell in
/etc/apache2/keyhelp/keyhelp.conf
ein host:8080 aufruf endet aber im timeout.

erste frage:
da kein backup angelegt wurde vom keyhelp.conf, gibt es einen shell befehl sich ein default keyhelp.conf anzulegen, falls mal was verkonfiguriert wurde? reicht ein system neustart?

habe bisher kein immutable bit gesetzt, mit chattr +i

default-enabled already disabled, sicherheitshalber
a2dissite 000-default.conf
a2dissite default-ssl.conf
apache neu gestartet
service apache2 reload
lauscht:
netstat -nal | grep 8080
tcp6 0 0 :::8080 :::* LISTEN

die azuracast installation enthaelt einen nginx der jedoch nicht am 8080 lauscht

die dokumentation warnt zwar davor bietet aber die moeglichkeit an die ports neu zu setzen.
6.3.5 Web server ports

wie jetzt nun was genau umgebogen wurde, dazu fehlt mir gerade der ueberblick. der vhost link zum web verzeichnis scheint zu fehlen, nur wo genau? eine anleitung fuer diesen fall, also nicht reverse proxy sondern apache bloss fuer keyweb ueber extra port war im forum nicht auffindbar.


in /var/log/apache2/error.log befinden sich nur ein paar SSL fehler, weil noch keine (sub)domain gesetzt wurde. das ist jedoch durch ausnahmedialog im browser geloest.

#
# KeyHelp webserver config file for Apache 2.4
#

Listen 8080

<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.
Listen 4430
SSLStrictSNIVHostCheck off
</IfModule>

<IfModule mod_gnutls.c>
Listen 4430
SSLStrictSNIVHostCheck off
</IfModule>

Code: Select all

#
#  _  __          _   _     _      (R)
# | |/ /___ _   _| |_| |___| |___
# | | /  -_) |_/ |  _  | -_) | _ \
# |_|\_\___|\__, |_| |_|___|_|  _/
#           |___/            |_|
#
# webserver configuration for apache 2.4
#

<IfModule mod_logio.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" key$
</IfModule>
<IfModule !mod_logio.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" 0 0" keyhe$
</IfModule>

# keyhelp / tools
<VirtualHost *:4443>
    ServerName host.de
    ServerAdmin root@host.de

    DocumentRoot /home/keyhelp/www/keyhelp
    Options -Indexes
    SuexecUserGroup "keyhelp" "keyhelp"

    # logging
    LogLevel warn
    CustomLog "${APACHE_LOG_DIR}/keyhelp/access.log" combined
    ErrorLog "${APACHE_LOG_DIR}/keyhelp/error.log"

    # ssl
    SSLEngine On
    SSLCertificateFile /etc/ssl/keyhelp/keyhelp.pem
    SSLCertificateChainFile /etc/ssl/keyhelp/keyhelp-ca.crt

    # hsts
    # <IfModule mod_headers.c>
    #     Header set Strict-Transport-Security "max-age=15768000;"
    # </IfModule>

    # alias
    Alias /awstats-icons "/usr/share/awstats/icon"
    Alias /phpmyadmin    "/home/keyhelp/www/phpmyadmin"
    Alias /webmail       "/home/keyhelp/www/webmail"
    Alias /webstats      "/home/keyhelp/www/kh.webstats"

    # autoconfig / autodiscover
    AliasMatch (?i)^/autoconfig(.*)   /home/keyhelp/www/keyhelp/misc/emailconfig$1
    AliasMatch (?i)^/autodiscover(.*) /home/keyhelp/www/keyhelp/misc/emailconfig$1


    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/keyhelp_keyhelp.socket|fcgi://keyhelp_keyhelp.$
    </FilesMatch>

    # Set some proxy properties (the string "unique-domain-name-string" should match
    # the one set in the FilesMatch directive.
    <Proxy fcgi://keyhelp_keyhelp.socket>
        ProxySet connectiontimeout=5 timeout=120
    </Proxy>

    # If the php file doesn't exist, disable the proxy handler.
    # This will allow .htaccess rewrite rules to work and
    # the client will see the default 404 page of Apache
    #RewriteCond %{REQUEST_FILENAME} \.php$
    #RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
    #RewriteRule (.*) - [H=text/html]

    # keyhelp
    <Directory "/home/keyhelp/www/keyhelp">
        # protect license file
        <Files "license.txt">
            Require all denied
        </Files>
        Require all granted
        AllowOverride All
    </Directory>
    <Directory "/home/keyhelp/www/keyhelp/bin/">
        Require all denied

     # statistics
    <Directory "/home/keyhelp/www/kh.webstats">
        Require all denied
        Options FollowSymLinks
        AllowOverride AuthConfig
    </Directory>

    # phpmyadmin
    <Directory "/home/keyhelp/www/phpmyadmin">
        Require all granted
        AllowOverride All
    </Directory>
    <Directory "/home/keyhelp/www/phpmyadmin/libraries">
        Require all denied
    </Directory>
    <Directory "/home/keyhelp/www/phpmyadmin/templates">
        Require all denied
    </Directory>
    <Directory "/home/keyhelp/www/phpmyadmin/setup">
        Require all denied
    </Directory>

    # webmail
    <Directory "/home/keyhelp/www/webmail">
        Require all granted
        AllowOverride All
    </Directory>

</VirtualHost>

# redirect for http -> https
<VirtualHost *:8080>
    ServerName host.de

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])\.(25[0-5]|2[$
        RewriteRule ^(.*)$ https://%{HTTP_HOST}/
    </IfModule>

    Redirect / https://host.de/
</VirtualHost>

# include user vhosts
IncludeOptional keyhelp/vhosts/*.conf

# webmail subdomain
Include keyhelp/webmail.conf

# autoconfig subdomain
Include keyhelp/autoconfig.conf

# include subdomain catch all
IncludeOptional keyhelp/subdomain_catch_all.conf

# default page - if domain not available
<VirtualHost *:4443>
    ServerName host.de
    ServerAlias *.host.de
    SSLEngine On
    SSLCertificateFile /etc/ssl/keyhelp/keyhelp.pem
    SSLCertificateChainFile /etc/ssl/keyhelp/keyhelp-ca.crt
    Redirect / https://host.de/index.php?page=notavailable
</VirtualHost>

# default page - redirect for http -> https
<VirtualHost *:8080>
    ServerName host.de
    ServerAlias *.host.de
    Redirect / https://host.de/index.php?page=notavailable
</VirtualHost>
Locked