Changing Squirrelmail from :8081 to :80 / using letsencrypt with squirrelmail? nginx..

Discussion in 'Installation/Configuration' started by wshakes, Mar 13, 2017.

  1. wshakes

    wshakes Member

    Debian 8 Nginx Perfect server.
    I have:
    https://example.com working SSL with letsencrypt.
    https://server1.example.com:8081/squirrelmail SSL with self-signed...
    https://server1.example.com:8081/phpmyadmin SSL with self-signed...
    I want:
    Step 1.
    squirrelmail to load on https:// using letsencrypt. Like this:
    https://server1.example.com/squirrelmail (with letsencrypt)

    Step 2.
    https://clientwesbite1.com/squirrelmail (using letsencrypt)
    https://clientwebsite2.com/squirrelmail (using letsencrypt)
    All pulling the same original squirrelmail (https://server1.example.com/squirrelmail) (using letsencrypt)
    (not multiple installations)
    Same thing with Phpmyadmin, right? Or is that a whole different can of worms?
    How do I get to where I want to go?

    Fallback plan:

    If this is all too much trouble, please tell me how to get to "Step 1" at least.
    Thank you so much for your time.
    !
     
    Last edited: Mar 13, 2017
  2. wshakes

    wshakes Member

    Anybody know how to do this?
     
  3. wshakes

    wshakes Member

  4. wshakes

    wshakes Member

    I have accomplished "step one" by copying what the guy did in the other thread, changing the directives for nginx in the "options" section of the ispconfig website. I used his phpmyadmin and roundcube directives, as below in code:
    Code:
      location /phpmyadmin {
      root /usr/share/;
      index index.php index.html index.htm;
      location ~ ^/phpmyadmin/(.+\.php)$ {
      try_files $uri =404;
      root /usr/share/;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_param HTTPS $https; # <-- add this line
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $request_filename;
      include /etc/nginx/fastcgi_params;
      fastcgi_param PATH_INFO $fastcgi_script_name;
      fastcgi_buffer_size 128k;
      fastcgi_buffers 256 4k;
      fastcgi_busy_buffers_size 256k;
      fastcgi_temp_file_write_size 256k;
      fastcgi_intercept_errors on;
      }
      location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
      root /usr/share/;
      }
      }
      location /phpMyAdmin {
      rewrite ^/* /phpmyadmin last;
      }
      location /squirrelmail {
      root /usr/share/;
      index index.php index.html index.htm;
      location ~ (.+\.php)$ {
      try_files $uri =404;
      include /etc/nginx/fastcgi_params;
      # To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
      #fastcgi_pass 127.0.0.1:9000;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_index index.php;
      fastcgi_intercept_errors on;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_buffer_size 128k;
      fastcgi_buffers 256 4k;
      fastcgi_busy_buffers_size 256k;
      fastcgi_temp_file_write_size 256k;
      }
      location ~* /.svn/ {
      deny all;
      }
      location ~* /README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ {
      deny all;
      }
    }
    location /webmail {
      rewrite ^ /squirrelmail last;
    }
    only changed roundcube to squirrelmail, crossed my fingers, and it worked!

    Now to find a solution for step 2...
     
    ahrasis and till like this.
  5. ahrasis

    ahrasis Active Member

    Based on the how to you have to add them in to your each and every websites vhost files.

    You can also automate them to each and every website by copying the default vhost sample in /conf to /conf-custom and modify it thereafter accordingly. Run resync to affect all already created vhosts.
     
    wshakes likes this.

Share This Page