Ubuntu10.10 install drupal7 and its environment (Apache, MySQL, PHP)

Source: Internet
Author: User

Install Drupal.

1. First install the environment.

 
Sudo Apt-GetInstall apache2 PhP5 PhP5-GD MySQL-Server PhP5-MySQL

During installation, enter the MySQL password.

Apache-apache2, php-php5, MySQL-mysql-server, these don't have to be said.

Php5-gd this is the GD extension of PHP required by drupal7, the GD library used for drawing.

Php5-mysql this is integrated MySQL and PHP, only install PhP5 and MySQL, how can not find how to modify PHP. ini, in the past there are; Extension = mysql. SoYou can just remove the comment. I don't know how to do this version.

2. Test the installation environment.

The default Apache website directory is/var/www.

Sudo gedit/VaR/WWW/Phpinfo. php

Add files. File Content:

 
<?PHP
Echo Phpinfo();
?>

Open the webpage (http: // 127.0.0.1/phpinfo. php) to check whether the installation is successful. Check whether the GD and MySQL columns are installed successfully.

3. Engage in MySQL

Drupal installation requires the installer to create a database in advance. This requires us to do it in MySQL. Run:

 MySQL  - U  <  Username  >     -  P
// Or
MySQL - U < Username > - P < Password >
// -There is no space between P and password.

-U is followed by the MySQL user name you set. If it is the same as the user name currently logged on to your system, you do not need to use it. But-P is required. Otherwise, the password cannot be entered and the password cannot be entered.

Enter-P only, and you will be prompted to enter the password. After entering:

//Displays the existing database. commands in MySQL must be executed with a semicolon (;).
Show databases;
//Create a database. This database is required when Drupal is installed.
Create Database Drupal;
//Check whether the operation is successful.
Show databases;

Note: After the installation is complete, restart Apache: sudo/etc/init. d/apache2 restart. Otherwise, errors such as unsupported PHP files may occur.

4. Everything is ready

Go to http://drupal.org/to download the tar.gzpackage of drupal7. Decompress tar xvzf. Copy all contents to/var/www.

The original index.html is renamed or deleted.

Start http: // 127.0.0.1 and install it step by step.

If you are prompted that GD is not supported, the reason is that PhP5 is not installed.-GD.

Note that the PQ database is not supported, but PhP5 is not installed.-The MySQL or MySQL version is too low.

If the prompt says./sites/defalut/has no write permission, execute:

 
Sudo chmod777 /VaR/WWW/Sites/Default

Note: After the execution is complete, change it back to 755. Otherwise, it is not safe.

If no setting. php prompt is displayed, execute CP default. Setting. php setting. php as prompted, and change the setting permission to 777. After Drupal is installed, change it back to 744.

Step by step prompt, there should be a problem.

5. Enable clean URL

Clean URL not only looks comfortable (no? , And other strange symbols), and Seo-friendly. This is definitely a must for home-based travel, murder, and arson...

Cleanurl requires the Apache rewrite function. Apache does not enable this function by default. Therefore, enabling the clean URL directly in Drupal won't succeed. Is a successful interface:

When the rewrite function is not enabled, the enable clean URLs check box does not exist. At that time, it will not succeed...

First open the rewrite module of apache2:

 
Sudo a2enmod rewrite

Then you can see the following line through apache2ctl-M, indicating that the module has been installed:

Rewrite_module (SHARE)

Then you need to change the configuration of apache2:

Sudo vi/Etc/Apache2/Sites-Available/Default

Under <directory/var/WWW>:

Change AllowOverride none to AllowOverride all.

Finally restart apache2:

Sudo/Etc/Init. d/Apache2 reload
//Or
Sudo service apache2 restart

Then go to Drupal (drupal7: configuration-clean URLs-enabale clean URLs-save configuration) to enable it.

Open the webpage again and send a post. What is the website no longer? Q = that format, but changed to the node/test format.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.