Zugriff auf IP

  • Problem ist behoben.


    Was kann ich als dauerhaften Fix unternehmen?

  • Jup, der kam von mir, wurde aber noch nie getestet, da mein Testserver neu aufgesetzt werden muss. Ich hoffe, dass das im Laufe der Woche erledigt ist, dann kann ich meine Änderungen endlich testen und gegebenenfalls korrigieren.
    https://github.com/i-MSCP/imscp/pull/2

  • Wird das dann Global im IMSCP eingefügt oder nur als Hook File?

  • Das ist ein pull request, sprich es fließt (EVT) in den Code ein -> global
    In dem Fall aber erst bei nem größeren Release (1.2, 1.3...)

  • @Ninos


    I'll not merge the PR because this is not the way to go. You're complicating the things for nothing. In next release, I'll add a skeleton for the default page. It will be also possible to choose a site managed by i-MSCP as default site in place of the default page (as provided by i-MSCP).


    For instance, the following file (imscp_default.conf), stored under the /etc/apache2/conf.d directory is largely sufficient:


    /etc/apache2/conf.d/imscp_default.conf file:


    It's just a sample here. No need to rewrite all the engine for such a thing ;) Here, you have not to deal with the file naming convention because the files stored in the /etc/apache2/conf.d directory are always loaded before those which are stored under the /etc/apache2/sites-available directory.


    Note: Here, I'm using a specific document root with a default page but of course, it's possible to change the document root and add other directives. My Apache is listening on all interfaces but only on ports 80 and 443.


    BTW: I've not see any difference in loading order between Apache 2.2.x and Apache 2.4.x

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • That sounds good and as a better solution. But I would load the wildcard vhost for the default page after all config files with following config:


    With your solution I had some problems on some servers with debian squeeze (apache <= 2.2.16) & Ubuntu. I've tested such configurations for my ServerDefaultPage plugin. My solution should be more dynamic, because it's possible to load at the beginning another vhost for example for a redirection to the panel port.

  • @Ninos


    Wildcard vhost? I'll never add such thing sometime, you're really crazy... You should really consider to read the Apache doc...

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Your config looks also like a wildcard for all the other requests without available vhosts?

  • Re;


    The config sample which I've provided, provide a catchall for any based IP request on port 80/443. Adding the ServerAlias statement is totally useless here. For the transparent redirection on the panel or any site I want, I use something really different. I explain:


    1. In the vhost file of the domain on which I want the request to be redirected I add the system short hostname


    Shell-Script
    1. root@lucid:~# hostname -slucid


    2. Modified vhost (here a specific domain)

    Code
    1. <VirtualHost 192.168.5.111:80> ServerAdmin [email protected] ServerName domain.tld ServerAlias www.domain.tld vu2003.lucid.nuxwin.com lucid DocumentRoot /var/www/virtual/domain.tld/htdocs LogLevel error ErrorLog /var/log/apache2/domain.tld/error.log Alias /errors /var/www/virtual/domain.tld/errors/ # SECTION suexec BEGIN. SuexecUserGroup vu2003 vu2003 # SECTION suexec END. # SECTION php_enabled BEGIN. # SECTION php_enabled END. <Directory /var/www/virtual/domain.tld/htdocs> Options +FollowSymlinks # SECTION php_enabled BEGIN. AllowOverride All # SECTION fcgid BEGIN. Options +ExecCGI FCGIWrapper /var/www/fcgi/domain.tld/php5-fcgid-starter # SECTION fcgid END. # SECTION php_enabled END. Allow from all </Directory> # SECTION cgi_support BEGIN. ScriptAlias /cgi-bin/ /var/www/virtual/domain.tld/cgi-bin/ <Directory /var/www/virtual/domain.tld/cgi-bin> AllowOverride AuthConfig Indexes Limit Options=Indexes Allow from all </Directory> # SECTION cgi_support END. # SECTION addons BEGIN. # SECTION addons END. Include /etc/apache2/imscp/domain.tld.conf</VirtualHost>


    Note: Look the value of ServerAlias


    3. In my /etc/apache2/conf.d/imscp_default.conf file, I add the following vhost

    Code
    1. # Vhost which match for any request made on the
    2. # 192.168.5.111:80 IP/PORT
    3. # If other IP are added, you added them following the
    4. # 192.168.5.111:80 statement, each space separated
    5. <VirtualHost 192.168.5.111:80>
    6. ProxyPass / http://lucid/
    7. ProxyPassReverse / http://lucid/
    8. </VirtualHost>


    Note: I use the lucid hostname because no DNS record is involved. This record is already in the /etc/hosts file.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206