Build a Aicache Drupal test environment

Source: Internet
Author: User
Tags chmod mysql connect php and mysql drupal

one. The establishment of LAMP Environment


To run the Drupal system, first you need to have a platform to run PHP and Mysql database, the most common is the combination of linux+apache+mysql+php, this information on the internet there are many, you can refer to the relevant content online.

Let's take Ubuntu for example, the lamp installation is very convenient under Ubuntu, only need to run the following command:

sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

If you have already installed some of these software, you can also make a selective installation. In the installation process, you need to set the MySQL password (set to 123123), be sure to remember this password, you need to use this password later. If there is a problem with the installation, please refer to here.

Now that we have a PHP running environment, let's test it by creating a. php file in the Apache service directory, such as test.php, to test PHP and MySQL running.


$link =mysql_connect (' localhost ', ' root ', ' mysql password ');

if (! $link) echo "MySQL Connect fail";

else echo "MySQL connect success!";

Mysql_close ();


Note: Please fill in your MySQL username and password correctly in mysql_connect (' localhost ', ' root ', ' mysql password ').

Here we visit this file. This address is based on your configuration to determine The Apache service here uses port 82.

When you see the MySQL connect success! This means that PHP and MySQL are running correctly.

two. installation of Drupal

You can here to download Drupal.

Extract the downloaded files into your Apache service directory. Here, put the files under the/var/www/drupal folder. Tar zxvf drupal-6.14.tar.gz/var/www/, then rename/var/www/drupal-6.14 to/var/www/drupal

1. Create a MySQL database for Drupal. Open the terminal, enter MySQL, and enter at the command line:

root@ubuntu# Mysql–u root–p

mysql> CREATE DATABASE Drupal;

2. Modify the default.settings.php file under/var/www/drupal/sites/default/as settings.php

3. Visit (this address is determined according to its own configuration). At this point, you should be able to see the installation interface for Drupal, and follow the instructions on the page to install Drupal correctly.


If the database cannot be established during Setup, modify the 92 lines of settings.php.

$db _url = ' mysql://username:password@localhost/databasename ';

Change username to your MySQL username root;password change to your MySQL password 123123,database to Drupal.

Note the access to the folder, and if you need to modify the permissions, run the chmod command to modify the permissions. chmod 777–r/var/www/drupal


4. Create a News page in Drupal, log on to the system with the Admin account you installed Drupal, create a page, click Create Content->create Story, creating a page.

Exit the admin login to see if the page you created is normal and if you can access it, it will have a similar address.



two. aicache the test that carries Drupal


1. Make sure you can access Drupal via Aicache

Join in the Pattern section in the configuration file

Pattern/.php REGXP 1m

Enables it to cache dynamic content. (This already exists in the default profile, you can enable it only if you delete the previous # number)

Configure Aicache properly to ensure that you can access the Drupal page through Aicache.

If the access is normal, the address of the page may be similar to this



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: 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.