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 ()
?>