*********************************************************** *****************************
Install MySQL first
*********************************************************** *****************************
Shell> GroupAdd MySQL
Shell> UserAdd -g mysql mysql
Shell> gunzip Shell> cd mysql-version Shell> ./configure --prefix = / usr / local / mysql Shell> Make Shell> make install Shell> CP Support-files / my-medium.cnf /etc/my.cnf Shell> CD / USR / local / mysql Shell> bin / mysql_install_db Shell> chown -r root. Shell> chown -r mysql var Shell> chgrp -r mysql. Shell> bin / mysqld_safe --user = mysql & *********************************************************** ***************************** Install PHP and Apache *********************************************************** ***************************** 1. gzip -d httpd-2_0_nn.tar.gz 2. TAR XVF httpd-2_0_nn.tar 3. Gunzip php-nn.tar.gz 4. Tar-xvf php-nn.tar 5. CD httpd-2_0_nn 6. ./configure --enable-so 7. make 8. make install Now you have installed apache 2.0.nn in / usr / local / apache. This installation supports loading module And standard MPM Prefork. After that, start the Apache server using the following command: / usr / local / apache2 / bin / apachectl start If successful, you can stop the Apache server and continue to install PHP: / usr / local / apache2 / bin / apachectl stop. 9. cd ../php4-nn 10. Now we need to configure PHP. Here you can use a wide variety of parameters from defining phps, such as startup Some extension function packages, etc. Use the ./configure --help command to list all currently available number. In our example, we will give a configuration on Apache 2 supported by MySQL. example. The path of your local APXS may be different, in fact, in your system, it may be named APXS2. ./configure --with-apxs2 = / usr / local / apache2 / bin / apxs 11. make 12. make install If you decide to change the configuration option after installation, you only need to repeat the last three steps, then you need to restart Apache enables new modules to take effect. No need to recompile. Note that unless prompted, the 'make install' command will install PEAR, various PHP tools Such as PHPize, installing PHP CLI, and more. 13. Configure php.ini CP php.ini-dist /usr/local/lib/php.ini You can edit the php.ini file to modify the PHP option. If you want to put this file in another location, You need to add -with-config-file-path = / path options at step 10. If you choose PHP.INI-Recommended, be sure to read the list of changes, they will affect PHP execution. 14. Edit the httpd.conf file to call the PHP module. The path to the right side of the Loadmolude must point to you. PHP in the system. The above Make Install commands may have already finished these, but must be checked. For PHP 4: LoadModule PHP4_Module Modules / Libphp4.so For PHP 5: LoadModule PHP5_MODULE MODULES / LIBPHP5.SO 15. Inform Apache to resolve specific extensions into PHP, for example, we let Apache will extends .php Analysis into PHP. You can specify any extensions as PHP and simply add them, each with space separation. For example, we have to add .phtml: AddType Application / X-httpd-php .php .phtml Often, we also set the .phps extension to display the highlighted PHP source file, which can be done: AddType Application / X-httpd-php-source .phps 16. Start your Apache server: / usr / local / apache2 / bin / apachectl start By the steps above you can make the PHP as the SAPI module. Of course, Apache and There are still many configuration options, you can use ./configure --help in the corresponding source code directory. More information. If you want to compile a multi-threaded version of Apache 2.0, you must overwrite the standard MPM-Module Prefork, or Worker or Perchild. In this way, you need to use on the sixth step. --with-mpm = worker or --with-mpm = perchild option. You need to know what you are doing. more For more information, please refer to the part of the MPM-modules in the Apache document.