MRKAVANA (mrkavana@gmail.com) - www.facebook.com/kavanathai
Showing posts with label phpmyadmin. Show all posts
Showing posts with label phpmyadmin. Show all posts

Aug 25, 2011

Howto install a PHP FileInfo module in Linux?


The steps to install the PHP ‘Fileinfo’ module on a Linux server is as below:
1) Download and untar the package
# wget http://pecl.php.net/get/Fileinfo-1.0.4.tgz
# tar -zxf Fileinfo-1.0.4.tgz
# cd Fileinfo-1.0.4
2) Generate the extension for compiling
# phpize
3) Configure the module
# ./configure
4) generate the install files and install it
# make
# make install
5) Once done, the extension will be available under the /usr/lib64/php/modules directory.
You now need to add the extension somewhere in the php configuration file. Edit /etc/php.ini and add the following:

extension=fileinfo.so
6) Save the file and restart the webserver
# service httpd restart
To check if “fileinfo” is enabled on the server, execute:
# php -i | grep fileinfo
fileinfo
fileinfo support => enabled
Alternate method
Just an FYI, the module can also be installed using the PECL command i.e.
# pecl install fileinfo
Once done, just follow steps 5 and 6 mentioned above. That’s it.

How to install SuPHP/phpSuExec on Plesk?


How to install SuPHP/phpSuExec on a Plesk server?
SuPHP Or PHPSuExec is a module that increases the security of the server and executes PHP files under the ownership of the owner of the file instead of the Apache user i.e. “apache”.
The advantages of having suPHP are:
1. Files and Directories those need 777 permissions to write into, via the browser will now need a maximum of 755 permissions. The files/directories with 777 permissions will result in an “Internal Server Error”.
2. If you need to manipulate the value of a php directive for a domain, for ex. register_globals, it needs to be placed in the php.ini of a domain instead of the .htaccess file as it will result in an “Internal Server Error”.
3. All the files and directories uploaded using a script will have the ownership of the user instead of user ‘apache’ (i.e. the Apache user).
4. A user can edit/remove the files using Ftp that are uploaded via the browser.
In order to install SuPHP on the server, download and install the atomic script
# wget -q -O - http://www.atomicorp.com/installers/atomic | sh
Once the script is installed, install SuPHP module using yum
# yum install mod_suphp
The next step is to load the SuPHP module with Apache. The suphp installation automatically creates a “suphp.conf” file under the Apache configuration directory, if not create it.
# vi /etc/httpd/conf.d/suphp.conf
and insert the following lines:
#Load the Mod_SuPHP module
LoadModule suphp_module modules/mod_suphp.so
php_admin_value engine off
# Enable handlers
suPHP_AddHandler x-httpd-php
AddHandler x-httpd-php .php .php3 .php4 .php5
#Enable the SuPHP engine
suPHP_Engine on
Apache calls all the configuration files from the /etc/httpd/conf.d directory by default so there is no need to include the module in the httpd.conf file separately.
Now,  configuration file under /etc should be present (if not create it)
vi /etc/suphp.conf
copy/paste the following contents as it is:
[global]
logfile=/var/log/suphp.log
loglevel=info
webserver_user=apache
docroot=/var/www/vhosts
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
check_vhost_docroot=false
errors_to_browser=false
env_path=/bin:/usr/bin
umask=0022
min_uid=500
min_gid=500

[handlers]
x-httpd-php="php:/usr/bin/php-cgi"
x-suphp-cgi="execute:!self"
Make sure the “handle_userdir” directive is commented or removed from the file since it is deprecated from the latest version.
At the end, we have to restart the httpd service for all these changes to take effect
# service httpd restart
Test the SuPHP installation: Create a phpinfo.php file with 777 permission and it should show you an “Internal Server Error” on browsing.


Jul 18, 2011

How to install and configure phpmyadmin on redhat linux or centos linux

First of all add the rpmforge repository to user system. Explained here

Now :

[root@localhost ~]# yum install phpmyadmin

[root@localhost html]# vi /usr/share/phpmyadmin/config.inc.php

And add the blowfish secret,
$cfg['blowfish_secret'] = 'a8b7dafdferHJHJ^&U^45776TIUuiYc6d';

http://127.0.0.1/phpmyadmin/

Now edit the phpmyadmin configuration file for apache

[root@eastonch /]# vi /etc/httpd/conf.d/phpmyadmin.conf


  Order Deny,Allow
  Allow from all #set to allow from all. else you'll get only from localhost.


Restart the apache

[root@localhost ~]#/etc/init.d/httpd restart

Now its accessible from everywhere.

http://Public_Ip_address/phpmyadmin/