Fedora uses Yum to install the Apache + PHP + Mysql Environment

Source: Internet
Author: User
Tags php mysql
1. Install Apahce, PHP, Mysql, and php on Fedora to connect to the mysql library components. Yum-yinstallhttpdphpmysqlmysql-serverphp-mysql2. Configure the boot service/sbin/chkconfighttpdon [set the httpd server to boot]/sbin/chkconfig-addmysqld [add mysq to the service list

1. Install Apahce, PHP, Mysql, and php on Fedora to connect to the mysql library components.
Yum-y install httpd php mysql-server php-mysql

2. Configure the startup Service
/Sbin/chkconfig httpd on [set the startup of the httpd service on the apahce server]
/Sbin/chkconfig-add mysqld [add mysql service to service list]
/Sbin/chkconfig mysqld on [set mysql Service Startup]
/Sbin/service httpd start [start the httpd service, which has nothing to do with startup]
/Sbin/service mysqld start [start mysql service, irrelevant to startup]

3. Set the password of the root account of the mysql database.
Mysqladmin-u root password 'newpassword' [enter the password in quotation marks]

4. Make mysql database more secure
Mysql-u root-p
Mysql> drop database test; [Delete the test DATABASE]
Mysql> delete from mysql. user WHERE user = "; [deleting anonymous accounts]
Mysql> flush privileges; [reload permissions]

5. According to the above installation method, the default site directory configured is/var/www/html/
Create a php script:
Phpinfo ();
?>

6. Create a database, add a database user, and set user permissions. Write a php script to test the database connection.
Mysql> create database my_db;
Mysql> grant all privileges on my_db. * TO 'user' @ 'localhost' identified by 'Password ';
// Install apache Extension
Yum-y install httpd-manual mod_ssl mod_perl mod_auth_mysql
// Install php Extension
Yum install php-gd
Yum-y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
// Install mysql extension
Yum-y installmysql-connector-odbcmysql-devel libdbi-dbd-mysql

Related Article

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.