FreeBSD Version: 4.8 RELEASE
MySQL version: Distrib 4.0.13 Source code installation
Apache version: 2.0.47
PHP version: 4.3.2
One. Install mysql
1. PW addgroup mysql -g 3389 (add users and groups used to run mysql)
2. PW adduser mysql -u 3389 -g mysql
3. TAR ZXVF MYSQL-4.0.13.tar.gz
4. CD MYSQL-4.0.13
5. ./Configure --prefix = / usr / local / mysql (Specify MYSQL installation path)
6. Make; Make Install
7. CD / USR / local / mysql / bin ./mysql_install_db (basic database of MySQL is established in VAR)
8. Chown -r root: mysql / usr / local / mysql (changing file host attribute)
9. Chown -r mysql / usr / local / mysql / var
10. BIN / mysqld_safe --user = mysql & (start MySQLD as MySQL)
11. BIN / mysqladmin -u root password 'mypasswd' (Change the ROOT password of MySQL)
12. Restart mysqld
Step 8, 9. Important, otherwise the 10th step cannot be started, view the var / hostname.err log, there will be the following error tips:
Fatal Error: can't open file: './mysql/host.frm' (errno: 13)
two. Install Apache
1. TAR ZXVF httpd-2.0.47.tar.gz
2. CD httpd-2.0.47
3. ./Configure --prefix = / usr / local / apache2 --ENABLE-SO (Activated Dynamic Load Module)
4. Make; Make Install
5. CD / usr / local / apache2 / conf
6. / Usr / local / apache2 / bin / apachectl start
7. After the Apache is installed, adjust the conf / httpd.conf configuration file, the modified place is as follows:
1) Timeout 300 ---> Timeout 1202) MaxKeepAliveRequests 2563) ServerSignature on ---> ServerSignature off4) Options Indexes FollowSymLinks line to indexes deleted (Options directories do not bring index options) 5) DirectoryIndex index.html index.html. VAR later coupled with index.php (or add index.htm, etc.) 6) Change the user and group of Apache to Nobody7) to support the MaxClients 150 -> MaxClients 1500 in the Worker MPM field to support high load Apache, Changes or add the following parameters in the core of FreeBSD: 1) MAXUSERS 512 (CD) 2) Options NMBClusters = 65536 (new) 3) Options kva_pages = 512 (new, must increase, otherwise Apache pressure test)
three. Install PHP
1. TAR ZXVF PHP-4.3.2.tar.gz
2. CD PHP-4.3.2
3. ./configure --prefix = / usr / local / php4 --with-apxs2 = / usr / local / apache2 / bin / apxs /
--with-mysql = / usr / local / mysql --with-config-file-path = / usr / local / php4
The first option specifies the path to the PHP4 installation. The second option opens support for Apache, the third option specifies the mysql installation path, the fourth option specifies the storage path of the configuration file.
4. make; make install
5. CP PHP-4.3.2 / php.ini-dist / usr / local / php4 copy the configuration file to the front scales
6. vi /usr/local/apache2/conf/httpd.conf
LoadModule PHP4_Module Modules / Libphp4.so (this is automatically added after the PHP is installed)
AddType Application / X-httpd-php .php (this manual added)
7. Restart Apache
8. CD / usr / local / apache2 / htdocs
Vi Test.php Edit a test file
PHPINFO ();
?>
9. Enter http: //addr/test.php in the browser will display the successful configuration page of the PHP.