Home  >  Article  >  Backend Development  >  Installation and configuration of Apache2+Mysql5+Php5 under Debian_PHP tutorial

Installation and configuration of Apache2+Mysql5+Php5 under Debian_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:29:38971browse

Install AMP

apt-get install apache2 mysql-server php5 php5-mysql5

Configure Apache2 default site

vi /etc/apache2/sites-enabled/000-default

Add a line

RedirectMatch ^/$ /apache2-default/

No need to test this step

Modify Apache2 main configuration

vi /etc/apache2/apache2.conf

should be changed to:

Include module configuration:

Include /etc/apache2/mods-enabled/*.load Include /etc/apache2/mods-enabled/*.conf

Also:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

Restart Apache2

/etc/init.d/apache2 reload

Now to configure PHP 5

vi /etc/php5/apache2/php.ini

Php5 does not support Mysql by default. In order to enable support, it needs to be modified

extension=mysql.so

Set Mysql root password

Mysql is installed by default. The root user has no password, which is really dangerous. We will add a password for him.

mysqladmin -uroot password abc123

Where abc123 is your password.

Of course you can also use the following command to set a password:

mysql -u root mysql

mysql> update user set password=password(pass) where user=root;

Create a library and its users for the site to be built

mysql -u root -p mysql

mysql> create database drupal;

mysql> use drupal;

mysql> grant all on drupal.* to drupal_user@localhost;

mysql> use mysql;

Database changed

mysql> update user set password=password(pass) where user = drupal_user;

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql>q;

mysqladmin reload


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531671.htmlTechArticleInstall AMP apt-get install apache2 mysql-server php5 php5-mysql5 Configure Apache2 default site vi /etc/apache2/ sites-enabled/000-default Add a line RedirectMatch ^/$ /apache2-defaul...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn