Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration of Apache+PHP+MySQL server under RedHat9.0

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the installation and configuration of Apache+PHP+MySQL server under RedHat9.0". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the installation and configuration of Apache+PHP+MySQL server under RedHat9.0".

I. installation environment

Operating system: Linux RedHat 9.0

Web service software: Apache httpd-2.2.3.tar.gz

Database software: MySQL-server-5.0.26-0.i386.rpm (server)

MySQL-client-5.0.26-0.i386.rpm (client)

MySQL-devel-5.0.26-0.i386.rpm (development kit)

MySQL-shared-5.0.26-0.i386.rpm (shared library)

PHP scripting language: php-5.1.2.tar.gz

Graphics library files: JPEG:jpegsrc.v6b.tar.gz

FreeType:freetype-2.2.1.tar.gz (font)

ZLIB:zlib-1.2.3.tar.gz

PNG:libpng-1.2.12.tar.gz

GD:gd-2.6.26.tar.gz

Optimizer: ZendOptimizer-3.0.2-linux-glibc21-i386.tar.gz

Second, installation sequence

1. Install MySQL database

2. Install the Apache Web server

3. Install GD graphics library and XML

4. Install PHP5 and modify Apache configuration file

5. Install the Zend optimizer

III. Installation process

1. Install the MySQL database. I installed the RPM package, and MySQL officially synchronized RPM and tar files very well. Let's also talk about the way it is compiled.

# rpm-Uvh MySQL-server-5.0.26-0.i386.rpm # rpm-Uvh MySQL-client-5.0.26-0.i386.rpm # rpm-Uvh MySQL-shared-5.0.26-0.i386.rpm # rpm-Uvh MySQL-devel-5.0.26-0.i386.rpm launch service

# services mysql start or

# / etc/rc.d/init.d/mysql start or

# / etc/rc.d/init.d/mysqld_safe& shuts down service

# services mysql stop or

# / etc/rc.d/init.d/mysql stop is installed in RPM mode, and mysql will be started automatically when the system starts, so we don't need to set it manually.

Note: the installation method of upgrading RPM package is used here, but sometimes there are "file conflicts" or "unresolved dependencies" because the old version of MySQL was installed in the previous system and can be uninstalled first. Or use-replacefiles in the installation command to resolve file conflicts and-nodeps to resolve unresolved dependencies.

Adopt the mode of compilation and installation (recommended)

# groupadd mysql # useradd mysql # tar xzvf mysql-NN.tar.gz (or tar xjvf mysql-NN.tar.bz2) (NN represents version number) # mv mysql-NN / usr/local/src # cd / usr/local/src/mysql-NN #. / configure-- prefix=/usr/local/mysql # make # make install # scripts/mysql_install_db # chown-R root:mysql / usr/local/mysql # chown-R mysql:mysql / usr/local/mysql/var (in mysql group Add mysql users in) # chgrp-R mysql/ usr/local/mysql # cp support-files/my-medium.cnf / etc/my.cnf # cp / usr/local/mysql/share/mysql/mysql.server\ > / usr/local/mysql/share/mysql/mysqld # chmod astatx / usr/local/mysql/share/mysql/mysqld startup service

# / usr/local/mysql/bin/safe_mysqld-user=mysql or

# / usr/local/mysql/share/mysql/mysqld start stops service

# / usr/local/mysql/bin/mysqladmin shutdown is set to boot and add a line to the / etc/rc.d/rc.local file

/ usr/local/mysql/share/mysql/mysqld start so that every time the system is rebooted, mysql will also start with the system.

2. Install Apache

# tar xzvf httpd-2.2.3.tar.gz # mv httpd-2.2.3 / usr/local/src # cd / usr/local/src/httpd-2.2.3 #. / configure-- prefix=/usr/local/apache2\ (installation directory) >-- enable-so\ (support DSO dynamic module function) >-- enable-mods-shared=all\ (including all modules are DSO) if you need more options, you may use the following command to view (. / configure-- help) # make # make install startup service

# / usr/local/apache2/apachectl start will appear "httpd: Could not determine the server's fully qualified domain..." Mistake. Modify the configuration file / usr/local/apache2/conf/httpd.conf. Find the ServerName entry, remove the previous #, change the domain name to an IP address, and don't change it if you have a domain name. Enter the IP address in the web browser, and if "It Works!" appears It means that you have installed it and can run normally.

Set it to boot and add a line to the / etc/rc.d/rc.local file

/ usr/local/apache2/bin/apachectl start so that every time the system is rebooted, apache will also start with the system.

Note: if your system has installed the web service, then retain the use, if you want to use a new version of apache, be sure to uninstall the original installation, otherwise there will be errors, such as unable to load modules, blurred files and so on.

3. Install the support package and GD library (pay attention to the installation sequence)

As above, extract the file and move it to the / usr/local/src directory.

Install jpeg

# tar xzvf jpegsrc.v6b.tar.gz # mv jpeg-6b / usr/local/src # cd / usr/local/src/jpeg-6b #. / configure-- prefix=/usr/local/modules/jpeg6\ >-- enable-shared\ >-- enable-static # make # make install an error occurs here, execute

# mkdir-p / usr/local/man/man1 # make install # make install-lib install zlib

# tar xzvf zlib-1.2.3.tar.gz # mv zlib-1.2.3 / usr/local/src # cd / usr/local/src/zlib-1.2.3 #. / configure # make # make install install TTF package (font package required for GD graphics library)

# tar xzvf freetype-2.2.1.tar.gz # mv freetype-2.2.1 / usr/local/src # cd / usr/local/src/freetype-2.2.1 #. / configure # make # make install install libpng

# tar xzvf libpng-1.2.12.tar.gz # mv lib-1.2.12 / usr/local/src # cd / usr/local/src/libpng-1.2.12 # cp scripts/makefile.std makefile (choose a makefile without configure) # make test # make install install GD

# tar xzvf gd-2.0.33.tar.gz # mv gd-2.0.33 / usr/local/src # cd / usr/local/src/gd-2.0.33 #. / configure # make # make install # cp gd.h / usr/local/lib/ install the XML package (the xml version included in RedHat 9 is too low to install php5)

# tar xvzf libxml2-2.6.26.tar.gz # mv libxml2-2.6.26 / usr/local/src # cd / usr/local/src/libxml2-2.6.26 #. / configure # make # make install4, install PHP

# tar xvzf php-5.1.2.tar.gz # mv php-5.1.2 / usr/local/src # cd / usr/local/src/php-5.1.2. / configure-- prefix=/usr/local/php\ >-- with-gd\ >-- with-jpeg-dir\ >-- with-zlib-dir\ >-- with-png-dir\ >-- with-ttf\ >-- enable-magic-quotes\ >-- with-mysql\ >-- With-iconv\ >-- with-mbstring\ >-- with-apxs2=/usr/local/apache/bin/apxs\ (add DSO module to apache) >-- enable-track-vars\ (to start get/post and other tracking functions of cookie) >-- enable-force-cgi-redirect\ >-- enable-ftp # make # make test # make install # libtool-- finish / usr/local/src/php-5.1.2 # chmod 755 / usr/local/apache2/modules/ Libphp5.so (remember the path of php.ini) # cp php.ini-dist / usr/local/php/lib/php.ini (configuration file) 5, Configure Apache

Find the AddType application/x-tar.tgz line and add it below

AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps (syntax highlighting is supported) find the following line and add index.php after it, which means that the default page of the site can also be index.php

DirectoryIndex index.html index.html.var index.php configures the php.ini file

(1) find max_execution_time = 30 and change it to max_execution_time = 600,

(2) find max_input_time = 60 and change it to max_input_time = 600,

(3) find memory_limit = 8m and change it to memory_limit = 20m

(4) find display_errors = On and change it to display_errors = Off

(5) find register_globals = Off and change it to register_globals = On

(6) find post_max_size = 8m and change it to post_max_size = 20m

(7) find upload_max_filesize = 2m and change it to upload_max_filesize = 20m

(8) find session.auto_start = 0 and change it to session.auto_start = 1

(9) find safe_mode=Off and change it to safe_mode=On

Save and exit, thus completing the configuration of the php.ini file.

6. Install Zend

After decompressing, execute to enter the directory and execute. / install.sh step by step. When prompted by: Enter the location of your php.ini file, type: / usr/local/php/lib

At this point, I believe you have a deeper understanding of the "installation and configuration of Apache+PHP+MySQL server under RedHat9.0". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report