---of lamp environment under RedHat6.4 system (yum build)

Source: Internet
Author: User
Tags configuration php soap php software fully qualified domain name yum repolist

One: Configure the local Yum Source:

1 Create a folder to hold the files attached to the CD

Mkdir/mnt/cdrom  

2 mount the optical drive in the folder you created

3 Of course we can also set to boot automatically mount optical drive:
Edit the/etc/rc.local file with VI, because the script file is executed after the initialization script is executed during the system boot process, and the following command is added:

vi/etc//dev/cdrom/mnt/cdrom                 #后面挂载点可以自己选择

4 Configure the files for the local Yum Source:

vi/etc/yum.repos.d/rhel-source.repo        #配置本地yum源的文件 [Rhel-source]name=Redhat                                  # Set the name of the local Yum source BaseURL=file://mnt/cdrom/server             #设置本地yum源的地址enabled=1                                    # 1 means enable local Yum source   0 To disable gpgcheck=1

5 Viewing the available local Yum sources:

Shown below:

[[Email protected] ~]# Yum repolist Loaded plugins:product-id, Security, subscription-managerthis System isNot registered to Red Hat Subscription Management. can use subscription-Manager to Register.rhel-source |3.9Kbxx:xx... repo ID repo name Statusrhel-source Redhat3,648repolist:3,648

This means that the local Yum source configuration is complete!

--------------------------------------------------------------------------------------------------------------- ----------------------------

Two installation configuration Apache server

6 Yum install Apache server:

[email protected] ~]# Yum install httpd-y

The installation finishes are displayed as follows:

Installed:httpd.x86_640:2.2. the- -. El6 Dependency Installed:apr.x86_640:1.3.9-5. El6_2 apr-util.x86_640:1.3.9-3. El6_0.1Apr-util-ldap.x86_640:1.3.9-3. El6_0.1Httpd-tools.x86_640:2.2. the- -. El6 Complete!

7 opening Apache Service

[[Email protected] ~]# service httpd start

Shown below:

[[Email protected] ~ for chrishttpd:could not reliably determine the server's Fully qualified domain name, using 127.0.0.1 for ServerName[OK]

8 Check whether the Apache server is on, and see if Port 80 is in listening state

[Email protected] ~]# Netstat-an | grep:

Shown below:

[Email protected] ~]# Netstat-an | grep:tcp        0      0 ::: +                       :::*                        LISTEN   

9 Setting up Apache service boot automatically

[Email protected] ~]# chkconfig httpd on

10 See if the Apache service has been added to the boot entry:

[Email protected] ~]# Chkconfig | grep httpd

Shown below:

[Email protected] ~]# Chkconfig | grep httpdhttpd            0: Off  1: Off  2: Enable  3: Enable  4: Enable  5: Enable  6: Off

The above shows that 2-5 is enabled, which means the Apache server is ready to boot automatically!

11 Configuring the firewall allows 80 ports to pass through

 -J ACCEPT     ~]#

12 Save the current firewall configuration to the configuration file

[[email protected] ~]#  /etc/rc.d/init.d//etc/sysconfig/iptables:[OK]

13 Restart Firewall service in effect

[[Email protected] ~

14 Finally, using the browser access test can be shown as follows:

Here we have the Apache server installed configuration is complete!


---------------------------------------------------------------------------------------------------------


Three-installation configuration MySQL database

15 installing the MySQL database with Yum

[Email protected] ~]#  yum-y Install Mysql-server

After the installation is complete, the following appears:

installed:  mysql0:5.1. 2. El6_3                                                            Dependency installed:  0:5.1.  2. El6_3                0:4.013-3. el6   

16 starting the MySQL service

[[Email protected] ~]# service mysqld start initializing MySQL database: Warning:the host'Chris'Could not being looked up with Resolveip. This probably means that your libc libraries is not -%Compatiblewith Thisbinary MySQL version. The MySQL daemon, mysqld, should worknormally with the exception that host name resolving won't work. This means, should use IP addresses instead of Hostnameswhen specifying MySQL privileges!Installing MySQL system tables ... Okfilling Help Tables ... OKto start mysqld at boot time with to Copysupport-files/mysql.server to the right place foryour systemplease REMEMBER to SET A PASSWORD for the MySQL root USER! to DoSo, start the server and then issue the following commands:/usr/bin/mysqladmin-u Root Password'New-password'/usr/bin/mysqladmin-u root-h Chris Password'New-password'Alternatively you can run:/usr/bin/Mysql_secure_installationwhich would also give you the option of removing the testdatabases and anonymous user created bydefault. This isstrongly recommended forproduction servers. See the manual forMore instructions. You can start the MySQL daemon with:cd/usr; /usr/bin/mysqld_safe &can test the MySQL daemon with MySQL-test-RUN.PLCD/usr/mysql-test; Perl mysql-test-run.plplease Report any problems with the/usr/bin/mysqlbug script![OK] starting mysqld: [OK]

17 set MySQL boot to start automatically

[Email protected] ~~]#

See if MySQL joins the boot entry

[Email protected] ~]# Chkconfig | grep mysqldmysqld           0: Off  1: Off  2: Enable  3: Enable  4: Enable  5: Enable  6: Off

The above shows that 2-5 is enabled, which means the MySQL server is ready to boot automatically!

18 Turn on the 3306 port of the firewall

3306 -

Save the current firewall configuration to the configuration file

[Email protected] ~]#  /etc/rc.d/init.d//etc/sysconfig/

19 Restart Firewall service in effect

[[Email protected] ~]# service iptables restartiptables: Clear Firewall rule: [OK]iptables: Set the chain as policy accept:filter [OK] Iptables: Uninstalling module: [OK]iptables: Apply firewall rule: [OK]

20 testing whether the MySQL service is turned on

3306 TCP         0      0 0.0. 0.0:3306                0.0.  0.0:*                   LISTEN      2061/mysqld         

21 Enter MySQL database as root

[email protected] ~]# MySQL-Urootwelcome to the MySQL Monitor. Commands End With; or \g.your MySQL connection ID is 3Server Version:5.1. theSource Distributioncopyright (c) -, -, Oracle and/or its affiliates. All rights reserved. Oracle isA registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type'Help ;'Or'\h'  forHelp. Type'\c'To clear the current input statement.mysql>

22 Setting the password for the root user of MySQL

set password = password ('123456'0 rows affected (0.00 sec)

23 When you enter MySQL database again, you need to enter other commands!

[Email protected] ~]# Mysql-uroot-

Then enter the password to log into the MySQL database.


--------------------------------------------------------------------------------------------------------------- ------

Four-install configuration PHP software
Installation Preparation:

24 We need to install a few PHP extensions before installing PHP software

[Email protected] ~]# yum-y install php-xml php-gd php-soap

After the installation is complete, the following appears:

installed:php-gd.x86_640:5.3.3- A. el6 php-soap.x86_640:5.3.3- A. el6 php-xml.x86_640:5.3.3- A. El6 Dependency Installed:libXpm.x86_640:3.5.Ten-2. el6 php-common.x86_640:5.3.3- A. el6

25 Start installing PHP software now

[[email protected] ~]#  yum-y Install PHP

After the installation is complete, the following appears:

installed:   0:5.3. 3-el6                                                                       Dependency installed:  php0:5.3.  3-el6.                                                                   

26 Configuring Apache to support PHP needs to enter Apache configuration file first

[Email protected] ~]# vi/etc/httpd/conf/httpd.conf

Find the AddType application/x-gzip gz. tgz Line

Add the following
AddType application/x-httpd-php. php. phtml
AddType Application/x-httpd-source. Phps

The effect of the final modification is as follows:

# If The addencoding directives above is commented-outand then you# probably should define those extensions to Indicate media types: #AddType application/x-compress. Zaddtype application/x-gzip. gz. Tgzaddtype application/x-httpd-php. php. Phtmladdtype Application /x-httpd-source. Phps

27 Restart Apche Server in effect

[[Email protected] ~ for chrishttpd:could not reliably determine the server's Fully qualified domain name, using 127.0.0.1 for ServerName[OK]


Code section:
<?php
Echo Phpinfo ();
?>

-------------------------------------------------------------------------------------------

5 Configuring MySQL
Mysql-uroot
Set password = password (' 123456 ');
Exit



6 Configuring PHP support MySQL
Yum Install-y Php-mysql
Service httpd Restart


7 Turn off SELinux
Vi/etc/selinux/config Add: selinux=disabled
Modify permissions for Web site files The HTML file is writable

---of lamp environment under RedHat6.4 system (yum build)

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.