3. web server software combination
Now, we start to configure the components or link components required by the Web server. After Linux is successfully installed and started, the component installation sequence is generally MySQL database, Apache, GD database, PHP, and zendoptimizer.
First download the corresponding installation package. Here I download MySQLSource codeFile. After logging on to the Linux server with the root account, you can install the MySQL database. The installation steps are as follows:
3.1 install mysql-5.0 Database
# Groupadd MySQL # useradd-G MySQL # cd/usr/local/src ** source file storage directory # tar zxvf mysql-max-5.0.21-linux-i686-glibc23.tar # mv mysql-max-5.0.21-linux-i686-glibc23/usr/local/MySQL # cd/usr/ local/MySQL #. scripts/mysql_install_db -- user = MySQL # chown-r root. # chown-r Mysql Data # chgrp-r MySQL. # bin/mysqld_safe -- user = MySQL & enable the MySQL database server to automatically load when the Linux system starts: # cd/usr/local/src # cp support-files/MySQL. server/etc/rc. d/init. d/mysqld # chmod 700/etc/rc. d/init. d/mysqld # chkconfig -- add mysqld # chkconfig -- level 345 mysqld on
3.2 install Apach web server software
# Cd/usr/local/src # tar zxvf httpd-2.2.4.tar.gz # cd httpd-2.2.4 #. /configure -- prefix =/usr/local/Apache # Make # make install # echo "/usr/local/Apache/bin/apachectl start">/etc/rc. local (the service is automatically started when the system starts)
3.3 install the php gd library component
# Cd/usr/local/src # wget-C http://download.discuz.net/gdinstaller.tar.gz # tar xzvf gdinstaller.tar.gz # cd gdinstaller #./install. Sh
3.4 install the PHP 5.2.1 installation package:
# Cd/usr/local/src # wget-C http://download.discuz.net/php-5.1.2.tar.gz # tar xjvf php-5.2.1.tar.gz # cd php-5.2.1 #. /configure -- prefix =/usr/local/Apache/PHP -- with-apxs2 =/usr/local/Apache/bin/apxs \ -- With-zlib-dir -- with-bz2 -- With-Tiff- dir -- With-libxml-dir -- With-Gd \ -- With-FreeType-dir -- With-JPEG-dir -- With-PNG-dir -- With-TTF -- enable-mbstring \-- with-mysql =/usr/local/MySQL -- With-config-file-Path =/etc -- disable-ipv6 \ -- enable-Gd-native-TTF -- enable-FTP -- enable-zip -- enable-LDAP -- enable-mbregex \ -- enable-calendar -- enable-curl -- disable-Debug -- enable-inline-optimization # Make # make install # cp PHP. ini-Dist/etc/PHP. INI: edit the Apache configuration file httpd. conf # vi/etc/httpd. conf
You need to modify the following items:
1. Find the # In Front Of loadmodule php5_module modules/libphp5.so (the comment is removed by default)
Add the following lines to # addtype application/X-gzip. GZ. tgz:
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP-source. PHPs
2. Find directoryindex index.html, add index. php before index.html, and use index. php as the default website file.
3.5 install the zendoptimizer PHP accelerator package
# Cd/usr/local/src # tar xzvf ZendOptimizer-3.0.0-linux-glibc21-i386.tar.gz # cd ZendOptimizer-3.0.0-linux-glibc21-i386 #./install. Sh
* Note: During Zend installation, two text windows will appear. Enter/etc when prompted to enter the php. ini position. In another window, select "no.
After the Linux server is restarted and the MySQL and Apache services are successfully started, enter the IP address of the Linux server in the address bar of the Internet Explorer browser at the client side to display the default Interface of Apache. So far, if there is no error, the installation of the entire web service suite in linxu is basically complete. You can also create a test document on the Linux server to view the entire PHP, Apache, MySQL database, GD library, and zendoptimizer installation.
3.6 check Web Service suite support
# Vi/usr/local/Apache/htdocs/test. php ** create the test. php test document in the default system directory. The content is as follows: <? Phpphpinfo ();?> * Be familiar with the basic commands of the VI text editor. Save the command and exit.
Enter http: // ip/test. php In the client Internet Explorer browser. See information such:
1