Apache2-Vhost-port-Subdomain

Discussion in 'Server Operation' started by DIake, Feb 23, 2015.

  1. DIake

    DIake New Member

    Hello, i'm French. Sorry for my bad English.
    I'm starting in linux and Apache.

    I try to explain you my problem.
    1 - I have a domain with sub-domain
    When i go to http://domain.fr & http://www.domain.fr everything is ok.
    2 - I have http://srv.subdomain.fr, http://panel.domain.fr and others sub domains

    3 - I have ISP Config on port 5554 and Webmin on other port

    The problem is : i can go to isp-config and webmin from ALL ADDRESSES OF MY SERVER

    https://domain.fr:5554 - https://www.domain.fr:5554 - https://srv.domain.fr:5554 - https://panel.domain.fr:5554

    i like to know how can i allow access only from on addresses https://panel.domain.fr:5554.

    I try lot of thing but i never resolve this. I don't know how search my problem on goggle.

    My config file :

    /etc/apache2/ports.conf
    Code:
    #NameVirtualHost *:80
    Listen 80
    
    <IfModule mod_ssl.c>
        # If you add NameVirtualHost *:443 here, you will also have to change
        # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
        # to <VirtualHost *:443>
        # Server Name Indication for SSL named virtual hosts is currently not
        # supported by MSIE on Windows XP.
    Listen 443
    Listen 5554
    
    </IfModule>
    
    <IfModule mod_gnutls.c>
    Listen 443
    </IfModule>
    
    # NameVirtualHost *:443
    /etc/apache2/sites-enabled/Port5554

    Code:
    # Apache doit écouter sur le port 5554
    
    <VirtualHost *:5554>
        DocumentRoot /var/www/
        ServerName domain.fr
        ServerAlias *.domain.fr
        # Autres directives ici
    </VirtualHost>
    
    #NameVirtualHost panel.domain.fr:5554
    
    <VirtualHost panel.domain.fr:5554>
    ServerAdmin webmaster@localhost
    ServerName panel.domain.fr
    
      <FilesMatch "\.ph(p3?|tml)$">
        SetHandler None
      </FilesMatch>
    
      <IfModule mod_fcgid.c>
    DocumentRoot /var/www/ispconfig/
        SuexecUserGroup ispconfig ispconfig
        <Directory /var/www/ispconfig/>
          Options -Indexes +FollowSymLinks +MultiViews +ExecCGI
          AllowOverride AuthConfig Indexes Limit Options FileInfo
          <FilesMatch "\.php$">
              SetHandler fcgid-script
          </FilesMatch>
          FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php
                Order allow,deny
          Allow from all
              </Directory>
        IPCCommTimeout  7200
        MaxRequestLen 15728640
      </IfModule>
    
      <IfModule mpm_itk_module>
        DocumentRoot /usr/local/ispconfig/interface/web/
        AssignUserId ispconfig ispconfig
        AddType application/x-httpd-php .php
        <Directory /usr/local/ispconfig/interface/web>
          # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
          Options +FollowSymLinks
          AllowOverride None
                Order allow,deny
          Allow from all
                php_value magic_quotes_gpc        0
        </Directory>
      </IfModule>
    
      # ErrorLog /var/log/apache2/error.log
      # CustomLog /var/log/apache2/access.log combined
      ServerSignature Off
    
      <IfModule mod_security2.c>
        SecRuleEngine Off
      </IfModule>
    
      # SSL Configuration
      SSLEngine On
      SSLProtocol All -SSLv2 -SSLv3
      SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
      SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
      #SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
    
    </VirtualHost>
    
    


    Thanks for reading, thanks for helping, thanks for replies ;-)
     
    Last edited: Feb 23, 2015
  2. DIake

    DIake New Member

    Up, Nobody know?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, thats the intended behaviour of a port based vhost.

    1) Restore the original spconfig vhost, your vhost contains several changes that make it invalid.
    2) then add a single line into the vhost:

    ServerName panel.domain.fr

    and restart apache.
     

Share This Page