Download software httpd-2.0.52.tar.gz http://www.apache.orgmysql-4.0.21.tar.gz http://www.mysql.comphp-5.0.2.tar.gz http: // www .php.net download to / Soft / Lamp directory below # TAR zxvf httpd-2.0.52.tar.gz # tar zxvf mysql-4.0.21.tar.gz # tar zxvf php-5.0.2.tar.gz in the root The directory built a / www directory put the program to this directory first installed mysql # groupAdd MySQL // Established mysql user group # useradd -g mysql mysql // Established mysql user # cd/soft/Lamp/Mysql-4.0. 21 # ./configure --prefix = / www / mysql --with-mysqld-user = zzw --with-charset = gb2312 --with-extra-charsets = all --with-unix-socket-path = / TMP /MYSQL.SOCK [Note] One point for the option of Configure: - prefix = / opt / mysql The mysql-4.0.16 is specified in the / opt / mysql directory; - with-charset = GB2312 Specifies mySQL default language For GB2312, Chinese; - with-extra-chars = all supports multi-language support; - with-unix-socket-path = / opt / mysql / var / mysql.sock This is the specified mysql server startup, The location and file name of the online socket file, that is, if the mysql server is successfully launched, you can see the mysql.sock file in the / OPT / MySQL / Var directory. If you can't see it, you can't start my mysql. --with-mysqld-user = beinan This is the MYSQL server can also allow the normal user Beinan in the system to start the MySQL server. Of course, I have to learn to live :) You can also change Beinan to your system already existing users, such as the SIR in your system, then replace Beinan into SIR. The advantage of starting MySQL with ordinary users is: MySQL process will die automatically. Of course, the root user can, but sometimes MySQL has some process dead, but it will not exit automatically, and root can't kill.
So use ordinary users, there is such a benefit, most of the mysql process is dead, but will not quit; # make // Compile # make install // installation # CD / www / mysql / bin # ./mysql_install_db / / Initializing Database # vi ~ / .bashrc Join ExpORT PATH = "$ PATH: / WWW / MySQL / BIN" // Gets the command under mysql / bin to join the startup item # CP / WWW / mysql / share /MYSQL/Mysql.server /etc/rc.d/init.d/mysql // Copy the mysql service startup item # chmod x /etc/rc.d/init.d/mysql // Execute permissions # chown -r Mysql / www / mysql # chown -r mysql /etc/rc.d/init.d/mysql // Give MySQL User Permissions - Note -------------------- ------------------------------------------------ # chGRP -R mysql / www / mysql // Give MySQL user group read / www / mysql permissions # chown -r mysql / www / mysql // read / www / mysql permission -------- ---------------------------------------- # / sbin / chkconfig --del mysql # / sbin / chkconfig --Add mysql // put mysql in the start list to restart Linux to install MySQL if you can't start, try #cd /www/mysql/bin#./mysqld_safe --user = mysql & Second, install Apache2 # cd httpd-2.0.52 # ./configure --prefix = / www / apache --enable-so --enable-shutrite # make #Make Install Compilation installation After that, start Apache #CD /www/apache/bin#./apachectl Start to launch the Apache server three, install php # cd php-5.0.2 #. / Configure --prefix = / www / php --with -mySQL = / www / mysql --with-apxs2 = / www / apache / bin / apxs --enable-track-vars --enable-force-cgi-redirect --with-config-file-path = / www / PHP / etc Description: - prefix = / www / php specifies to install PHP-4.3.4 into the / OPT / PHP directory; - with-mysql = / www / mysql Specifies the location of the mysql data server installation; With-apxs2 = / www / apache / bin / apxs This is where joining Apache is the location of the DSO module; -ENABLE-TRACK-VARS is a Tracker Function, which starts cookie's GET / POST --With-Config-file-path = / WWW / PHP / ETC Specifies the directory of PHP's formulation file to be stored in / www / php / etc directory, after we are installed, copy php.ini to this directory.
# Make # make install copy php.ini-distant for php.ini, and store it in / www / php / etc / directory # cp php.ini-dist / www/php/etc/php.ini Editor / WWW / PHP /etc/php.ini file, find the following line; default_charset = "ISO-8859-1" Add a line below this line DEFAULT_CHARSET = "GB2312" to change register_globals = OFF to register_globals = ON ---------------- -------------------------------------------- MAX_EXECUTION_TIME = 600; the maximum running time of 600 seconds max_input_time = 600; the maximum output of 600 seconds memory_limit = 20M; maximum memory limit 20Mfile_uploads = on; a file upload upload_max_filesize = 20M; maximum file size 20Mpost_max_size = 20M; php acceptable post method size 20Msession.auto_start = 1; session automatically start ------------------------------------------------------------------------------------------------------------------------------------------------ ------ Modify httpd.conf file # vi /www/apache/conf/httpd.conf joined AddType Application / X-httpd-php .PHP AddType Application / X-httpd-php-source .phps AddType Application / X -httpd-php .php3 # modify AddDefaultCharset ISO-8859-1 instead AddDefaultCharset gb2312 # join the default boot file index.php (find DirectoryIndex, amended as follows:) DirectoryIndex index.html index.html.var index.php # designated website Directory (assuming / apache directory) DocumentRoot "/ apache" installation completion # cd / www / apache / bin / apachectl start / re START / STOP Management Apacheapache When starting in Linux, automatic startup method method 1: # vi /etc/rc.local joining / www / apache / bin / apachectl start method 2: # cp / www / apache / bin / apachectl / etc / Rc.d / init.d / httpd # cd /etc/rc.d/rc3.d# ln -s ../init.d/httpd s80httpd method 3:
Self-started script:
/ usr / local / apache2 / bin
The ./apachectl start file is located under /etc/rc.d/init.d, named Apached, pay attention to executive.
#CHMOD X /etc/rc.d/init.d/apached // Setting the properties of the file is executable
#LN -s /etc/rc.d/init.d/apached /etc/rc3.d/s90apache // Set up soft connection, shortcut
#LN -s /etc/rc.d/ininit.d/apached /etc/rc0.d/k20apache
Method 3:
Self-started script:
/ usr / local / apache2 / bin
The ./apachectl start file is located under /etc/rc.d/init.d, named apached, pay attention to executive. # chmod x /etc/rc.d/init.d/apached // Setting the file's properties Executable
#LN -s /etc/rc.d/init.d/apached /etc/rc3.d/s90apache // Set up soft connection, shortcut
#LN -s /etc/rc.d/ininit.d/apached /etc/rc0.d/k20apache