Thursday 28 May 2015

As-salam

Maaflah ya hari ni maklumat agak teknikal emm actually my note to setting XAMPP !!

1. Pre-installation Steps

Users of Windows XP can skip this step! It is for Vista and Windows 7 users! Disable UAC! You will do it by clicking on Start>Control Panel>User Accounts and then click on “Change User Account Control settings”. On the next window (remembering the default position of the slider) pull the slider down to “Never notify me when:…”, click on OK and close the windows. Vista users – just turn off User Account Control. Do not restart the computer now! For security reasons the slider should be reverted to default settings after successful installation of Apache, PHP and MySQL.

Full Document : 1stwebdesigner ~ how-to-setup-local-web-server-with-latest-apache-php-and-mysql-packages

2. Downloaded and installed XAMPP for Windows


3.  Change Root Password MySQL 

 A.  In the phpMyAdmin window, select SQL tab from the right panel. This will open the SQL tab where we can run the SQL queries.

B.  Now type the following query in the textarea and click Go 



UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES;


C. The query has been executed successfully.

If you refresh the page, you will be getting a error message. This is because the phpMyAdmin configuration file is not aware of our newly set root password. To do this we have to modify the phpMyAdmin config file.

D.  Open the file [XAMPP Installation Path] / phpmyadmin / config.inc.php in your favorite text editor.
Search for the string $cfg\['Servers'\]\[$i\]['password'] = '';
and change it to like this,
$cfg\['Servers'\]\[$i\]['password'] = 'password';

Here the 'password' is what we set to the root user using the SQL query.

Find  $cfg['Servers'][$i]['auth_type']     = 'config';
Change it to be like this :


$cfg['Servers'][$i]['auth_type']     = 'cookie';     
// We can use 1 of 3 type Authentication method (config, http or cookie based).

(
If you can not authenticate via the web interface (localhost/phpmyadmin/) then try change authentication type from config to cookie.
$cfg['Servers'][$i]['auth_type'] = 'cookie';
 sources : http://stackoverflow.com/questions/22333581/xampp-mysql-password-setting
)

Now all set to go. Save the config.inc.php file and restart the XAMPP server.

4.  Setting Conf file to Access PhpMyAdmin Remotely

You will have to edit 2 files - 1. httpd-vhosts.conf & 2. httpd-xampp.conf
NOTE : Make sure u backup files ( httpd-xampp.conf ) and ( httpd-vhosts.conf ) , Both Files are located in Drive:\xampp\apache\conf\extra

Open httpd-vhosts.conf file and in the bottom of the file change it
<VirtualHost *:80>
DocumentRoot “E:/xampp/htdocs/”
ServerName localhost
<Directory E:/xampp/htdocs/>.
Require all granted
</Directory>
</VirtualHost>

 Second Change is on httpd-xampp.conf file and in the bottom of the file change it
#
# New XAMPP security concept
#
<LocationMatch “^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))”>
Order deny,allow
Allow from all
Allow from ::1 127.0.0.0/8
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

 Find "<Directory "C:/xampp/php">" and then change to something like this

<Directory "C:/xampp/php">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>


5.  Testing


 

No comments:

Post a Comment