Search This Blog

Showing posts with label Web Serever. Show all posts
Showing posts with label Web Serever. Show all posts

Tuesday, June 5, 2012

phpinfo - how to create info file?

PHP Info


This file can help you to identify which php modules/extensions installed and enabled on your server.
This solution very simple.
Step 1.
Connect to the server through SSH and be sure you have root credentials.
Navigate to public_html directory.
cd /home/websiteuser/public_html
Step 2.
Create file.
nano phpinfo.php
Copy to the file code below:


<?php  
phpinfo(); 
?> 
Save and quit from file editor.
Step 3.
Let's check file permissions and owner.

root@server [/home/ websiteuser/public_html]# ls -l | grep phpinfo
-rw-------  1 root  root      24 Jun  5 13:34 phpinfo.php

As you see, owner of this file root, because we created this file under user root.
Change ownership:
chown websiteuser.websiteuser phpinfo.php
Change permissions:
chmod 644 phpinfo.php

Step 4.
Browse to this file from browser.
http://websiteuser.com/phpinfo.php

Now you see information page of apache & php. All modules and extensions.

eNj0Y!


Wednesday, May 16, 2012

mod_deflate configuration. Error playing .swf (flash)

Apache v2 module Deflate.

Today I stuck on something very strange.
Server whom I worked on it, run's WHM and on one of the websites, I saw follow issue:
Main page running .swf files, I mean flash. When I open the website in google chrome and internet explorer,  I see blank grey page while in FIREFOX it works fine.

               What is the problem here?

First I checked which modules installed on this server by httpd –l command.
Afterwards, I dug from network something interesting and I tried to resolve this issue. So better  Keep it for your self.
On this server installed mod_delflate.

Quote from WIKI:
"mod_deflate is an optional module for the Apache HTTP Server, Apache v2 only. Based on Deflate lossless data compression algorithm that uses a combination of the LZ77 algorithm and Huffman coding.This module provides the DEFLATE output filter that allows output from Apache HTTP server to be compressed before being sent to the client over the network.It also provides a filter for decompressing (inflating, uncompressing) a gzip compressed response body.The mod_deflate module does not have a lower bound for file size, so it attempts to compress files that are too small to benefit from compression. This results in files smaller than approximately 120 bytes becoming larger when processed by mod_deflate"
To resolve this problem, you need to edit  /usr/local/apache/conf/includes/post_virtualhost_global.conf
Add SWF extension to  "Don't compress images"
Here is my example:

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# 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
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won’t work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|swf)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>

Exit from editor, save and restart httpd.
/etc/init.d/httpd restart
Refresh your website, it's should be ok.
eNj0y!