Install and configure Apache + MySQL + PHP with Yum under Fedora

Source: Internet
Author: User
Tags php mysql

1. Install apahce,PHP,MySQL,
And PHP connection to MySQL library components.

Yum-y install httpd PHP MySQL mysql-server PHP-MySQL



2. Configure the startup Service

 /Sbin/chkconfig httpd on[SettingsApacheServer httpd service startup]
 /Sbin/chkconfig -- add mysqld[Add a MySQL service to the 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, not related to boot]



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 = '';[Delete anonymous accounts]
Mysql> flush privileges;[Overload permissions]



5. According to the above installation method, the default site directory configured is/var/www/html/
Create a PHP script:

<? PHP
 Phpinfo ();
?>




6. Create a NewDatabaseTo 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-y install PHP-Gd PHP-xml php-mbstring PHP-ldap php-Pear php-XMLRPC // install MySQL extension Yum-y install mysql-connector-odbcmysql-devel libdbi-DBD-MySQL

Disable SELinux. // local debugging. For network servers, refer to SELinux configuration.

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.