LAMP installation process in detail

To install OpenSSL follows:

(1) Source code: http://www.openssl.org/source/

openssl-0.9.8.tar.gz

(2) decompression software tar -zxvf openssl-0.9.8.tar.gz

(3) into the source code directory: cd openssl-0.9.8

(4) Configuring the Compile Options: ./ config --prefix = / usr / local / openssl --shared - shared meaning is to create a shared library file, if not, generate only static library files at compile time.

(5) Compile: makemake test # test

(6) After the installation make install execution files related to the copy of the / usr / local / openssl corresponding directory.

 After installing the OpenSSL, then you can install the Apache, Apache installation steps are as follows:

(1) obtain the source code to create software for storage directory: mkdir / root / software to http://www.apache.org/ download the latest stable version of the source code.

httpd-2.0.59.tar.bz2

(2) extract the package tar -jxvf httpd-2.0.59.tar.bz2cd httpd-2.0.59

(3) configured Apache compiler options are modular server, the core server contains only the most commonly used modules, and extensions provided by other modules. During setup, you must specify the module needs to include. Apache module has a list of documents for future reference, in which the state is "Base" module will be included into the core server by default, if you do not include a module (such as mod_userdir), you must explicitly disable it; other state modules (such as mod_expires), it must be explicitly enabled in order to include into the core server. Apache module used in two methods, one of which is included into the permanent core; if the operating system supports dynamic shared objects (the DSO), and can be detected as autoconf, the module may also be dynamically compiled. DSO memory module is independent of the core, the core can be used by the run-time module configuration provided by the instructions mod_so included or excluded. If the compiler contains any dynamic module, the module mod_so will be automatically included into the core. If you want the core can be loaded DSO, without actually compiling any dynamic modules, you need to explicitly --enable-so. In our e-commerce website, under normal circumstances, we are all enabled core module function; in addition, we also enable SSL encryption (mod_ssl); in order to make it easier for search engines included in our pages need to be dynamic pages URL rewriting is a static page URL, you need mod_rewrite; dynamically added to the next module without recompiling apache (such as adding PHP support), you need to enable mod_so. Based on the above analysis, when I compile configuration options, recommended the following options: ./ configure --prefix = / usr / local / apache2 --with-ssl = / usr / local / openssl - enable-ssl --enable different situations -so --enable-rewrite --enable-mime-magic --enable-mem-cache for each project and site, if it needs the support of other modules, use the appropriate option at compile time.

(4) compile and install make && make instal

l from source mounting the PHP the PHP is an embedded HTML scripting language interpreted by the server. It can be used to manage dynamic content, support database, handling session tracking, and even build entire e-commerce sites. It supports many popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix and Microsoft SQLServer. For PHP supports these functions you need to install the appropriate software before installing, for example, to make the PHP support MySQL database, PHP before compiling, you must first install the MySQL database.

 

Step One: Download mysql-5.0.67.tar.gz

Step Two: mysql-5.0.67 Installation
 <1> 5.0.67.tar.gz-decompression MySQL
    # MySQL xzvf the tar-5.0.67.tar.gz
 <2> Create installation directory
    # mkdir / usr / local / MySQL
 < 3> installation configuration
    # cd mysql-5.0.67 ← modify executable
    # ./configure --prefix = / usr / local / mysql --localstatedir = / var / lib / mysql --with-comment = Source --with -server-suffix = -Community --with-mysqld -user = mysql --without-debug --with-big-tables --with-charset = utf8 --with-extra-charsets = all --with-pthread - -enable-static --enable-thread-safe -client --with-client-ldflags = -all-static --with-mysqld-ldflags = -all-static --enable-assembler --without-innodb --without -ndb-debug 
 Note: after successful configuration will prompt
  MySQL has A Web Site AT
  http://www.mysql.com/
  Which Carries the Details ON at the
     latest release, upcoming features, and other information to make your
     work or play with MySQL more productive. There you can also find
     information about mailing lists for MySQL discussion.
     Remember to check the platform specific part of the reference manual for
     hints about installing MySQL on your platform. Also have a look at the
     files in the Docs directory.
     Thank you for choosing MySQL!


Step Three: compiler · Installation
 <1> # make ← As the installation configuration done a lot of optimization, so the process is relatively long, please be patient
 <2> # make install
Step Four: post-installation configuration
 # useradd mysql ← add mysql user
 # CD / usr / local / MySQL
 # bin / MySQL the mysql_install_db --user =
 # -R & lt chown the root:. MySQL ← set permissions, note that there is a back. ""
 # chown -R & lt MySQL / var / lib / MySQL disposed ← mysql directory permissions
 # chgrp -R mysql. ← Note followed by a "."
 # CP Share / mysql / My-huge.cnf /etc/my.cnf
 # CP Share / mysql / /etc/rc.d/ the mysql.server init.d / mysqld ← boot automatically starts mysql.
 Chmod 755 /etc/rc.d/init.d/mysqld #
 # chkconfig --add mysqld
 # /etc/rc.d/init.d/mysqld Start ← start MySQL
 # bin / mysqladmin -u root password 123456
 # Service mysqld stop ← shut down MySQL
Step Six: Run Method
 # cd / usr / local / MySQL / bin
 # ./mysql-uroot--p123456

 

 After installing Apache and MySQL, you can begin the installation of PHP. To install PHP as follows:

(1) obtain the source code to create a directory to store software: http://www.php.net/ Download the latest stable version of the source code

php-5.1.4.tar.bz2

(2) extracting tar -jxvf php-5.1.4.tar.bz2cd php-5.1.4

(3) Configure compiler options have already mentioned, I plan to use MySQL to store data, it must be named MySQL data support (--with-mysql), and named MySQL installation location data; if you need to process XML data, you need - wiht-xml and -with-dom; if you need to use PHP script to generate images, use the --with-gd. In short, if you want to use the function library file is not in the system path must be clear support, if not explicitly supported, then the automatic configuration script for processing. Collective need to use what function, depending on the function in most cases the use of PHP script site, need to configure the compilation options: ./ configure --prefix = / usr / local / php - with-apxs2 = / usr / local / apache2 / bin / apxs --with-mysql = / usr / local / mysql - with-mysql-sock = / usr / local / mysql / tmp / mysql.sock --with-xml --with-dom- -with-mcrypt --with-iconv --with-gd --with-mime-magic - with-openssl = / usr / local / openssl --enable-ftp

Wherein --with-apxs2 = / usr / local / apache2 / bin / apxs action options are: modify APACHE installation configuration file, added PHP module while the module is copied to the next directory module in the apache.

(4) compile and install makemake install

(5) copies php profile cp php.ini-dist /usr/local/php/php/php.ini use --with-config-file-path = [dir] when compiling php to clearly indicate the configuration file storage location, then copied to the specified location, otherwise copy to: the installation directory / usr / local / php / test whether the successful installation to be tested, vi /usr/local/apache2/conf/httpd.conf:

(1) modified DocumentRoot, the value of the storage location specified web page DocumentRoot "/ web"

(2) ensure that the file already exists and enable the following line LoadModule php5_module modules / libphp5.so

(3) Add the following line in the file: AddType application / x-httpd-php .php purpose is to enable php extension file name will use the program to parse PHP.

(4) create a test file /web/vfast.php, which reads as follows: <? Phpphpinfo ();?>

(5) start apache service: / usr / local / apache2 / bin / apachectl start

(6) just visit a page in a browser, for example: HTTP: //localhost/test.php if the relevant information php returns successfully, the installation was successful. 

 

Reproduced in: https: //www.cnblogs.com/lvsong/archive/2010/07/14/1777417.html

Guess you like

Origin blog.csdn.net/weixin_34209406/article/details/92959283