apache2 rewrite

10 bejegyzés megtekintése - 1-10 / 15
  • Szerző
    Bejegyzés
  • #2129595
    masterminds
    Felhasználó

      Ehhez inkább ezt olvasgasd.

      # VirtualHost: If you want to maintain multiple domains/hostnames on your
      # machine you can setup VirtualHost containers for them. Most configurations
      # use only name-based virtual hosts so the server doesn’t need to worry about
      # IP addresses. This is indicated by the asterisks in the directives below.
      #
      # Please see the documentation at
      #
      # for further details before you try to setup virtual hosts.

      #2129596
      masterminds
      Felhasználó

        Ehhez inkább ezt olvasgasd.

        # VirtualHost: If you want to maintain multiple domains/hostnames on your
        # machine you can setup VirtualHost containers for them. Most configurations
        # use only name-based virtual hosts so the server doesn’t need to worry about
        # IP addresses. This is indicated by the asterisks in the directives below.
        #
        # Please see the documentation at
        #
        # for further details before you try to setup virtual hosts.

        #2129597
        cs4b33
        Felhasználó

          Okés köszi megpróbálom. .de ha vki tudna konrét conf pl -t beírni nekem ide annak nagyon oulnek..

          #2129598
          cs4b33
          Felhasználó

            Okés köszi megpróbálom. .de ha vki tudna konrét conf pl -t beírni nekem ide annak nagyon oulnek..

            #2129599
            masterminds
            Felhasználó

              Tessék, itt egy konkrét példa az én megoldásomhoz.

              Code:
              NameVirtualHost xy.sytes.net:80

                  ServerName XY
                  DocumentRoot „/var/www/html/xy”
                  ErrorLog „/var/log/apache2/xy_error_log”
                  TransferLog „/var/log/apache2/xy_acces_log”
               
                AllowOverride none
                AllowOverride AuthConfig
                Options Indexes FollowSymLinks
               

              NameVirtualHost xyz.sytes.net:80

                  ServerName xyz
                  DocumentRoot „/var/www/html/xyz”
                  ErrorLog „/var/log/apache2/xyz_error_log”
                  TransferLog „/var/log/apache2/xyz_acces_log”
               
                AllowOverride none
                Options Indexes FollowSymLinks
               

              #2129600
              masterminds
              Felhasználó

                Tessék, itt egy konkrét példa az én megoldásomhoz.

                Code:
                NameVirtualHost xy.sytes.net:80

                    ServerName XY
                    DocumentRoot „/var/www/html/xy”
                    ErrorLog „/var/log/apache2/xy_error_log”
                    TransferLog „/var/log/apache2/xy_acces_log”
                 
                  AllowOverride none
                  AllowOverride AuthConfig
                  Options Indexes FollowSymLinks
                 

                NameVirtualHost xyz.sytes.net:80

                    ServerName xyz
                    DocumentRoot „/var/www/html/xyz”
                    ErrorLog „/var/log/apache2/xyz_error_log”
                    TransferLog „/var/log/apache2/xyz_acces_log”
                 
                  AllowOverride none
                  Options Indexes FollowSymLinks
                 

                #2129601
                cs4b33
                Felhasználó

                  hm koszi, nekem így seikerult és miden domain autómatikusan vhosotlva van, és miden aldomain is. : ) és ezenkívul csak a egy script kell hogy az /usr/local/bin/ -be hogy parancsal hozzáadam a domaint és aldoamint 🙂 ha kell vkinek beírom.

                  Code:
                  NameVirtualHost *

                    ServerName domain.at
                    ServerAlias domain.at
                    DocumentRoot /var/www/domain.at/

                    ErrorLog /var/log/apache2/error-domain.log
                    LogLevel warn
                    CustomLog /var/log/apache2/access-domain.log combined
                    ServerSignature Off

                   
                  Options FollowSymLinks
                  AllowOverride None
                   
                   
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride AuthConfig Options FileInfo Limit
                  Order allow,deny
                  allow from all
                   

                    Auth_MySQL_Info localhost   // akinek nem kell kometezze ki kb.. : )

                    ReWriteEngine ON  / lényeg! : )

                    RewriteMap    lowercase    int:tolower
                    # if subdomain already given
                    RewriteCond %{HTTP_HOST} ^([^.]+).([^.]+).([^azAZ]+)$
                    RewriteRule ^(.*)$ /var/www/%2.%3/%1$1 [E=VHOST:${lowercase:%2.%3}]

                    # ha nem ad meg a-t akkor bezony rewrite a www-re
                    RewriteCond %{HTTP_HOST} ^([^.]+).([^.]+)$

                  #2129602
                  cs4b33
                  Felhasználó

                    hm koszi, nekem így seikerult és miden domain autómatikusan vhosotlva van, és miden aldomain is. : ) és ezenkívul csak a egy script kell hogy az /usr/local/bin/ -be hogy parancsal hozzáadam a domaint és aldoamint 🙂 ha kell vkinek beírom.

                    Code:
                    NameVirtualHost *

                      ServerName domain.at
                      ServerAlias domain.at
                      DocumentRoot /var/www/domain.at/

                      ErrorLog /var/log/apache2/error-domain.log
                      LogLevel warn
                      CustomLog /var/log/apache2/access-domain.log combined
                      ServerSignature Off

                     
                    Options FollowSymLinks
                    AllowOverride None
                     
                     
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride AuthConfig Options FileInfo Limit
                    Order allow,deny
                    allow from all
                     

                      Auth_MySQL_Info localhost   // akinek nem kell kometezze ki kb.. : )

                      ReWriteEngine ON  / lényeg! : )

                      RewriteMap    lowercase    int:tolower
                      # if subdomain already given
                      RewriteCond %{HTTP_HOST} ^([^.]+).([^.]+).([^azAZ]+)$
                      RewriteRule ^(.*)$ /var/www/%2.%3/%1$1 [E=VHOST:${lowercase:%2.%3}]

                      # ha nem ad meg a-t akkor bezony rewrite a www-re
                      RewriteCond %{HTTP_HOST} ^([^.]+).([^.]+)$

                    #2129603
                    wikka89
                    Felhasználó

                      köszönöm még1x a segítséget, 1 nyitott kérdés azonban előttem áll, ha a user www-t üt be akkor is ugye a www mappát keresné, de én azt kivételnek szeretném, van erre esetleg parancs, hogy az haggya figyelmen kívül?

                      Előre is köszi

                      #2129604
                      wikka89
                      Felhasználó

                        köszönöm még1x a segítséget, 1 nyitott kérdés azonban előttem áll, ha a user www-t üt be akkor is ugye a www mappát keresné, de én azt kivételnek szeretném, van erre esetleg parancs, hogy az haggya figyelmen kívül?

                        Előre is köszi

                      10 bejegyzés megtekintése - 1-10 / 15
                      • Be kell jelentkezni a hozzászóláshoz.