0

I have two NIC on my CentOS 7 system. One is private and second is public. I have following configurations of each virtual host

Virtual host for private IP

    ServerName localhost.com
    ServerAlias localhost.com.pk

    DocumentRoot /var/www/html/pub_local

    ErrorLog /var/log/httpd/local_error.log
    CustomLog /var/log/httpd/local_access.log combined  

Alias "/images/" "/srv/www/humkinar/"
    <Directory "/srv/www/humkinar/">
         Require all granted
    </Directory>

<IfModule dir_module>
    DirectoryIndex index.php index.html 
</IfModule>

<IfModule mod_deflate.c>
 AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript
 </IfModule>

</VirtualHost>

Virtual host for public IP

<VirtualHost xx.xx.xx.xx:80>

    ServerName humkinar.com.pk
    ServerAlias www.humkinar.com.pk
    DocumentRoot /var/www/html/humkinar_ci

    ErrorLog /var/log/httpd/humkinar_error.log
    CustomLog /var/log/httpd/humkinar_access.log combined

# Alias for outsourcing images
   Alias "/images/" "/srv/www/humkinar/"

        <Directory "/srv/www/humkinar/">
                 Require all granted
        </Directory>
#========== outsourcing ends ============

<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

<IfModule mod_deflate.c>
 AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript
 </IfModule>
#from use.conf
<IfModule mod_expires.c>
ExpiresActive On
    ExpiresDefault "access plus 10 days"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/plain "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"  
    ExpiresByType application/x-icon "access plus 1 year"
</IfModule>
</VirtualHost>

When I send I request from private IP. All images are loaded without any problem. But When I run a request, some images are load and some images could not be accessible via live IP but actually they exist is directory. Where is the problem?

0 Answers0