FedoraCore6Linux configuration apache + mysql + php

Source: Internet
Author: User
Tags root access
FedoraCore6Linux: Configure apache + mysql + php -- Linux Enterprise Application-Linux server application information. For details, see the following. Apache + mysql + php is a classic application combination. configuration is required every time I study it. I still like to use this combination to implement something. First, download the latest apache, mysql, and php versions:

Database: mysql-standard-5.0.27-linux-i386-glibc23.tar.gz
Web server: httpd-2.2.3.tar.gz
Script: php-5.2.0.tar.bz2

Then install (the downloaded installation packages are all placed under/usr/local)

1. Install mysql

# Groupadd mysql
# Useradd-g mysql
# Cd/usr/local
# Tar zvxf mysql-standard-5.0.27-linux-i386-glibc23.tar.gz
# Ln-s mysql-standard-5.0.27-linux-i386-glibc23 mysql
# Cd mysql
# Scripts/mysql_install_db -- user = mysql
# Chown-R root.
# Chown-R mysql data
# Chgrp-R mysql.
# Cp support-files/my-medium.cnf/etc/my. cnf // copy the configuration file and read the configuration when mysql is started
# Vi/etc/my. cnf
Find The Mysql server
[Mysqld]
Add a row: set-variable = max_connections = 150
Save and exit
#/Usr/local/mysql/bin/safe_mysqld -- user = mysql & // start mysql
You can use/usr/local/mysql/bin/mysqladmin version to view the Mysql DBMS version and usage information.
#/Usr/local/mysql/bin/mysqladmin-uroot password xxxxx // set a password for root access
Mysql does not start after the computer is restarted. If you want to start it at the same time, add the following content:
# Vi/etc/rc. local
Add:/usr/local/mysql/bin/safe_mysqld -- user = mysql &
Save and exit

Ii. install apache

# Cd/usr/local
# Tar-zxvf httpd-2.2.3.tar.gz
# Cd httpd-2.2.3
#./Configure -- prefix =/usr/local/apache -- enable-module = most -- enable-shared = max
# Make
# Make install
Start Apache service: #/usr/local/apache/bin/apachectl start
Disable the Apache service: #/usr/local/apache/bin/apachectl stop
Restart Apache: #/usr/local/apache/bin/apachectl restart

3. install php

# Cd/usr/local
# Tar-jxvf php-5.2.0.tar.bz2
# Cd php-5.2.0
#./Configure -- prefix =/usr/local/php -- with-mysqld =/usr/local/mysql-with-apxs2 =/usr/local/apache/bin/apxs
# Make
# Make install
# Cp php. ini-dist/usr/local/php/lib/php. ini

4. Configure apache

Edit the httpd. conf file
# Vi/usr/local/apache/conf/httpd. conf
Add LoadModule php5_module module/libphp5.so to LoadModule
Add index. php at DirectoryIndex
Add AddType application/x-httpd-php. php. phtml at AddType application.
AddType applicatoin/x-httpd-php-source. phps

V. Test php module Loading

#/Usr/local/apache/bin/apachectl start // enable apache
Enter http: // localhost/in the browser/
In the browser, It Works indicates that apache has enabled the www Service.
# Vi/usr/local/apache/htdocs/phpinfo. php
Input:
Save and exit
Enter http: // localhost/phpinfo. php In the browser
A web page about apache and php installation is displayed in the browser, indicating that the php module is loaded successfully.

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.