Build a Web server under centos6.2

Source: Internet
Author: User

1, installation Apache2

Yum Install httpd

2. Start

Method One: Service httpd Start method Two:/etc/init.d/httpd start//browse HTTP://IP, you should see Apache2 test page

3. Set Boot start

Method One: Chkconfig--levels 235 httpd on method two: Chkconfig httpd on//apache The default document root is the/var/www/html directory on CentOS, the configuration file is/etc/httpd/ Conf/httpd.conf.

4, Installation PHP5

Yum Install PHP

Restart Service  method One: Service httpd restart  method two:/etc/init.d/httpd restart  

Test PHP5 If installation successfully   created info.php vi/var/www/html/info.php   content: <?php       phpinfo ();          ? >   


5, PHP5 to get Mysol support

Yum Search PHP

  

Also installs the Yum install    php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc    // Now restart Apache2:    /etc/init.d/httpd Restart//Refresh http://ip/info.php now and scroll down to the module section again. Now, you should find more new modules, including MySQL modules.


7. Installing phpMyAdmin

It allows you to manage your MySQL database.

First, we make the CentOS system rpmforge the phpMyAdmin of the Software library, not the official CentOS 6.2 library:

So you need to import Rpmforge's GPG key:

RPM--import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt    x86_64 system:    Yum Install/HTTP// PKGS.REPOFORGE.ORG/RPMFORGE-RELEASE/RPMFORGE-RELEASE-0.5.2-2.EL6.RF.X86_64.RPM    in i386 system:    Yum Install http ://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm    Install phpMyAdmin    Yum Install phpMyAdmin

Now that we can set the phpMyAdmin, we can change the Apache configuration to make phpMyAdmin not only log on from localhost.

vi/etc/httpd/conf.d/phpmyadmin.conf    #<driectory "/usr/share/phpmyadmin" >    # Order deny,allow    # Deny from    127.0.0.1    


Next, we authenticate with the phpMyAdmin cookie that changed from http:

vi/usr/share/phpmyadmin/config.inc.php    

Note: Error message: Or the local MySQL server ' s socket is not correctly configured

Workaround: Modify PHP.ini

[MYSQL] Mysql.default_port = 3306mysql.default_socket =/tmp/mysql.sock

Build a Web server under centos6.2

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.