Build postfix mail server (a) lamp platform installation

Before installing postfix way we use to compile the source code to build the LAMP platform.
L: represents linux system
A: apache, web server, later we will use to send and receive e-mail webmail
M: mysql database, the virtual user postfix, mysql use to store user virtual
P: php and Perl, to send and receive messages webmail , and extmail mail management
a, Linux
1.linux: RHEL5.3, some basic packages installed
two, apache installation
1. Download Quguan network 2.2.14.tar.gz httpd- ( HTTP: //httpd.apache .org / download.cgi)
2. extracting
the tar zxvf the httpd-2.2.14.tar.gz 3. directory files are decompressed 4. configuration options (// followed by its Notes)
 


./configure -prefix = / usr / local / apache2 // apache designated installation position
-enable-so // function using dynamically loaded modules
-enable-rewrite // Rewrite feature has a network address rewrite
-enable-ssl // have ssl function
-with-ssl = / usr / lib // // ssl specified location
-enable-auth-digest // Apache can digest authentication (digest)
-enable // CGI-CGI support
-enable-suexec // suEXEC support
-with-suexec-caller = daemon // UID Apache runtime used. This is the only user allowed to execute a program
-with-suexec-docroot = / usr / local / apache2 / htdocs // suEXEC processor document root
4. Compile the make
5. The mounting make install
three, MySQL
1. HTTP: // dev.mysql.com/downloads/mysql/5.1.html on this page to download the source package (Source) mysql5.1.43
remember source package is not installed the package
2. create mysql database allows users
useradd -M -s / sbin / nologin MySQL
3.tar zxvf mysql.5.1.43
4. ./configure -prefix = / usr / local / mysql // specify the installation location
5.make
6.make the install
7. The Profiling
directory with a support-files in the extracted directory, there are sample configuration file for different database server load, usually choose my-medium.cnf, medium load sufficient for most enterprises
cp Support-Files / My-medium.cnf /etc/my.cnf
8. initialize the database: mysql performed with the user's identity mysql_install_db script,
/ usr / local / mysql / bin / mysql_install_db -user = mysql
9. the modified rights associated directory initialized to be read mysql
chown -R & lt the root: mysql / usr / local / mysql /
chown -R & lt mysql / usr / local / mysql / var /
10. the library path adjustment lib: non-standard due to the installation path of the library file path to mysql "/ usr / local / mysql / lib / mysql" Add library search path to system by modifying the "/etc/ld.so.conf"
to achieve
1) echo "/ usr / local / MySQL / lib / MySQL" >> /etc/ld.so.conf
2) ldconfig // refresh the library search path, is the change to take effect
11. start
1) run the script with mysyld_safe security service background to start
/ usr / local / mysql / bin / mysqld_safe -user = mysql &
2) Add the mysqld as a system service ① the mysql source package support-files folder "mysql.server" As a startup script mysqld services, copy to "/etc/init.d" directory to
cp Support-Files / mysql.server /etc/init.d/mysqld
② add execution right, otherwise "service mysqld sttart" error "mysqld: out with unrecognized Service"
chmod the X-+ /etc/init.d/mysqld
③ added at startup
the chkconfig -add mysqld
the chkconfig mysqld oN
later on with service mysqld start / stop started
3) disposed mysql program execution path, this step must be, otherwise when installing the software later, not succeed
to re-execute the mysql command and scripts are easy to enter, can modify the pATH environment variable, add the execution path "/ usr / local / mysql / bin", and to love you a set of definitions related to the system of "/ etc / profile "file to
. 1) Export the PATH = $ the PATH: / usr / local / mysql / bin /
2) echo" the PATH = $ the PATH: / usr / local / mysql / bin / ">> / etc / Profile
12 is to mysql root user password
mysqladmin -u root password "123456"
13. The access to the database
Mysql -u root -p
three PHP
1. extracting php5.3.1
2. into the directory, configuration (and followed // Note)
position ./configure -prefix = / usr / local / php5 // installed
-enable-mbstring // php multi-byte string
-with-apxs2 = / usr / local / apache2 / bin / apxs // apxs position apache server module provided
-with-mysql = / usr / local / mysql / / / msyql position
-with-config-file-path = / usr / local / php5 // php location profile
3.make
4.Make the install
5. the copy configuration files (in the source directory)
Cp-the php.ini Development /usr/local/php5/lib/php.ini
6. the document provided httpd.conf
. 1)
①Vi /usr/local/apache2/conf/httpd.conf
② php5_moudles find the LoadModule / libphp5.so
③ below adding AddTyep application / x -httpd-php .php

2)
① Find index.html DirectoryIndex
② add index.php behind
DirectoryIndex index.html index.php
7 Test
1) Test PHP
Vi /usr/local/apache2/htdocs/test.php
input

123
<?phpphpinfo();?>

Enter 127.0.0.1/test.php in your browser
to see some information on the representation php PHP installation was successful
2) test MYSQL
Vi /usr/local/apache2/htdocs/test2.php
input

123456
<?php$link=mysql_connect (‘localhost’,’test’,’’);If(!$link) echo “fail !!;Else echo “success !!;Mysql_close();?>

Enter in your browser 127.0.0.1/test.php
If the success! ! Mysql connection represents normal
if fail to display! ! Indicates that the connection in question

 

This switched http://blog.thematice.com  Author: porridge country

Reproduced in: https: //www.cnblogs.com/lvsong/archive/2010/07/30/1788850.html

Guess you like

Origin blog.csdn.net/weixin_34088838/article/details/92959346