Install Nginx (with PHP-FPM) + PHP5 and MySQL support on Fedora16

Source: Internet
Author: User
Nginx is a free, open-source, and high-performance HTTP server. Nginx is stable, rich in functions, simple configuration, and low resource consumption. This tutorial demonstrates how to install a PHP5 + Nginx (PHP-FPM) + MySQL server on Fedora16. But I don't make any guarantee, it will certainly work normally! 1. A preliminary description of the Host Name and IP address 192.168.0.100server1.example.com used in this tutorial. These settings may be different, so

Nginx is a free, open-source, and high-performance HTTP server. Nginx is stable, rich in functions, simple configuration, and low resource consumption. This tutorial demonstrates how to install a PHP5 + Nginx (PHP-FPM) + MySQL server on Fedora 16.
But I don't make any guarantee, it will certainly work normally!

1. Preliminary description
The Host Name and IP address 192.168.0.100 server1.example.com used in this tutorial. These settings may be different, so you have to change them as appropriate.

2. Install MySQL 5
First, run the following command on the terminal to install MySQL 5:

yum install mysql mysql-server

Then create the MySQL system startup Link (MySQL is automatically started when the system starts) to start the MySQL server:

systemctl enable mysqld.service
systemctl start mysqld.service

Check whether the network is enabled. Run

netstat -tap | grep mysql

If it is normal, the following content will be realized:

[Root @ server1 ~] # Netstat-tap | grep mysql
Tcp 0 0 *: mysql *: * LISTEN 1116/mysqld
[Root @ server1 ~] #

If not, edit the/etc/my. cnf file and comment out the option skip-networking:

vi /etc/my.cnf

[...]
# Skip-networking
[...]

And restart the MySQL server:

Systemctl restart mysqld. service

Run

mysql_secure_installation

Set a password for the root user (otherwise anyone can access your MySQL database !) :

[Root @ server1 ~] # Mysql_secure_installation

NOTE: running all parts of this script is recommended for all MySQL
Servers in production use! Please read each step carefully!

In order to log into MySQL to secure it, we'll need the current
Password for the root user. If you 've just installed MySQL, and
You haven't set the root password yet, the password will be blank,
So you shoshould just press enter here.

Enter current password for root (enter for none ):<-ENTER
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
Root user without the proper authorisation.

Set root password? [Y/n]<-ENTER
New password:<-Yourrootsqlpassword
Re-enter new password:<-Yourrootsqlpassword
Password updated successfully!
Reloading privilege tables ..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
To log into MySQL without having to have a user account created
Them. This is intended only for testing, and to make the installation
Go a bit smoother. You shoshould remove them before moving into
Production environment.

Remove anonymous users? [Y/n]<-ENTER
... Success!

Normally, root shoshould only be allowed to connect from 'localhost'. This
Ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]<-ENTER
... Success!

By default, MySQL comes with a database named 'test' that anyone can
Access. This is also intended only for testing, and shocould be removed
Before moving into a production environment.

Remove test database and access to it? [Y/n]<-ENTER
-Dropping test database...
... Success!
-Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
Will take effect immediately.

Reload privilege tables now? [Y/n]<-ENTER
... Success!

Cleaning up...

All done! If you 've completed all of the above steps, your MySQL
Installation shoshould now be secure.

Thanks for using MySQL!

[Root @ server1 ~] #

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.