Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pheonixsolutions

Pages: [1]
1
CentOS-WebPanel Bugs / Website Loading Default page sometimes
« on: June 17, 2017, 08:08:59 AM »
Hello,

We have installed CWP version: 0.9.8.249 on our server. We have added the new domain and restarted httpd service.

The website correctly loads the page from the location "/home/Username/public_html" sometimes and sometimes it loads the page from /usr/local/apache/htdocs/.

The Vhost configuration is pasted below.
Code: [Select]
<VirtualHost xx.xx.xx.xx:80>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin info@domain.com
DocumentRoot "/home/username/public_html"
ScriptAlias /cgi-bin/ "/home/username/public_html/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/username/domain.com/*.conf

<IfModule mod_suexec.c>
        SuexecUserGroup username username
</IfModule>
<IfModule mod_deflate.c>
   AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/plain text/xml application/javascript
   <IfModule mod_setenvif.c>
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4.0[678] no-gzip
      BrowserMatch MSIE !no-gzip !gzip-only-text/html
   </IfModule>
</IfModule>
<IfModule mod_expires.c>
    ExpiresActive on
 
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
</IfModule>
<IfModule mod_suphp.c>
        suPHP_UserGroup username username
        suPHP_ConfigPath /home/username
</IfModule>

<Directory "/home/username/public_html">
        AllowOverride All
<IfModule mod_mime.c>
   AddType application/x-javascript .js
   AddType text/css .css
   </IfModule>

</Directory>

</VirtualHost>
# vhost_end domain.com

The installed modules are pasted below.
Code: [Select]
core_module (static)
 so_module (static)
 http_module (static)
 mpm_event_module (static)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 deflate_module (shared)
 mime_module (shared)
 log_config_module (shared)
 env_module (shared)
 expires_module (shared)
 headers_module (shared)
 unique_id_module (shared)
 setenvif_module (shared)
 version_module (shared)
 proxy_module (shared)
 proxy_connect_module (shared)
 proxy_http_module (shared)
 unixd_module (shared)
 status_module (shared)
 autoindex_module (shared)
 dir_module (shared)
 userdir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 security2_module (shared)
 ssl_module (shared)
 suphp_module (shared)

We are unable to find the fix for the issue. Could someone help us on this?

2
CentOS-WebPanel Bugs / Re: Issue with Enabling GZIP module on CWP
« on: May 14, 2017, 07:20:18 AM »
Hello Karl,

Thanks for the update.

Yes, I have restarted apache.

>>I noticed your examples are .css files. Most likely the are cached, and when cached no need to download them, therefore no gzip connection needed
This may be correct because the we have added expire however we are not sure. The online compression website shows as gzip enabled sometimes and sometimes its not.


3
CentOS-WebPanel Bugs / Re: Issue with Enabling GZIP module on CWP
« on: May 10, 2017, 08:26:50 AM »
Hello Karel,

Thanks for your reply.  Now, I have tried the solution and its still the same result.

================
# curl -I -H 'Accept-Encoding: gzip,deflate' https://domain.tld/style.css
HTTP/1.1 200 OK
Date: Wed, 10 May 2017 08:22:20 GMT
Server: Apache/2.4.25 (Unix) OpenSSL/1.0.1e-fips
Last-Modified: Thu, 04 May 2017 07:23:07 GMT
Accept-Ranges: bytes
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Cache-Control: public
Expires: Fri, 09 Jun 2017 08:22:20 GMT
Content-Length: 34313
Content-Type: text/css

# curl -I -H 'Accept-Encoding: gzip,deflate' https://domain.tld/style.css
HTTP/1.1 200 OK
Date: Wed, 10 May 2017 08:22:22 GMT
Server: Apache/2.4.25 (Unix) OpenSSL/1.0.1e-fips
Last-Modified: Thu, 04 May 2017 07:23:07 GMT
ETag: "3f329-54eada4f391c1"
Accept-Ranges: bytes
Content-Length: 258857
Cache-Control: public
Content-Type: text/css
===============

Have you tried all solutions posted there?
Yesterday I added my solution:
This thread got me thinking. The above solutions do work but I think \usr\local\apache\conf.d\empty.conf is a better place to add custom settings which will survive updates and rebuilds.

Directly edit as root: \usr\local\apache\conf.d\empty.conf
or go to your cwp and navigate to Apache Settings --> Apache Include conf --> select empty.conf
(admin/index.php?module=file_editor&file=/usr/local/apache/conf.d/empty.conf)

I added compressing (mod_deflate), caching and some security.

Code: [Select]
### file to edit \usr\local\apache\conf.d\empty.conf
### Caching, compress and some security added thanks to https://www.gebruikers.eu
# Load mod_deflate.so only if it is not previously enabled, check httpd.conf for this.
# In my case it wasn't enabled. I prefer this empty.conf to load mod_deflate so my config survives updates and rebuilds.
LoadModule deflate_module modules/mod_deflate.so

<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images and other uncompressible content
SetEnvIfNoCase Request_URI \
 \.(?:gif|jpe?g|png|rar|zip|exe|flv|swf|mov|wma|mp3|mp4|avi|mp?g)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>

# BEGIN Compress text files
<ifModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
    AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
    AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
    AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
    AddOutputFilterByType DEFLATE font/truetype font/opentype
</ifModule>
# END Compress text files and caching

# BEGIN Expire headers https://samaxes.com/2011/05/improving-web-performance-with-apache-and-htaccess/
<ifModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 5 seconds"
    ExpiresByType text/html "access plus 1 second"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType application/xhtml+xml "access plus 1 second"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
    <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
        Header set Cache-Control "public"
    </filesMatch>
    <filesMatch "\.(css)$">
        Header set Cache-Control "public"
    </filesMatch>
    <filesMatch "\.(js)$">
        Header set Cache-Control "private"
    </filesMatch>
    <filesMatch "\.(x?html?|php)$">
        Header set Cache-Control "private, must-revalidate"
    </filesMatch>
    </ifModule>
# END Cache-Control Headers

# BEGIN Turn ETags Off
    FileETag None
# END Turn ETags Off

# Protection against malicious code in files imposing as images
#ForceType application/octet-stream
<FilesMatch "(?i).jpe?g$">
    ForceType image/jpeg
</FilesMatch>
<FilesMatch "(?i).gif$">
    ForceType image/gif
</FilesMatch>
<FilesMatch "(?i).png$">
    ForceType image/png
</FilesMatch>

4
CentOS-WebPanel Bugs / Issue with Enabling GZIP module on CWP
« on: May 09, 2017, 06:16:55 AM »
We are using Centos Web Panel.

Our Server information are mentioned below.

Apache version: Apache/2.4.25
PHP version: 5.6.30

We have enabled gzip as per the article

http://forum.centos-webpanel.com/informations/activating-gzip-mod_deflate-and-enabling-caching-on-apache/

After enabling the module, when I do curl request, sometimes gzip is working and sometimes, its not.

=====
curl -I -H  "Accept-Encoding: gzip"   http://domain.tld/main.css
HTTP/1.1 200 OK
Date: Tue, 09 May 2017 05:51:18 GMT
Server: Apache/2.4.25 (Unix) OpenSSL/1.0.1e-fips
Last-Modified: Thu, 04 May 2017 07:08:11 GMT
ETag: "c6cfc-54ead6f892950-gzip"
Accept-Ranges: bytes
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
=====

===
 curl -I -H  "Accept-Encoding: gzip"   http://domain.tld/main.css
HTTP/1.1 200 OK
Date: Tue, 09 May 2017 05:53:47 GMT
Server: Apache/2.4.25 (Unix) OpenSSL/1.0.1e-fips
Last-Modified: Thu, 04 May 2017 07:08:11 GMT
ETag: "c6cfc-54ead6f892950"
Accept-Ranges: bytes
Content-Length: 814332
Cache-Control: public
Content-Type: text/css

===

We are running with "CWP version: 0.9.8.231 ". We have checked the website on "https://checkgzipcompression.com". It also sometimes reports that gzip enabled and sometimes gzip not enabled.

Can someone please help me out to resolve the issue?

Pages: [1]