Linux: RedHatLinux9Apache: Apache2MySQL: MySQL5.1.30PHP: php5 installation sequence: Sequence 2. Create a mysql user. This user is used by mysql in linux. # Groupa
Linux: Red Hat Linux 9
Apache: Apache2
MySQL: MySQL5.1.30
PHP: php5
Installation sequence: MySQL> Apache> PHP.
1. Decompress MySQL. # tar-zxvf MySQL5.1.30.tar.gz
2. Create a mysql user. This user is used by mysql in linux.
# Groupadd mysql # useradd-g mysql creates a mysql group and adds the user mysql to the mysql group.
3. Go to the decompressed directory and start installation.
# Cd MySQL5.1.30
#./Configure -- prefix =/server/mysql -- prefix parameter indicates that mysql will be configured and installed in/server/mysql.
# Make wait...
# Make install
4. Install the database
# Cp/MySQL5.1.30/super-files/my-medium.cnf/etc/my. cnf
#/Server/mysql/bin/mysql_install_db -- user = mysql
If the installation fails and an unknown parameter -- skip-federated error is prompted
1). Modify/etc/my. cnf and comment out the skip-federated parameter.
2), or add the parameter -- with-plugs = all during compilation.
5. Modify the installation directory permission
# Chown-R root: mysql/server/mysql
# Chown-R mysql/server/mysql/var is the database directory
6. Start mysql Testing
#/Server/mysql/bin/mysql_safe -- user = mysql &
Mysqld ended press ENTER
7. Connect to the database
#/Server/mysql/bin/mysql-u root-p
Press enter with no blank password by default. If the prompt is mysql>, the installation is successful!
8. Optional.
Use the mysql script to manually start the database and copy the super-files/mysql under the installation directory. server script to/server/mysql/bin, and modify the permission to 755. or copy mysql. server File to/etc/rc. d/init. d/mysqld and modify the permission to 700. finally, run chkconfig -- add mysqld MySQL installation.
Install Ahache2
1. Unpack
# Tar-zxvf httped-2.2.13 # cd httped-2.2.13
2. Configure and install
#./Configure -- prefix =/server/apache2 3. Compile and install
# Make install
4. Test
# Cd/server/apache2/bin/apachectl-k start if port 80 is occupied, you can modify the httpd. conf file in the/conf directory. The default web root directory is htdocs.
5. automatically start the service # echo '/server/apache2/bin/apachectl-k start'>/etc/rc. d/rc. local
Php installation:
Dependency package:
1. mcrypt 2. libmcrypt 3. mhash 4. libxml2
The three packages 1, 2, and 3 are used to install phpmyadmin. The package 4 must be installed first. Regarding the installation of the mcrypt package, we will discuss the solution in this article: php mcrypt solution.
After the dependency is packaged, the following steps are similar to the previous software installation:
The configuration process requires a large number of parameters:
. /Configure -- prefix =/installation path -- with-mysql =/$ MYSQL_HOME -- with-apxs2 =/$ APACHE_HOME/bin/apxs -- with-mcrypt -- with-mhash -- with-iconv -- enable -mbstring
After the configuration is complete, the integration of php, mysql, and apache is also completed indirectly. You need to replace the $ xx variable with your actual installation directory.
After installing php, you need to add resolution support for php files in apache:
Modify httpd. cnf of apache
Search for the AddType keyword in vi, and add some code in another line:
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps