Resources:
Http://www.paipat.com/?post=24
Http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html
1. Installing Apache
2. Install PHP
3. Install MySQL
1. Installing Apache
- Installation: Installing Apache:yum install httpd directly with Yum
RPM using:
Format: Rpm-q "sub-option" "Software name"
Usage: Complete different queries with different sub-options
-QA: View a list of all RPM packages installed on the system
-qi: View detailed information for the specified software
-QL: Query execution package installed directory, file list
-QC: Querying only the configuration files for the specified package installation
-QD: Displays only documentation files for the specified package installation
- Configuration:
#service httpd Restart [start] [stop]//Restart, start, close Apache
/ETC/HTTPD/CONF/HTTPD.CONF//Apache configuration information
/VAR/LOG/HTTPD//Apache log information
Boot start: Chkconfig httpd on [off]
Workaround:
Modify/etc/httpd/conf/http.conf Add ServerName localhost:80
Browser input: http://127.0.0.1:80 or http://localhost:80
2. Install PHP
#yum Install PHP//installation PHP module
#yum Install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc//install PHP to support these components
#yum install Php-mysql//php support MySQL
To create a modified/var/www/html/test.php file:
<?php phpinfo ();?>
Browser view http://localhost/test.php can display PHP page normally
3. Install MySQL
[Email protected] ~]# Rpm-qa | grep MySQL//check to see if MySQL is installed
[[email protected] ~]# rpm-e mysql//normal Delete mode [[email protected] ~]# rpm–e --nodeps mysql//brute force Delete mode
After the deletion we can pass Rpm-qa | grep mysql command to see if MySQL has been uninstalled successfully
Enter Yum List | grep mysql command to view the downloadable version of the MySQL database available on Yum:
[email protected] ~]# Yum List | grep MySQL
Downloadable version information for the MySQL database on the Yum server:
Enter the Yum install-y mysql-server mysql mysql-devel command to install the MySQL mysql-server mysql-devel.
[email protected] ~]# yum install-y mysql-server MySQL mysql-devel
[Email protected] ~]# Rpm-qi mysql-server
We installed the Mysql-server is not the latest version, if you want to try the latest version, then go to the MySQL website to download rpm package installation, so that our MySQL database has been installed.
- MySQL Initialization and configuration
[[email protected] ~]# service mysqld start [restart] [stop]//Start, restart, stop MySQL
[[email protected] ~]# mysqladmin-u root password ' root '//Use this command to set the root account password to root
At this point we can log in to our MySQL database via the mysql-u root-p command.
1,/etc/my.cnf This is the main configuration file of MySQL
2, /var/lib/mysql mysql database database file storage location
The database files for our MySQL database are usually stored in the/ver/lib/mysql directory.
3. /var/log MySQL database log output storage location
Some of our MySQL database's log output is stored in the/var/log directory
4. View MySQL port number
View the network ports for MySQL snooping
Command query port number in MySQL
Mysqladmin:connect to server at ' localhost ' failed error: ' Access denied for user ' root ' @ ' localhost ' (using Password:no )‘
Workaround:
1, Service mysqld stop//Stop mysqld
2. Login with Safe mode, Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
3. Mysql–u root mysql //Login
4. Change Password update user set password =password(new_passwd) where user= ' root ';
5. Restart MySQL and log in again