https From Port 81 to 443

Discussion in 'Installation/Configuration' started by andcar, Jan 11, 2007.

  1. andcar

    andcar New Member

    Hi all,
    thanks for this beutifull site..With your howto I've successfully installed a dns and email/webmail server. Everything is working, but I'm behind a firewall that blocks the port 81 and the administrators don't want to open it from the outside. So I've a fully working webmail inside the net through:
    https://mydomain.com:81/webmail
    but from the outside I should use the open port 443 and type
    https://mydomain.com/webmail
    But If i do this I receive an error
    mydomain.com has sent an incorrect or unexpected message. Error code: -12263.
    My target is to redirect this page request from the outside(https://mydomain.com/webmail) locally to https://mydomain.com:81/webmail.
    Is it possible? Please help me and guide me step-by-step...as you know a webmail not usable from outside the domain is useless. Thanks
    Andrea
     
  2. andcar

    andcar New Member

    Better explanation: Please HELP ME

    I have the webmail page reached internally. I would like to have the external requests to the port 443 forwarded to the port 81 (already working inside the domain)
    Please help me
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Pleaso configure your router to forward the external port 443 to the internal port 81 on your server.
     
  4. andcar

    andcar New Member

    Hi,
    unfortunately I'm not behind a router. We have a LAN with public IP's filtered by an internal server that allows only some ports usage from the outside. The ports open for my IP are 80 and 443. So noone from the outside can use the webmail cause it is using the port 81 for the https.
    Could you please tell if and how I can redirect/proxy/rewrite the requests to https://mydomain.com/webmail (internally, on the server) to https://mydomain.com:81/webmail
    Perhaps I should add a Vhost somewhere?
    Thanks
    Andrea
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    There are at least 3 possible solutions:

    1) If you dont need port 443 for other websites, you can change the ISPConfig httpd to listen on port 443 instead of port 81 by changing the port number in /root/ispconfig/httpd/conf/httpd.conf to 443. make sure that your main apache is not listening on this port too.

    2) Use mod_proxy. There is a short description in this thread: http://www.howtoforge.com/forums/showthread.php?t=9630

    3) Create a new website with SSL enabled in ISPConfig and install the webmail package of your choice inside of this website. You dont have to use the webmail that comes with ISPConfig.
     
  6. andcar

    andcar New Member

    Thanks a lot.
    I would like to use the second option. But I'm a bit confused about howto do it.
    The explanation says add this to the vhost. Should I add those lines on the ISPconfig interface under Apache directives, or directly on which file?
    I think that this is a relly discussed thread, the topic here is very similar to the one that you pointed me out...I think that an howto on this could be great!
    Cheers
    Andrea
     
  7. andcar

    andcar New Member

    On the right way?

    Hi,
    I've successfully created an SSL certificate through the ISPconfig interface (great!) and now I can reach the home page through the standard port 443.
    So:
    https://webmydomain.com/ reached
    https://webmydomain.com/webmail or https://webmydomain.com/mailuser not reached
    I have the 404 error. File not found.
    What can i do now?

    Here is my Vhost_ISPconfig file:

    ######################################
    # Vhost: iris.chimfarm.unipg.it:80
    ######################################
    #
    #
    <VirtualHost 141.250.13.4:80>
    ServerName iris.chimfarm.unipg.it:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web10/web
    ServerAlias iris.chimfarm.unipg.it chimfarm.unipg.it
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ErrorLog /var/www/web10/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /var/www/web10/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /var/www/web10/phptmp/
    php_admin_value session.save_path /var/www/web10/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/var/www/web10/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web10/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web10/user/$1/web/$3
    </VirtualHost>
    #
    <IfModule mod_ssl.c>
    <VirtualHost 141.250.13.4:443>
    ServerName iris.chimfarm.unipg.it:443
    ServerAdmin [email protected]
    DocumentRoot /var/www/web10/web
    ServerAlias iris.chimfarm.unipg.it chimfarm.unipg.it
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ErrorLog /var/www/web10/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /var/www/web10/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /var/www/web10/phptmp/
    php_admin_value session.save_path /var/www/web10/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    SSLEngine on
    SSLCertificateFile /var/www/web10/ssl/iris.chimfarm.unipg.it.crt
    SSLCertificateKeyFile /var/www/web10/ssl/iris.chimfarm.unipg.it.key
    Alias /error/ "/var/www/web10/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web10/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web10/user/$1/web/$3
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    </VirtualHost>
    </IfModule>
     
  8. falko

    falko Super Moderator Howtoforge Staff

  9. andcar

    andcar New Member

    Migrated all to port 443

    Hi All,
    I ve successfully migrated all to port 443 as previously suggested.
    The only thing to adjust was:
    -reconfiguration of postfix
    -fixed the alias.db with the newaliases command.
    No everything is working well.
    PS: I had already tried the Falko's suggestions without any luck.
    Thanks to all
     

Share This Page