Source: http://www.laozhe.net/302.html
In general, the installation is the latest official version, unless you have special needs, to install the specified version, this article is not discussed. From the very beginning of the basics, a little bit to complete an available Linux host. Here's how to install the LAMP component on CentOS 6.0. After installing the following statement, the currently installed version is:
php:5.3.2
apache:2.2.15
mysql:5.1.52
First, install MySQL
Start with the MySQL installation. Open HyperTerminal and enter:
1 |
yum install mysql mysql-server |
The installation is complete so that MySQL can start automatically with the system:
12 |
chkconfig --levels 235 mysqld on /etc/init .d /mysqld start |
To set the password for the MySQL data root account:
1 |
mysql_secure_installation |
Press ENTER directly when prompted as follows:
Enter Current password for root
Appear as follows to enter again:
Set root Password? [y/n]
The following prompts you to enter the password you need to set, enter after entering the confirmation:
New Password:
Then there will be four confirmations, namely:
You can enter directly.
Second, install Apache components
Since CentOS has encapsulated Apache, run the installation directly:
Also configure the system to allow Apache to boot with the system:
1 |
chkconfig --levels 235 httpd on |
After configuration, start Apache:
Now that you have access to your server, you can see the test page "Apache 2 test page powered by CentOS", without any surprises. Note that if the other machine accesses the service and cannot display this page, it can be accessed directly on this server, which is normally forbidden by the CentOS-brought firewall. You only need to enter the firewall, the "WWW" corresponding to the "80" port to open.
Note: The default root directory for Apache in CentOS is/var/www/html, configuration file/etc/httpd/conf/httpd.conf. Other configurations are stored in the/etc/httpd/conf.d/directory.
Third, install PHP
Enter the following command to install PHP:
The Apache service needs to be restarted:
1 |
/etc/init .d /httpd restart |
Iv. Testing PHP Related information
This step can actually be omitted, but in order to test whether the installation is successful, you can create a new PHP page to test and create a new one using the VIM editor:
1 |
vi /var/www/html/info .php |
Press "I" key to edit, enter:
After editing, press "ESC" key to exit edit mode, then enter:
Then enter, save and exit.
At this point you can access your site address, such as "http://192.168.1.2/info.php", to see if you can see the relevant PHP information.
Seeing this diagram shows that the PHP installation was successful.
V. Linking the PHP module with the MySQL module
You also need to associate PHP with MySQL in order to work properly. Search module:
To install the relevant modules:
1 |
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc |
The Apache module needs to be restarted to take effect:
1 |
/etc/init .d /httpd restart |
Refresh the "info.php" page you just created, and pull down to find the relevant MySQL module to see if the relevant information is detected.
If you see information like this, it means that MySQL is working properly.
Installation: phpMyAdmin
Source: http://jingyan.baidu.com/article/86fae3468678533c48121a62.html
Can be downloaded under window through my Baidu Cloud phpMyAdmin, version 4.05 full-language version
Link Address: http://pan.baidu.com/share/link?shareid=3747011120&uk=3003518191
1. You can download and upload the file to CentOS via the link winscp
2. Change phpMyAdmin to the name you want, like pmn.tar.gz.
3. Then move the file to the Centos/var/www/html directory and start the terminal (Shell terminal)
Input cd/var/www/html
Tar Xvfz pmn.tar.gz
4. Install and unzip, change the folder name to PMN
5. Then enter the CD PMN under Terminal
6. Rename the config.sample.inc.php to config.inc.php under PMN (both extracted phpMyAdmin folder)
7. Copy the sample configuration file to the config.inc.php file
Enter the CP config.sample.inc.php config.inc.php under terminal
8. Restart Apache
Enter the service httpd under terminal restart
9. Enter 127.0.0.1/pmn/in the browser to browse and access the
CentOS Install Lamp (Linux + Apache + PHP) and install phpMyAdmin