First, the preparatory work:
1, the new Installation redhat6.5 system, modify the hostname, modify the network configuration, settings can use the external network, set up user account password;
2, Iptables-f Clear firewall rules, Sevices iptables Save firewall rules;
3, using Xshell 5 for SSH connection;
4. Unable to use Red Hat yum Source to transfer 163yum source to/etc/yum.repo.d/directory using WINSCP
5, edit the Centos6-base-163.repo file, open a yum source switch, specifically configured as follows:
[Email protected] yum.repos.d]# Vi/etc/yum.repos.d/centos6-base-163.repo
[Base]
name=centos-$releasever-base-163.com
baseurl=http://mirrors.163.com/centos/6/os/x86_64/
Enabled=1
Gpgcheck=0
[Updates]
name=centos-$releasever-updates-163.com
baseurl=http://mirrors.163.com/centos/6/updates/x86_64/
Enabled=1
Gpgcheck=0
[Extras]
name=centos-$releasever-extras-163.com
baseurl=http://mirrors.163.com/centos/6/extras/x86_64/
Enabled=1
Gpgcheck=0
[Centosplus]
name=centos-$releasever-plus-163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
release= $releasever &arch= $basearch &repo=centosplus
Gpgcheck=0
Enabled=0
6. Yum Install upload download tool yum install-y Lrzsz
Ii. Start the installation of MySQL
1, download MySQL to/usr/local/src directory, I have downloaded good MySQL
cd/usr/local/src/
Use the RZ command to upload MySQL to the src directory
2, Decompression: TAR-XVF mysql-5.1.72-linux-x86_64-glibc23.tar.gz
3. Move the extracted data to the/usr/local/directory and complete the full name as MySQL
MV Mysql-5.1.72-linux-x86_64-glibc23/usr/local/mysql4, build MySQL user useradd-s/sbin/nologin mysql5, initialize MySQL database cd/usr/ Local/mysql mkdir-p/data/mysql; Chown-r mysql:mysql/data/mysql./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
6. Uninstall the MySQL database that comes with yum remove MySQL
7. Copy the start angle and modify the properties CP Support-files/mysql.server/etc/init.d/mysqld
chmod 755/etc/init.d/mysqld
8. Modify the start angle
Vim/etc/init.d/mysqld
Modifying the Basedir and DataDir directories
Basedir=/usr/local/mysql
Datadir=/data/mysql
Add the startup script to the system service entry and set the boot start to start MySQL
Chkconfig--add mysqld
Chkconfig mysqld on
Service mysqld Start
Use PS aux |grep mysqld to see if MySQL is booting
Third, install Apache
1, download the Apache software and upload to/USR/LOCAL/SRC
2. Extract Apache
Tar zxvf httpd-2.2.16.tar.gz
3. Configuring compilation parameters
CD httpd-2.2.16
./configure--prefix=/usr/local/apache2--with-included-apr--enable-so--enable-deflate=shared--enable-expires= Shared--enable-rewrite=shared--with-pcre use echo $? To see if a return value of 0 is 0 is a successful compilation
4. Compile make using echo $? To see if the compilation was successful
5, install make install use echo $? To see if the installation was successful
6. Use the-t parameter to see if the Apache configuration file is correct
/USR/LOCAL/APACHE2/BIN/APACHECTL-T return value OK configure positive solution
7. Starting Apache/usr/local/apache2/bin/apachectl Start
Iv. Installation of PHP
1. Download the php file and upload it to the SRC directory
2. Configuring compilation parameters
CD php-5.4.36
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-config-file-path=/usr/local/ Php/etc--with-mysql=/usr/local/mysql--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir--with-freetype-dir --with-iconv-dir--with-zlib-dir--with-bz2--with-openssl--with-mcrypt--enable-soap--enable-gd-native-ttf-- Enable-mbstring--enable-sockets--enable-exif--disable-ipv6
3, because the lack of required library file compilation parameters are not successful prompt: Mcrypt.h not found. Please reinstall Libmcrypt
Download Libmcrypt RPM installation package installation
RPM-IVH libmcrypt-2.5.8-9.el6.x86_64.rpm libmcrypt-devel-2.5.8-9.el6.x86_64.rpm
Reconfigure the compilation file to indicate that the configuration was successful when the following results occur:
Generating files
Configure:creating./config.status
Creating MAIN/INTERNAL_FUNCTIONS.C
Creating MAIN/INTERNAL_FUNCTIONS_CLI.C
+--------------------------------------------------------------------+
| License: |
| This software was subject to the PHP License, available in this |
| Distribution in the file LICENSE. By continuing this installation |
| Process, you is bound by the terms of this License agreement. |
| If you don't agree with the terms of this license, you must abort |
| The installation process at this point. |
+--------------------------------------------------------------------+
Thank for using PHP.
Config.status:creating Php5.spec
Config.status:creating Main/build-defs.h
Config.status:creating scripts/phpize
Config.status:creating scripts/man1/phpize.1
Config.status:creating Scripts/php-config
Config.status:creating Scripts/man1/php-config.1
Config.status:creating SAPI/CLI/PHP.1
Config.status:creating SAPI/CGI/PHP-CGI.1
Config.status:creating Ext/phar/phar.1
Config.status:creating Ext/phar/phar.phar.1
Config.status:creating main/php_config.h
config.status:executing default Commands
You can also use the echo $? To see if the success
4, compile make compile to complete will have the following prompt,
Build complete.
Don ' t forget to run ' make test '.
5, install make install use echo $? View return value of 0 installation succeeded
6. Copy configuration file CP Php.ini-production/usr/local/php/etc/php.ini
6. Edit Apache Master config file to make Apache combine PHP
Vim/usr/local/apache2/conf/httpd.conf
Locate the line AddType application/x-gzip. gz. tgz add a line below
AddType application/x-httpd-php. php
Locate the row <ifmodule dir_module>
Modify the character below the line identifier
DirectoryIndex index.html index.htm index.php
Found it
#ServerName www.example.com:80
Modified to ServerName localhost:80
This article is from the "愺 Burgundy pounding his 豩" blog, please be sure to keep this source http://riverxyz.blog.51cto.com/533303/1782426
Linux Lamp Learning Notes