How to configure Apache2+PHP5+MySQL5+GD Library under CentOS
This article mainly introduces the relevant knowledge of how to configure Apache2+PHP5+MySQL5+GD library under CentOS, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to configure Apache2+PHP5+MySQL5+GD library under CentOS. Let's take a look.
Install the mysql server first
Extract mysql and copy all files to / usr/local/mysql
[root@bleach usr] # groupadd mysql
[root@bleach usr] # useradd-g mysql mysql
[root@bleach mysql] # cd / usr/local/mysql
[root@bleach mysql] # scrackers / mysql_install_db-- user=mysql
[root@bleach mysql] # chown-r root.
[root@bleach mysql] # chown-r mysql data
[root@bleach mysql] # chgrp-r mysql.
[root@bleach mysql] # / bin/mysqld_safe-- user=mysql &
[root@bleach mysql] #. / bin/mysqladmin-u root password mysql
[root@bleach mysql] # cp. / support-files/mysql.server / etc/init.d/mysql
[root@bleach mysql] # cd / etc/rc3.d/
[root@bleach rc3.d] # ln-s / etc/init.d/mysql s85mysql
[root@bleach rc3.d] # ln-s / etc/init.d/mysql k85mysql
Install the basic package of gd library
# rpm-ivh gd-devel-1.8.4-11.i386.rpm
Install xpm support
# rpm-ivh xpm-3.4k-2.i386.rpm
Install libxml2 (remember that php5.1.1 only supports libxml2-2.6.11 and above)
# tar zxvf libxml2-2.6.11.tar.gz
# cd libxml2-2.6.11
#. / configure
# make
# make install
Start installing gd library support
Install the gd basic rpm package first
# rpm-ivh gd-devel.rpm
Zlib
#. / configure
# make
# make install
Jpegsrc
#. / configure-enable-shared
# make
# make install-lib
# make install
Libpng
# cp scrackers / makefile.std makefile
# make
# make install
And finally, gd2.*.
#. / configure-with-png=/usr/local-with-jpeg=/usr/local-with-freetype=/usr
# make
# make install
-
If all goes well above, gd will be installed successfully. If there is a problem, it should be the lack of support packages. In short, download what is missing.
Come and install it.
Follow up and start installing apahche2 and php5
#. / configure-prefix=/usr/local/apache2-enable-module=so
# make
# make install
Php5
#. / configure-prefix=/usr/local/php-with-apxs2=/usr/local/apache2/bin/apxs-with-jpeg-
Dir=/usr/local-with-png-dir=/usr/local-with-gd=/usr/local-enable-trace-vars-with-
Zlib-dir=/usr/local-with-mysql=/usr/local/mysql-- enable-mbstring=all
# make
# make install
Copy the php.ini file to the correct location
Run under the php directory
# cp php.ini-dist / usr/local/php/lib/php.ini
Edit apache profile httpd.conf
# vi / usr/local/apache2/conf/httpd.conf
There are several changes to be made as follows:
Usually in
# addtype application/x-tar .tgz
Add a line below
Addtype application/x-httpd-php .php
Find
Index.html
Add index.htm index.php at the end to make index.php as the default page
Look again.
# servername
Remove the # and change the back ip to your ip.
find
"/ usr/local/apache2/htdocs"
Change the two "/ usr/local/apache2/htdocs" to the path where you store the web files
Save the httpd.conf file.
Start it.
# / usr/local/apache2/bin/apachectl start
If there is no mistake, write a test page and put it in your web page directory. Mine is the / www mentioned above.
Phpinfo ()
? >
Save it. Try typing ip in the tester and you can see the phpinfo page.
Add apache2 to the system service
# cd / etc/init.d
# cp / usr/local/apache/bin/apachectl. / httpd
Edit httpd with text
Add to the head
# chkconfig: 345 79 15
# descrption: activates/deactivates apache web server
# processname: httpd
# chkconfig-add httpd
Install zendoptimizer-2.5.3 acceleration php
#. / install.sh
At this point, the server has been set up. Let's take a look at the following.
Let the peanut shell start at random
Using redhat linux, add a line / usr/local/phlinux/phlinux-d to the / etc/rc.d/rc.local file
It should be fine to acquiesce all the way.
Share adsl
# echo "1" > / proc/sys/net/ipv4/ip_forward
# iptables-t nat-a postrouting-o ppp0-j masquerade
Save profile paths such as user / group passwords
1) profile related to the user (user)
/ etc/passwd Note: profile of user (user)
/ etc/shadow Note: user (user) shadow password file
2) configuration files related to user groups (group)
/ etc/group Note: user Group (group) profile
/ etc/gshadow Note: shadow file of user group (group)
This is the end of the article on "how to configure Apache2+PHP5+MySQL5+GD Library under CentOS". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to configure Apache2+PHP5+MySQL5+GD library under CentOS". If you want to learn more knowledge, you are welcome to follow the industry information channel.