Lamp environment Construction and case application

Source: Internet
Author: User
Tags create index install php mysql

Server IP Address 192.168.1.25

Lampàlinux +apache +mysql +php

1. Install Apache Service

[Root@localhost ~]# Yum Install Httpd–y

2. Install MySQL Service

[Root@localhost ~]# yum list all |grep MySQL

[root@localhost ~]# yum install MySQL Mysql-server

3. Start Service

[root@localhost ~]# Service mysqld start

[root@localhost ~]# service httpd start

4. Setting up Boot

[Root@localhost ~]# chkconfig httpd on

[Root@localhost ~]# chkconfig mysqld on

5. Test MySQL Service

[Root@localhost ~]# MySQL

mysql> use MySQL;

Mysql> Show tables; View Database

Mysql> \q

[root@localhost ~]# mysqladmin-u root-p password ' 1234 '--Login password

Enter Password: Empty original password

[Root@localhost ~]# MySQL

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)

6. Re-login MySQL

[Root@localhost ~]# mysql-u root–p

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or \g.

Mysql> \q

7. Install PHP

[Root@localhost ~]# yum list all |grep php

[root@localhost ~]# yum install php php-mysql

8. After the installation of PHP in the/ETC/HTTPD/CONF.D directory under the new add php.conf files

[Root@localhost ~]# CD/ETC/HTTPD/CONF.D

[Root@localhost conf.d]# LL

Total 32

-rw-r--r--1 root root 560 2009-02-26 php.conf

-rw-r--r--1 root root 566 2009-07-15 proxy_ajp.conf

-rw-r--r--1 root root 392 2009-07-15 README

-rw-r--r--1 root root 299 2009-07-15 welcome.conf

9. Test whether PHP is installed successfully, create index.php

[Root@localhost conf.d]# cd/var/www/html

[Root@localhost html]# vim index.php

Enter the following:

?

Phpinfo ()

?>

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.