My LAMP Process

Source: Internet
Author: User
My LAMP process-Linux Enterprise Application-Linux server application information. The following is a detailed description. Apache + mysql + php supports the GD library


Apache source code
Http://httpd.apache.org/download.cgi
Mysql
Http://www.mysql.com
Php
Http://www.php.net
GD File
Ftp://ftp.sunfreeware.com/pub/

Install the GCC coding environment. When I install the system, I select the compiling environment for development.


1. Install the apache service Compiler

Tar-zxvf httpd-2.2.11.tar.gz-C/usr/local/src
Cd/usr/local/src/httpd-2.2.11
./Configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite
# -- Prefix installation path -- enable-so dynamic module loading -- enable-rewrite enable writable
Make
Make install
2. Install Mysql (I am using rpm, because the source code installation is prone to errors)
Source code Installation
Decompress the package and enter the directory. /configure -- with-mysqld-user = mysql -- prefix =/usr/local/mysql -- with-openssl -- # with-extra-charset = all -- with-isam -- exec-prefix =/usr/local/mysql
-- With-mysqld-user Logon user -- prefix installation path -- with-openssl encryption algorithm -- with-extra-charset character type -- with-isam -- exec-prefix execution file path
Make
(The following error occurs at this step ")
Make [3]: Leaving directory '/usr/local/src/mysql-5.1.32/server-tools/instance-manager'
Make [3]: Leaving directory '/usr/local/src/mysql-5.1.32/server-tools'
Make [3]: Nothing to be done for 'all-am'. Or 'all '.
Make [3]: Leaving directory '/usr/local/src/mysql-5.1.32/server-tools'
Make [2]: Leaving directory '/usr/local/src/mysql-5.1.32/server-tools'
Make [1]: Leaving directory '/usr/local/src/mysql-5.1.32'
Search a lot of information on the Internet, have not solved the problem, my QQ: 641253551 www.ludyhhm@sina.com

Install with rpm
MySQL-client-community-5.1.33-0.rhel5.i386.rpm
MySQL-devel-community-5.1.33-0.rhel5.i386.rpm
MySQL-server-community-5.1.33-0.rhel5.i386.rpm
Create a mysql user
Groupadd mysql
Useradd-g mysql

Rpm-ivh MySQL-client-community-5.1.33-0.rhel5.i386.rpm
Rpm-ivh MySQL-devel-community-5.1.33-0.rhel5.i386.rpm
Rpm-ivh MySQL-server-community-5.1.33-0.rhel5.i386.rpm
Find-name mysql
./Home/mysql \ mysql home directory
./Var/lock/subsys/mysql \\
./Var/lib/mysql \ contains the error log and id, database, mysql Library File
./Var/lib/mysql \ mysql Library File
./Etc/rc. d/init. d/mysql \ mysql Startup Script
./Etc/logrotate. d/mysql \ mysql Log script
./Usr/bin/mysql \ mysql Tool
./Usr/share/mysql \ mysql header file, which must be pointed to here when compiling ghost php
./Usr/lib/mysql \ mysql Library File
./Usr/include/mysql \ mysql configuration files

Grant mysql permissions to the directory

Cd/usr/bin
./Mysql_install_db \ this command is an initialization script to prepare for mysql running: to create a mysql license table.

./Mysqld_safe -- user = mysql & \ Start the mysql server
Or use service mysql start \ to start the mysql server
Service mysql stop \ shut down the mysql server
Service mysql status \ view the running status of mysql

By default, mysql has a root user with a blank password.
/Usr/bin/mysqladmin password 1234
/Usr/local/mysql/bin/mysql-u root-p 1234

Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 26
Server version: 5.1.33-community-log MySQL Community Server (GPL)

Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.

Mysql> \ login successful
Mysql> show databases; \ view database
+ -------------------- +
| Database |
+ -------------------- +
| Information_schema |
| Mysql |
| Test |
+ -------------------- +
3 rows in set (0.06 sec)


Install zlib
Tar-zxvf zlib-1.2.3.tar.gz-C/usr/local/src
Cd/usr/local/src/zlib-1.2.3
./Configure -- prefix =/usr/local/zlib
Make
Make install
Install jpeg
Tar-zxvf jpeg-6b.tar.gz-C/usr/local/src
Mkdir/usr/local/limit 6
Mkdir/usr/local/partition 6/bin
Mkdir/usr/local/IPv6/lib
Mkdir/usr/local/users 6/include
Mkdir/usr/local/Example 6/man
Mkdir/usr/local/IPv6/man1
Mkdir/usr/local/users 6/man/man1

Cd/usr/local/src/jpeg-6b
./Configure -- prefix =/usr/local/Issue 6
Make
Make install
Install libpng
Tar-zxvf libpng-1.2.35.tar.gz-C/usr/local/src
Cd/usr/local/src/libpng-1.2.35
./Configure -- prefix =/usr/local/libpng
Make
Make install
Install freetype
Tar-zxvf freetype-2.3.2.tar.gz-C/usr/local/src
Cd/usr/local/src/freetype-2.3.2
Make
Make install
Install gd
Tar-zxvf gd-2.0.35.tar.gz-C/usr/local/src
Cd/usr/local/src/gd-2.0.35
. /Configure -- prefix =/usr/local/gd2 -- with-jpeg =/usr/local/defaults 6 -- with-png =/usr/local/libpng -- with-zlib =/usr /local/lib -- with-freetype =/usr/local/freetype
Make
Make install
Install php
Tar-xjvf php-5.2.9.tar.bz2-C/usr/local/src
Cd/usr/local/src/php-5.2.9
. /Configure -- prefix = usr/local/php5 -- with-mysql =/usr/share/mysql -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-gd =/ usr/local/gd2 -- with-freetype-dir/usr/local/freetype -- with-jpeg-dir =/usr/local/defaults 6 -- with-png-dir =/usr/ local/libpng -- with-zlib-dir =/usr/local/zlib
Make
Make install


Cp php. ini-dist/usr/local/php5/php. ini

Vi/usr/local/php5/php. ini

Find extension_dir-= "./"
Change to extension_dir-= "./include/php. ext"
Search for extension = php

; Extension = php_bz2.dll
; Extension = php_curl.dll
; Extension = php_dba.dll
; Extension = php_dbase.dll
; Extension = php_exif.dll
; Extension = php_fdf.dll
; Extension = php_gd2.dll
; Extension = php_gettext.dll
; Extension = php_gmp.dll
; Extension = php_ifx.dll
; Extension = php_imap.dll
; Extension = php_interbase.dll
; Extension = php_ldap.dll
; Extension = php_mbstring.dll
; Extension = php_mcrypt.dll
; Extension = php_mhash.dll
; Extension = php_mime_magic.dll
; Extension = php_ming.dll
; Extension = php_msql.dll
; Extension = php_mssql.dll
; Extension = php_mysql.dll
; Extension = php_mysqli.dll
; Extension = php_oci8.dll
; Extension = php_openssl.dll
; Extension = php_pdo.dll
; Extension = php_pdo_firebird.dll
; Extension = php_pdo_mssql.dll
; Extension = php_pdo_mysql.dll
; Extension = php_pdo_oci.dll
; Extension = php_pdo_oci8.dll
; Extension = php_pdo_odbc.dll
; Extension = php_pdo_pgsql.dll
; Extension = php_pdo_sqlite.dll
; Extension = php_pgsql.dll
; Extension = php_pspell.dll
; Extension = php_shmop.dll
; Extension = php_snmp.dll
; Extension = php_soap.dll
; Extension = php_sockets.dll
; Extension = php_sqlite.dll
; Extension = php_sybase_ct.dll
; Extension = php_tidy.dll
; Extension = php_xmlrpc.dll
; Extension = php_cmd.dll
; Extension = php_zip.dll

Put these
Extension = php_mbstring.dll
Extension = php_bz2.dll
Extension = php_gd2.dll
Extension = php_mysql.dll
Extension = php_exif.dll
Extension = php_soap.dll
Extension = php_mcrypt.dll
Extension = php_sockets.dll
Extension = php_mhash.dll
Extension = php_xmlrpc.dll
Extension = php_zip.dll
Remove; or directly add

Modify httpd. conf in Apache configuration file
Cd/usr/local/apache2/conf
Vi httpd. conf
Add
AddType application/x-httpd-php. php
Search for index.html

Add index. php to the end of DirectoryIndex index.html
Save
Create index. php In the htconf directory as follows:
Phpinfo ();
?>

Restart the apache service
The following error may occur:
Httpd: Syntax error on line 53 of/usr/local/apache/conf/httpd. conf: Cannot load/usr/local/apache/modules/libphp5.so into server:/usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
This is caused by a selinux protection mode in linux.
Solution:
Method for disabling selinux
Vi/etc/selinux/config change SELINUX = enforcing to SELINUX = disabled and restart the server.
This method may cause risks to the server.
Search for related information online? There is another way to solve the problem!
Related Article

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.