The first two days of trouble two of the owner of the Linux server upgrade is now all completed, here, the upgraded documents are shared to everyone _php tutorial

Source: Internet
Author: User
Tags configuration php unpack
Linux Server Upgrade Step one. Detection of MySQL, Apache, PHP installation mode: This part of the main purpose is to understand the MySQL, Apache, PHP installation mode, so as to choose how to delete the previous version. 1. MySQL: # rpm–q mysql package MySQL was not installed. The results show that MySQL is not installed in RPM packages but is installed in a binary package. 2. Apache: # rpm–q Apache apache-1.3.12-2 The results show that Apache is installed in RPM packages and the version is 1.3.12-2. 3. PHP: # rpm–q PHP php-3.0.15-2 The results show that PHP is installed in RPM package and the version is 3.0.15-2. Two Backup files on a Linux server: 1. Mysql:export the library file and export all the libraries in the previous MySQL. 2. PHP3: Back up the source files for PHP. 3. Apache: This time because of Linux version of the problem, the new version of Apache, whether it is rpm (Redhat package Management), or binary packages, can not be installed successfully. Without upgrading Apache, only the key httpd.conf files have been modified (this section will be described in detail later). Three Delete the previous version of MySQL, PHP: According to the "two" in the detection of the installation mode, choose a different way to delete. 1. MySQL: Has been detected by the binary package installation, uninstall method, first use "find–name" command to find the path of all MySQL files, and then one by one using "RM–RF file path" command to delete. 2. Apache: Earlier mentioned Apache because of the Linux version of the problem, there is no upgrade. 3. PHP: Because the PHP3 is installed in RPM because it has been detected in "two", just run: # rpm–e php-3.0.15-2 error:removing These package would break dependencies:php is needed by php-imap-3.0.15-2 PHP are needed by php-ldap-3.0.15-2 PHP are needed by php-pqsql-3.0.15-2 PHP are needed by PIR After the anha-qui-0.4.12-1 is running, the errors listed above are displayed.Workaround: First use the Find command to find the path of each package shown above, and then delete one by one, run the command again. Of course, you can also use the rpm command to delete the files individually. # path four of the RM–RF package. Install new version: New version of MySQL and PHP, all in the "/root" directory, respectively, mysql-3.23.46.tar.gz and php-4.0.6.tar.gz tar package. 1. MySQL: (1) # cd/root into the root directory. (2) # TAR–ZXVF mysql-3.23.46.tar.gz will unpack the new version of the TAR package that was previously placed in the root directory of MySQL. (3) # CD mysql-3.23.46 into the directory after unpacking, MySQL. (4) #./configure–prefix=/usr/local/mysql >--with-berkeley-db=./bdb >--with-tcp-port=3306 >-- With-mysqld-user=mysql >--with-charset=gb2312 >--with-extra-charset=latinl configuration Mysql:① installation path; ② supports BDB database type, transaction processing; ③ set the port to 3306 (this part should be noted that if the configuration is not written in this configuration statement, or written as 9999, will cause MySQL will not enter normally.) ) ④ set user; (5) # make compile. (6) # make install. (7) # scripts/mysql_install_db Establish initial database (8) # chown–r Root/usr/local/mysql # chown–r Mysql/usr/local/mysql Set Permissions (9) # A Dduser mysql add MySQL user (ten) # cd/etc/rc.d/init.d # cp/root/mysql-3.23.46/support-files/mysql.server MySQL # chmod +x mys QL Add Execute permissions (one) #/sbin/chkconfig–del MySQL #/sbin/chkconfig–add MySQL run chkconfig, adding MySQL to the system's Startup service Group (12) # Reboot restart Linux Server server # cd/usr/local/mysql/bin #./mysql into MySQL mysql>show databases; +----------+ | Database | +----------+ | MySQL | | Test | +----------+ 2 rows in Set (0.11 sec) shows the libraries that are present in MySQL (mysql>use mysql) Enter the library named MySQL (mysql>grant) on the *. * to a dmin@ '% ' identified by ' 422817 '; Set user, password (+) mysql>quit Bye quit MySQL #./mysql–u root admin–p Enter password: Try to enter MySQL with the user and password you just set up, MySQL installation and testing Success. The next step is to back up the library files before importing (import). The same is also the use of Mysql-front. However, it is important to note that before the import of the library file, the first to create database, and must be the same name as before. 2. Apache: Although the entire Linux server upgrade, the final result is Apache or the original version. But here, still mention the Apache to RPM package installation process: First find the previous Linux6.02 CD, in which the "redhat/rpm" directory, there is a file named apache-1.3.12-2.i386.rpm. Because the Linux server does not have the CDROM, the method takes the same as mentioned earlier, now under Windows to copy the files under this directory, and then through the local area network, copied to the Samba Open directory. (1) # Cp/home/httpd/html/pos/bak/apache-1.3.12-2.i386.rpm/root to copy the RPM package files to the directory "/root" (2) # CD root into the root directory (3) # Rpm–i APACHE-1.3.12-2.I386.RPM Install the apache-1.3.12-2.i386.rpm kit to a Linux server server, the default installation path is:./usr/lib/apache, if the binary package, the path should be:/USR/local/apache. (4) #/ETC/RC.D/INIT.D/HTTPD start run Apache. If the result is as follows, indicates that it can start normally starting Httpd:ok] (5) # PS aux | grep httpd queries the entire system, all the programs that contain the httpd (Apache server), and are executing. Root 1368 0.0 3.4 4560 2196? S 16:31 0:00 httpd Nobody 1371 0.0 3.6 4668 2280? S 16:31 0:00 httpd Nobody 1372 0.0 3.6 4668 2280? S 16:31 0:00 httpd Nobody 1373 0.0 3.6 4668 2280? S 16:31 0:00 httpd ... (6) If Apache is functioning properly, you can browse to the Apache welcome page from the other machine's ie. At this point, Apache Web Server was installed and tested successfully. 3. PHP: (1) #/ETC/RC.D/INIT.D/HTTPD stop First stop Apache (2) # cd/root into the root directory. (3) # TAR–ZXVF php-4.0.6.tar.gz will unpack the PHP4 tar package that was previously placed in the root directory. (4) # CD php-4.0.6 into the unpacked directory after the PHP4. (5) #./CONFIGURE–APXS=/USR/SBIN/APXS >--with-config-file-path=/etc/httpd/conf >--with-mysql=/usr/local/ MySQL >--with-gd >--with-zlib >--with-system-regex >--enable-ftp configuration Php:① If you install APXS to a different path, you must change the/usr/sbin/ Apxs "to point to the path where the Apxs script is located. Usually the binary package, the path is "/usr/local/apache/bin/apxs"; rpm package, the path is "/usr/sbin/apxs". ② PHP is configured as an Apache DSO module. The configuration file will be saved in "/etc/httpd/conf" (along with the Apache configuration file); ③ if it is a RPM packageInstall MySQL, you should change "--with-mysql=/usr/local/mysql" to "--with-mysql" ④ if there is no GD library, please cancel the "--WITH-GD" ⑤ if you want to support the FTP upload function, you need to "--enable-ftp "(6) # make compile. (7) # make install. (8) # Reboot restart Faresever Server five. Configuration: Configuration This part of the main target Apache httpd.conf files, we require the original not upgraded Apache, can parse PHP4, can also parse PHP4. Because the Apache server of the Linux server is packaged in RPM, the httpd.conf file is placed in "/etc/httpd/conf/httpd.conf". The following are the editing modifications made to the configuration file: 1. Locate the file in # LoadModule Php3_module modules/libphp3.so Change it to: # LoadModule php4_module/usr/lib/apache/libphp4.so Function: Change the module of the PHP3 of the previous Apache load to the module of PHP4, followed by the path of the module file. 2. Locate the file] # addmodule mod_php3.c change it to: # addmodule mod_php4.c Effect: Change the module previously added by Apache from PHP3 to PHP4. 3. Locate the file: Port 80, where you added the following statement: DirectoryIndex index.html index.shtml index.cgi index.phtml index.php3 index.php AddType application/x-httpd-php. php3 addtype application/x-httpd-php. php addtype application/x-httpd-php-source. Phps Function: can be not upgraded Apache, can parse PHP3, can also parse PHP4. At this point, the 1.3.12 version of the Apache configuration file "/etc/httpd/conf/httpd.conf" has been modified. Six Errors that may occur in the installation: 1. MySQL: (1) If MySQL installation goes to the front (13), there is an errorThe error does not enter normally. Error Cause: Port set error. Use "netstat-t-l-p" command to view network status, found that there is no MySQL, only a 9999 port is running. Modification method: ① See/USR/LOCAL/MYSQL/BIN/SAFE_MYSQLD, whether there is a behavior mysql_tcp_port=${mysql_tcp_port:-9999}, change it to mysql_tcp_port=${ Mysql_tcp_port:-3306}② Use VI Editor to enter the view and modify. # vi/usr/local/mysql/bin/safe_mysqld③ Restart MySQL #/etc/rc.d/init.d/mysql.server stop #/etc/rc.d/init.d/mysql.server Start (2) connection MySQL error, as long as the opendatabase.php file to 127.0.0.1, you can connect normally. Error reason: Permission issue. Modify the method: Delete the MySQL library in the user table, a host is fareserve.fareexpress.com, and user is empty records. 2. Apache: Previously wanted to install the new version, that is, 1.3.22 Apache, however, either the RPM package, or the binary package will not be installed successfully. Consider the reasons for the Linux version, however. In the end, the previous version of Apache was used, or it was installed with the RPM package, and there was no problem. 3. PHP: The installation was smooth. Just after installation, can not browse in IE fareexpress (PHP3), and Power POS Management (PHP4), and later modified Apache httpd.conf (configuration file), this in the 5th "Configuration" earlier, has been introduced very clearly , which are not repeated here.

http://www.bkjia.com/PHPjc/531803.html www.bkjia.com true http://www.bkjia.com/PHPjc/531803.html techarticle Linux Server Upgrade step one. Detection of MySQL, Apache, PHP installation mode: This part of the main purpose is to understand the MySQL, Apache, PHP installation mode, so choose how to delete ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.