Can you advice for Redirect and web home name?

Discussion in 'Installation/Configuration' started by datayoung, Aug 12, 2006.

  1. datayoung

    datayoung New Member

    I had search about rediect in this forum but still not found what I want

    1. I want to set global redirect like you did on xxx.xxx/stats so any other domains/customers/reseller can use the same way not individual co-domain

    here example
    http://www.xxx.xxx/ispanel
    then it will redirect to https://www.xxx.xxx:81

    Why not use http://ispanel.xxx.xxx ? the answer is same as webalizer did for global stats,
    but I don't know how webalizer done?

    2.I using ispconfig with HTTPS and I saw system show Bad Request and link to https://xxx.xxx.xxx:81 after try on http://xxx.xxx.xxx:81
    How to do that ?it great:eek: ,in case can't fix no.1 we can use this method and set it redirect to location as it advice in Link on page

    3.can I make a public_html link from web ,so user will have web and public_html in their home -plase set it default for all domain -where Can I put this skel into it?
     
    Last edited: Aug 12, 2006
  2. jockstrap

    jockstrap New Member

    datayoung,

    I added login.domain and webmail.domain to the dns skeleton which gives me

    http://login.domain and http://webmail.domain and then I put the following in the vhosts apache2 skeleton and works a treat!

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/webmail/$1 [R]
    RewriteCond %{HTTP_HOST} ^login\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/$1 [R]


    I use the roundcubemail client so I needed to creat the /webmail link with the following;

    ln -s /home/admispconfig/ispconfig/web/roundcubemail /home/admispconfig/ispconfig/web/webmail
     
  3. jockstrap

    jockstrap New Member

    datayoung,

    I added login.domain and webmail.domain to the dns skeleton which gives me

    http://login.domain and http://webmail.domain and then I put the following in the vhosts apache2 skeleton and works a treat!

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/webmail/$1 [R]
    RewriteCond %{HTTP_HOST} ^login\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/$1 [R]


    I use the roundcubemail client so I needed to creat the /webmail link with the following;

    ln -s /home/admispconfig/ispconfig/web/roundcubemail /home/admispconfig/ispconfig/web/webmail

    =================================
    Here is my pri.domain.master skeleton


    $TTL {DNS_TTL}
    @ IN SOA {DNS_NS1}. {DNS_ADMINMAIL}. (
    {SERIAL} ; serial, todays date + todays serial #
    {DNS_REFRESH} ; refresh, seconds
    {DNS_RETRY} ; retry, seconds
    {DNS_EXPIRE} ; expire, seconds
    {DNS_TTL} ) ; minimum, seconds
    ;
    IN NS {DNS_NS1}. ; Inet Address of name server 1
    IN NS {DNS_NS2}. ; Inet Address of name server 2
    ;

    <!-- BEGIN DYNAMIC BLOCK: mxrecords -->
    IN MX {MX_PRIORITAET} {MX_MAILSERVER}.
    <!-- END DYNAMIC BLOCK: mxrecords -->
    {DNS_SOA}. IN A {DNS_SOA_IP}
    <!-- BEGIN DYNAMIC BLOCK: arecords -->
    {A_HOST} IN A {A_IP}
    <!-- END DYNAMIC BLOCK: arecords -->
    <!-- BEGIN DYNAMIC BLOCK: cnamerecords -->
    {CNAME_HOST} IN CNAME {CNAME_ZIEL}.
    <!-- END DYNAMIC BLOCK: cnamerecords -->
    <!-- BEGIN DYNAMIC BLOCK: spfrecords -->
    {SPF_HOST}. TXT "v=spf1 {SPF}"
    <!-- END DYNAMIC BLOCK: spfrecords -->

    webmail IN A {A_IP}
    * IN A {A_IP}

    ;;;; MAKE MANUAL ENTRIES BELOW THIS LINE! ;;;;




    ============================================
    Here is my vhost.conf.master


    {FP_RESOURCE_CONFIG}
    {FP_ACCESS_CONFIG}
    ###################################
    #
    # ISPConfig vHost Configuration File
    # Version 1.0
    #
    ###################################
    #
    <!-- BEGIN DYNAMIC BLOCK: namevhost -->
    {SERVERIP}
    <!-- END DYNAMIC BLOCK: namevhost -->
    #
    #
    <!-- BEGIN DYNAMIC BLOCK: vhost -->

    ######################################
    # Vhost: {SERVERNAME}
    ######################################
    #
    #
    <VirtualHost {IP}>
    {HTTPD_INCLUDE}
    {SUEXEC}
    ServerName {SERVERNAME}
    ServerAdmin {SERVERADMIN}
    DocumentRoot {DOCUMENTROOT}
    {SERVERALIAS}
    {DIRECTORYINDEX}
    {CGI}
    ErrorLog {WEB_ERROR_LOG}
    {PHP}
    {SSI}
    {WAP}
    {ERRORALIAS}
    {ERROR}

    <IfModule mod_cband.c>
    # Max 35KB/s speed for this virtualhost
    # Max 10 requests per second for this virtualhost
    # Max 30 open connections for this virtualhost
    CBandSpeed 35kb/s 10 30

    # Max 25kB/s speed, 2 requests/s and 2 open connections for any remote client
    CBandRemoteSpeed 25kb/s 2 2

    # redirect to http://site/bandwidth_exceeded.html
    # when the limit has been reached
    CBandExceededURL http://isp1.domain.com/bandwidth_exceeded.html

    # 1GB virtualhost montly bandwidth limit
    CBandLimit 1G

    # a period of time after which the scoreboard will be cleared (4 weeks)
    # (only in >=0.9.5-rc2)
    CBandPeriod 30D

    # Speed if Bandwidth limit exceeded
    #CBandExceededSpeed 5kb/s 2 5

    # virtualhost's scoreboard file
    CBandScoreboard /var/www/scoreboard/{SERVERNAME}.scoreboard
    </IfModule>

    AliasMatch ^/~([^/]+)(/(.*))? {HTTPD_ROOT}/{WEB}/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? {HTTPD_ROOT}/{WEB}/user/$1/web/$3

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/webmail/$1 [R]

    RewriteCond %{HTTP_HOST} ^login\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/$1 [R]

    {REWRITE_RULE}
    {FRONTPAGE}
    </VirtualHost>
    #
    {SSL}
    #
    #
    <!-- END DYNAMIC BLOCK: vhost -->


    =============================================
    Hope it works for you! Enjoy!
     
  4. datayoung

    datayoung New Member

    May I ask Silly question,Where are they?

    --I added login.domain and webmail.domain to the dns skeleton which gives me

    What and where are they "dns skeleton"

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/webmail/$1 [R]
    RewriteCond %{HTTP_HOST} ^login\. [NC]
    RewriteRule ^/(.*) http://%{HTTP_HOST}:81/$1 [R]

    Its sound like http://webmail.domain > http://domain:81/webmail
    Not what I want
    type http://domain/webmail
    goto https://domain:81/webmail

    or May be I missed somes
     
  5. jockstrap

    jockstrap New Member

    Yes Sorry - is for webmail.domain --> domain:81/webmail

    However, the same rewrite methodoloy can be used for

    domain/webmail --> https://domain:81/webmail

    I think.. Just search on google for mod_rewrite untill you find the example that does what you want...
    That's what I did - sorry i'm not an expert on mod_rewrite so can't provide you with the rule.

    All the skeletons (templates) are in /root/ispconfig/isp/conf
     
    Last edited: Aug 12, 2006
  6. datayoung

    datayoung New Member

    Thanks,I try on learn things in apache

    Yes,seem to be here many people try to ask about what I asked
    ** Redirect with cpanel style(If they used to use cpanel which have to pay high price and so popular) **
    but the answer like you answered to me or co-domain stuffs which is not what they want
    why? they or me ask because if can fixed

    then we can migrate from cpanel without change existing users/customer feel much
    Like:
    they still can http://xxx.xxx/cpanel then redirect to ispconfig control panel
    they still can http://xxx.xxx/webmail then redirect to ispconfig webmain

    I think it thats all we want for the first stage of migration
    then inside have "web" ispconfig called it for home directory name (but cpanel using public_html)
    I have fixed it by

    add function @symlink in /root/ispconfig/scripts/lib/config.lib.php
    @symlink("$web_path/web","$web_path/pub_html");

    See? inside after ftp you will *feel like* using cpanel except only outside that only redirect problem still stand oherwise they all can micgrate from cpanel without notice by users

    We know cpanel is not the answer that why we move to ispconfig same as Linux guys moved from Windows,then Linux have to made samba to welcome windows 's users so people feeling same or even better than using Windows machine thaat is big step for Windows>Linux

    if we can fixed this little things I am so sure more than half existing cpanel 's users will move to ispconfig then ispconfig can have more customers in the futures
     
    Last edited: Aug 13, 2006
  7. falko

    falko Super Moderator Howtoforge Staff

Share This Page