LAMP installation Configuration

Source: Internet
Author: User

Major software packages,
1. httpd-2.2.6.tar.gz
2. mysql-5.0.45-linux-i686-glibc23.tar.gz (this version is compiled compressed package, Unzip a little configuration can be used)
3. php-5.2.5.tar.gz
Install the required software package for php (libxml2 is required to install php5 .)
1. libxml2-(version).tar.gz ---> http://ftp.gnome.org/pub/GNOME/sources/libxm2
2. libjavast-(version+.tar.gz ---> http://ftp.gnome.org/pub/GNOME/sources/libxslt
3. curl-(version).tar.gz ---> http://curl.haxx.se/download
The software package required for the GD library (some people say that the PHP source package contains GD2.0.28 and zlib. Only three support packages for GD are installed: jpg, png, and freetype, but we still download them)
1. gd-(version).tar.gz ---> http://www.libgd.org/Main_Page or http://www.libgd.org/releases/
2. freetype-(version).tar.gz ---> http://sourceforge.net/projects/freetype
3. Rolling src.v6b.tar.gz ---> http://ijg.org/files/jpegsrc.v6b.tar.gz
4. libpng-(version).tar.gz ---> http://www.libpng.org/pub/png/libpng.html
5. zlib-1.2.3.tar.gz ---> http://www.zlib.net
Download all the above Software packages to the/root/Software/directory.
Ii. Install mysql
# Tar-zvxf mysql-5.0.45-linux-i686-glibc23.tar.gz
# Mkdir-p/usr/local/mysql
# Cp-r mysql-5.0.45/usr/local/mysql
# Cp/usr/local/mysql/support-files/mysql. server/etc/rc. d/init. d/mysql // start mysql
# Cp/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf
Add mysql users and user groups
# Groupadd mysql
# Useradd-g mysql
Modify mysql Directory Permissions
# Chown-R root/usr/local/mysql
# Chgrp-R mysql/usr/local/mysql
# Chown-R mysql/usr/local/mysql/data
Generate mysql System Database
#/Usr/local/mysql/scripts/mysql_install_db -- user = mysql & // start the mysql Service
#/Usr/local/mysql/bin/mysqld_safe -- user = mysql &
If Starting mysqld daemon with databases from/usr/local/mysql/data appears, the mysql service is started normally.
Press Ctrl + C to change the mysql root Password
#/Usr/local/mysql/bin/mysqladmin-u root-p password "123456"
3. Install the GD library (for PHP to support GIF, PNG, and JPEG)
A. Install IIS6 to create a directory:
# Mkdir-p/usr/local/limit 6
# Mkdir-p/usr/local/partition 6/bin
# Mkdir-p/usr/local/release 6/lib
# Mkdir-p/usr/local/users 6/include
# Mkdir-p/usr/local/Example 6/man
# Mkdir-p/usr/local/IPv6/man1
# Mkdir-p/usr/local/users 6/man/man1
# Cd/root/Software/
# Tar-zvxf restart src.v6b.tar.gz
# Cd route 6
#./Configure -- prefix =/usr/local/defaults 6/-- enable-shared -- enable-static
# Make
# Make install
B. libpng package (PNG supported)
# Cd/root/Software/
# Tar-zvxf libpng-(version).tar.gz
# Cd libpng-(version)
#./Configure -- prefix =/usr/local/libpng
# Make
#> Make install
C. Install freetype
# Cd/root/Software/
# Tar-zvxf freetype-(version).tar.gz
# Cd freetype-(version)
# Mkdir-p/usr/local/freetype
#./Configure -- prefix =/usr/local/freetype
# Make
# Make install
D. Install zlib
# Cd/root/Software/
# Tar-zxvf zlib-1.2.3.tar.gz
# Cd zlib.1.2.3
# Mkdir/usr/local/zlib
#./Configure -- prefix =/usr/local/zlib
# Make
# Make install
E. Install the GD library
# Cd/root/Software/
# Tar-zvxf gd-(version).tar.gz
# Mkdir-p/usr/local/gd2
# Cd gd-(version)
#. /Configure -- prefix =/usr/local/gd2 -- with-jpeg =/usr/local/defaults 6 -- with-zlib-dir =/usr/local/zlib -- with-png = /usr/local/libpng -- with-freetype =/usr/local/freetype
# Make
# Make install
E. Install the Curl Library
# Cd/root/Software/
# Tar-zxf curl-(version).tar.gz
# Mkdir-p/usr/local/curl
#./Configure -- prefix =/usr/local/curl
# Make
# Make install
4. Install apache2
# Cd/roo/Software/
# Tar-zvxf httpd-2.2.6.tar.gz
# Cd httpd-2.2.6
# Mkdir-p/usr/local/apache2
#./Configure -- prefix =/usr/local/apache -- enable-modules = so -- enable-rewrite
# Make
# Make install
#/Usr/local/apache2/bin/apachectl-k start // start apahce
Check http: // localhost in the browser and obtain it works, indicating that apache has been configured successfully.
#/Usr/local/apache2/bin/apachectl-k stop // stop apache
5. Install php5. php5 must support libxml2!
A. Install libxml2
# Cd/root/Software/
# Tar-zvxf libxml2-(version).tar.gz
# Cd libxml2-(version)
# Mkdir-p/usr/local/libxml2
#./Configure -- prefix =/usr/local/libxml2
# Make
# Make install
B. Install libxslt (optional)
# Cd/root/Software/
# Tar-zvxf lib+t-(version+.tar.gz
# Mkdir-p/usr/local/libxslt
# Cd libxslt-(version)
#./Configure -- prefix =/usr/local/libxslt -- with-libxml-prefix =/usr/local/libxml2
# Make
# Make install
C. Install php5
# Cd/root/Software/
# Tar-zvxf php-(version).tar.gz
# Mkdir-p/usr/local/php5
# Cd php-(version)
#./Configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache2/bin/apxs \
> -- With-gd =/usr/local/gd2 -- with-jpeg-dir =/usr/local/limit 6 \
> -- With-zlib-dir =/usr/local/zlib \
> -- With-png-dir =/usr/local/libpng \
> -- With-freetype-dir =/usr/local/freetype -\
> -- Enable-trace-vars -- with-mysql =/usr/local/mysql \
> -- Enable-mbstring = all -- with-curl =/usr/local/curl -- enable-mbregex \
> -- With-config-file-path =/usr/local/php5 -- enable-ftp \
> -- Enable-soap -- with-xsl =/usr/local/libxslt
# Make
# Make install
# Cp php. ini-dist/usr/local/php5/php. ini (don't forget it)
6. reconfigure apache2 to support php
# Cd/usr/local/apache2/conf
# Vim httpd. conf
In LoadModule php5_module modules/libphp5.so
Add AddType application/x-httpd-php. php
OK. The basic installation is complete.
Restart APACHE:
#/Usr/local/apache2/bin/apachectl start
If you restart APACHE:
Syntax error on line 232 of/usr/local/apache2/conf/httpd. conf: Cannot load/usr/local/apache2/modules/libphp5.so into server:
/Usr/local/apache2/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied
Follow the steps below to solve the problem:
1. chcon-t texrel_shlib_t/usr/local/apache2/modules/*. so
2. edit/etc/selinux/config and find the following link:
# This file controls the state of SELinux on the system.
# SELINUX = can take one of these three values:
# Enforcing-SELinux security policy is enforced.
# Permissive-SELinux prints warnings instead of enforcing.
# Disabled-SELinux is fully disabled.
SELINUX = enforcing
Comment out SELINUX = enforcing: # SELINUX = enforcing, and add a new line:
SELINUX = disabled
Save and close.
Edit/etc/sysconfig/selinux and find:
# This file controls the state of SELinux on the system.
# SELINUX = can take one of these three values:
# Enforcing-SELinux security policy is enforced.
# Permissive-SELinux prints warnings instead of enforcing.
# Disabled-SELinux is fully disabled.
SELINUX = enforcing
If SELINUX is already set to SELINUX = disabled, you do not need to change it. Otherwise, comment out SELINUX = enforcing and add a new line:
SELINUX = disabled
Save and exit.


From the PainsOnline Column

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.