环境:centos 6.9 64位;
yum install mysql-server
service mysqld status
service mysqld start
#输入命令: 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 should just press enter here.
Enter current password for root (enter for none):
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] y
New password:
Re-enter new password:
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 for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should 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] y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- 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] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
mysql -u root -p
使用上述命令后按回车输入上一步设置的密码,可以进入到MySQL数据库。安装MySQL完成
yum install php-fpm php-mysql
1.在nginx.conf中添加如下:
server{
listen 80;
server_name blog.isdevil.com;
location /{
root /usr/local/nginx/html;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/local/nginx/html;
}
#pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root /usr/local/nginx/html;
fastcgi_pass 127.0.0.1:9999;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
2.修改/etc/php-fpm.d/www.conf文件
user = nginx
group = nginx
listen=127.0.0.1:9999
3.因为我的server上运行者leanote且占用了9000端口,所以在上述两个配置中我将端口修改为了9999
1.创建/usr/local/nginx/html/info.php
2.在浏览器中输入 blog.isdevil.com/info.php可以查看内容,有输出则成功
chkconfig --levels 235 mysqld on
chkconfig --levels 235 php-fpm on
参考资料:http://www.jyguagua.com/?p=3236
转载请注明:大魔王ISDevil's Blog » 安装wordpress前的准备