Simple implementation of lamp Architecture

Source: Internet
Author: User
Tags php and mysql install wordpress

The implementation of web servers in the lamp architecture is divided into three layers:

1. access layer for the Web server to respond to client requests

2. Use the application layer of the application business

3. Data Layer for backend Data Services

These three layers can already meet basic needs.

 

 

The three layers are implemented using http2.2, hph5.3, and mysql5.1 respectively.

 

# Yum install httpd

# Vim/etc/httpd/CONF/httpd. conf

Servername 192.168.1.33: 80

# Service httpd configtest

Syntax OK

# Vim/var/www/html/index.html is the default page to access.

# Chkconfig httpd on

#/Etc/init. d/httpd start
Starting httpd: [OK]

 

Httpd startup completed

Use IP Address: 192.168.1.33 on the client to access the web site.

 

Start HPH

# Yum install PHP

# Vim/etc/httpd/CONF/httpd. conf

Directoryindex index. php index.html. var

# Service httpd configtest

Syntax OK

# Vim/var/www/html/index. php

Write the following content

<? PHP

Phpinfo ();

?>

#/Etc/init. d/httpd restart

If you can access the PHP returned content by using an IP address on the webpage, it means you can use PHP.

 

 

Install MySQL

# Yum install MySQL mysql-server PHP-MySQL

#/Etc/init. d/mysqld start

# MySQL can be directly connected to MySQL using the Default User Root

Write the following script on the homepage to test the connectivity with MySQL.

[[Email protected] MySQL] # Vim/var/www/html/index. php

<? PHP

$ Link = mysql_connect (localhost, root ,'');

If ($ link)

Echo "sueccess ...";

Else

Echo "failure ...";

?>

#/Etc/init. d/httpd restart

 

When sueccess occurs during client access, it means that the connection between PHP and MySQL has been completed.

 

Such a lamp architecture is simply implemented on a server.

 

 

Install Wordpress

[[Email protected] ~] # Unzip wordpress-3.1-RC1.zip


[[Email protected] HTML] # mv/root/wordpress-3.1-RC1/wordpree/*/var/www/html/

Provides the main configuration file

[[Email protected] HTML] # cp wp-config-sample.php wp-config.php


[[Email protected] HTML] # Vim wp-config.php.

// ** MySQL settings-you can get this info from your web host **//

/** The name of the database for WordPress */

Define ('db _ name', 'wpdb'); the database is wpdb


/** MySQL database username */

Define ('db _ user', 'root'); the user is root


/** MySQL Database Password */

Define ('db _ password', ''); the password is empty.

 

# Setenforce 0


You can view the WordPress page in the browser.

Provide the user name and password on the initialization page, and then log on to the email.

650) This. width = 650; "Title =" 24.png" src = "http://s3.51cto.com/wyfs02/M00/3C/D4/wKiom1PDb2mgs91zAAKIHVt8o58965.jpg" alt = "wkiom1pdb2mgs91zaakihvt8o58965.jpg"/>

 

 

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.