In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install LAMP under Red Hat. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
LAMP installation
1. Install MYSQL
# tar-zxvf mysql-5.0.22.tar.gz / / unpack the installation package # cd mysql-5.0.22 / / enter the installation directory # mkdir / usr/local/mysql / / create the mysql directory #. / configure-- prefix=/usr/local/mysql / / set the installation directory # make / / compile # make install / / install / / or # make & & make install compile and install # groupadd mysql / / A new group named mysql # useradd-g mysql mysql / / a new user named mysql And by default it belongs to the mysql group # chgrp-R mysql / usr/local/mysql / / change / usr/local/mysql and the group to which the subordinate files and directories belong # cp support-files/my-large.cnf / etc/my.cnf / / copy my-large.cnf to / etc Replace the original my.cnf # scripts/mysql_install_db / / create the initial data # chown-R mysql:mysql / usr/local/mysql/var / / change var and the following file directory group and owner # cp support-files/mysql.server / etc/init.d/mysqld / / copy mysql.server to the init.d directory and rename it to mysql Startup file # chmod / etc/init.d/mysqld / / set the permissions of the startup file to 755 # chkconfig-- add mysqld / / add this service to the system startup Add to add to / etc/rc.d/init.d # chkconfig mysqld on / / on default to start service at 3\ 5 level # / etc/init.d/mysqld start # / usr/local/mysql/bin/mysqld_safe & / / launch mysql # / usr/local/mysql/bin/mysqladmin-u root-p password 123 / / default root user password is empty After setting the password to 123 # / usr/local/mysql/bin/mysql-u root-p / / enter 123 above, log in as root #. / mysqladmin-u root-p password 456 / / enter 123 set above. Log in to mysql > grant select on test.* to 'ttt' @'% 'identified by'ttt' with grant option; as root / / add a mysql account with the name ttt and password ttt, and have permission to modify the test database
2. Installation of Apahce
# tar-zxvf httpd-2.2.3.tar.gz / / extract the httpd-2.2.3.tar.gz package #. / configure-prefix=/usr/local/apache2-- enbale-module=so / / the-prefix here specifies that the installation of apache will be installed in the / usr/local/apache2 directory # make / / compile # make install / / install # vi / usr/local/apache2/conf/httpd.conf / / remove the # in front of ServerName inside The following is: start your own ip:80 # / usr/local/apache2/bin/apachectl start / / apache service
If you want apache to run automatically as soon as you turn it on, do the following:
Edit etc/rc.d/rc.local # vi / etc/rc.d/rc.local
Add a sentence in * *: / usr/local/apache2/bin/apachectl start
Look at the / usr/local/apache2 installation path here, so you must remember it clearly when you install it.
Installation and setup of jpeg package
# mkdir-p / usr/local/jpeg6 # mkdir-p / usr/local/jpeg6/bin # mkdir-p / usr/local/jpeg6/lib # mkdir-p / usr/local/jpeg6/include # mkdir-p / usr/local/jpeg6/man/man1 / / create directory # tar-zxvf jpegsrc.v6b.tar.gz / / extract jpegsrc.v6b.tar.gz package #. / configure-prefix=/usr/local/jpeg6/-- enable-static # make / / compile # make install / / install and install libpng # tar xvzf libpng-1.2.8.tar.gz # cd libpng-1.2.8 # cp scritp/makefile.gcmmx makefile (with its own makefile file OK without configure,copy) # make # make install
3. Install freetype
# tar-zxvf freetype-2.3.5.tar.gz # cd freetype-2.3.5 # mkdir-p / usr/local/freetype #. / configure-prefix=/usr/local/freetype # make # make install
4. Install zlib (lib png support package)
# tar-zxvf zlib-1.2.2.tar.gz # cd zlib-1.2.2.tar.gz #. / configure # make # make insatll install the GD library # # tar-zxvf gd-2.0.33.tar.gz # cd gd-2.0.33.tar.gz #. / configure-- prefix=/usr/local/gd2-- with-jpeg=/usr/local/jpeg6/-- with-png=/usr/local/lib/- -with-zlib=/usr/local/lib/-- with-freetype=/usr/local/freetype/ # make # make install # cp gd.h / usr/local/lib/
5. Install the XML package
# tar-zxvf libxml2-2.6.19.tar.gz # cd libxml2-2.2.6.19 #. / configure-prefix=/usr/local/libxml2 # make # make install
6. Install Curl library
# tar-zxvf curl-7.16.4.tar.gz # cd curl-7.16.4 #. / configure-prefix=/usr/local/curl # make # make install
7. Install php
# tar-zxvf php-5.2.3.tar.gz # cd php-5.2.3.tar.gz #. / configure-- prefix=/usr/local/php5-- with-apxs2=/usr/local/apache2/bin/apxs-- with-mysql=/usr/local/mysql/-- with-curl=/usr/local/curl-- enable-ftp-- with-libxml-dir=/usr/local/libxml2-with-gd-dir=/usr/local/gd2-- with-jpeg-dir= / usr/local/jpeg6/-with-zlib-dir=/usr/local/lib-with-png=/usr/local/lib/-with-freetype-dir=/usr/local/freetype # make # make install # cp php.ini-dist / usr/local/lib/php.ini
Among them-- prefix=/usr/local/php-- with-apxs2=/usr/local/apache/bin/apxs-- with-mysql=/usr/local/mysql/-- with-libxml-dir=/usr/local/libxml2 after. / configure is a necessary option-- with-gd=/usr/local/gd2/-- with-jpeg-dir=/usr/local/jpeg6/-- with-png=/usr/local/lib-- with-zlib-dir=/usr/lib-- with-freetype. -dir=/usr/local/freetype this is the configuration option for PHP to support GD libraries
-- with-curl=/usr/local/curl supports CURL library-- enable-ftp opens FTP library function support
-- enable-soap-- with-xsl=/usr/local/libxslt-- enable-xslt lets PHP support SOAP. These are generally used less and can be removed.
-the finishing touches:
Edit apache's configuration file httpd.conf
Vi / etc/httpd/httpd.conf
Find "# AddType application/x-gzip .gz .tgz"
And add it later.
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
The purpose of these two lines is to get apache to recognize php.
And then find "DirectoryIndex index.html."
Add index.php to make index.php the default page.
-Test environment:
Create the php file under / usr/local/apache/htdocs/.
# vi / usr/local/apache/htdocs/index.php
Enter:
Phpinfo ();? >
6. Restart the apache server
# / usr/local/apache/bin/apachectl restart
Enter: http://127.0.0.1/index.php test in the browser, and the excited face will come out.
Thank you for reading! This is the end of this article on "how to install LAMP under Red Hat". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.