Wednesday, December 2, 2015

Could not reliably determine the server's fully qualified domain name

This is just a friendly warning and not really a problem (as in that something does not work).
If you insert a
ServerName localhost   
in either httpd.conf or apache2.conf in /etc/apache2 and restart apache the notice will disappear.
If you have a name inside /etc/hostname you can also use that name instead of localhost.

And it uses 127.0.1.1 if it is inside your /etc/hosts:
127.0.0.1 localhost
127.0.1.1 myhostname
Troubleshooting Apache
If you get this error:
apache2: Could not determine the server's fully qualified domain name, 
using 127.0.0.1 for ServerName
then use a text editor such as "sudo nano" at the command line or "gksudo gedit" on the desktop to create a new file,
sudo nano /etc/apache2/conf.d/fqdn
or
gksu "gedit /etc/apache2/conf.d/fqdn"
then add
ServerName localhost
to the file and save. This can all be done in a single command with the following:
 echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
But on Ubuntu 14.04:
 echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
 sudo a2enconf fqdn
Don't forget the ".conf" (without will not work).

How To Install And Configure mod_deflate On CentOS 7

Tuesday, December 1, 2015

How to turn off server signature on Apache web server

Check this out : http://ask.xmodulo.com/turn-off-server-signature-apache-web-server.html
Revealing web server signature with server/PHP version info can be a security risk as you are essentially telling attackers known vulnerabilities of your system. Thus it is recommended you disable all web server signatures as part of server hardening process.

Disable Apache Web Server Signature

Disabling Apache web server signature can be achieved by editing Apache config file.
On Debian, Ubuntu or Linux Mint:
$ sudo vi /etc/apache2/apache2.conf
On CentOS, Fedora, RHEL or Arch Linux:
$ sudo vi /etc/httpd/conf/httpd.conf
Add the following two lines at the end of Apache config file.
1
2
ServerSignature Off
ServerTokens Prod
Then restart web server to activate the change:
$ sudo service apache2 restart (Debian, Ubuntu or Linux Mint)
$ sudo service httpd restart (CentOS/RHEL 6)
$ sudo systemctl restart httpd.service (Fedora, CentOS/RHEL 7, Arch Linux)
The first line 'ServerSignature Off' makes Apache2 web server hide Apache version info on any error pages.
However, without the second line 'ServerTokens Prod', Apache server will still include a detailed server token in HTTP response headers, which reveals Apache version number.

What the second line 'ServerTokens Prod' does is to suppress a server token in HTTP response headers to a bare minimal.
So with both lines in place, Apache will not reveal Apache version info in either web pages or HTTP response headers.

Hide PHP Version

Another potential security threat is PHP version info leak in HTTP response headers. By default, Apache web server includes PHP version info via "X-Powered-By" field in HTTP response headers. If you want to hide PHP version in HTTP headers, open php.ini file with a text editor, look for "expose_php = On", and change it to "expose_php = Off".
On Debian, Ubuntu, or Linux Mint:
$ sudo vi /etc/php5/apache2/php.ini
On CentOS, Fedora, RHEL or Arch Linux:
$ sudo vi /etc/php.ini
1
expose_php = Off
Finally, restart Apache2 web server to reload updated PHP config file.
Now you will no longer see "X-Powered-By" field in HTTP response headers.

Friday, November 13, 2015

Installing APCu For PHP 5.5

APCu installation for PHP 5.5x:
Step 1:
Download APCu dll file for PHP 5.5x
Step 2:
Extract zip and rename with php_apcu.dll
Step 3:
Copy and paste in YOUR_DIR:\wamp\bin\php\php_YOUR_PHP_VER_5.5x\ext
Step 4:
Enable apc from php.ini
Open php.ini file
YOUR_DIR:\wamp\bin\apache\apache_YOUR_APACHE_VER\bin\php.ini
extension=php_apcu.dll
Put above line in php.ini file
OR (Base on your configuration)
YOUR_DIR:\wamp\bin\php\php_YOUR_PHP_VER_5.5x\php.ini
extension=php_apcu.dll
Put above line in php.ini file
Step 5:
Restart Apache

Install intl extension php_intl.dll in wamp

Check this out :

http://stackoverflow.com/questions/16372888/intl-extension-php-intl-dll-with-wamp

I had the same problem a few days ago.
You have to copy all the files (all files starts with icu*):
icudt.dll
icudt46.dll
icuin.dll
icuin46.dll
icuio.dll
icuio46.dll
icule.dll
icule46.dll
iculx.dll
iculx46.dll
icutest.dll
icutest46.dll
icutu.dll
icutu46.dll
icuuc.dll
icuuc46.dll
From:
<wamp_installation_path>/bin/php/php5.4.3/
To:
<wamp_installation_path>/bin/apache/apache2.2.22/bin/
And you also need to enable intl in php.ini file (uncomment this line):
;extension=php_intl.dll
And restart the server. It should works fine.
Of course, you need to replace the folder names with your own.