时间:2020-09-10来源:www.pcxitongcheng.com作者:电脑系统城
xserver1解压打开虚拟机配置ip
# mkdir /opt/centos
# mount CentOS-7-x86_64-DVD-1511.iso /opt/centos/
# mv /etc/yum.repos.d/* /media/
# vi /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[lnmp]
name=lnmp
baseurl=file:///root/lnmp
gpgcheck=0
enabled=1
# setenforce 0
# systemctl stop firewalld
# yum install -y nginx mariadb mariadb-server php-fpm php-mysql
# mkdir /www
# chown nginx:nginx /www/
# vi /etc/nginx/fastcgi_params
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; //添加这行
fastcgi_param REQUEST_URI $request_uri;
# vi /etc/nginx/conf.d/default.conf
location / {
root /www; //更改网页目录
index index.php index.html index.htm; //添加index.php
}
location ~ \.php$ { //去掉这部分前面的注释符
root /www; //更改目录
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
# systemctl start nginx
查看服务状态
# systemctl status nginx
# vi /etc/php-fpm.d/www.conf
user = nginx //修改用户和组
group = nginx
# service php-fpm start
Redirecting to /bin/systemctl start php-fpm.service
查看服务状态
# systemctl status php-fpm
# systemctl start mariadb
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB# mysql -uroot -p000000
授权在任何客户端机器上可以以root用户登录到数据库
> grant all privileges on *.* to root@'%' identified by '000000';
创建数据库
> create database wordpress;
退出数据库
# yum install -y net-tools
# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 3458/php-fpm: maste
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3854/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3449/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1422/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2025/master
tcp6 0 0 :::22 :::* LISTEN 1422/sshd
tcp6 0 0 ::1:25 :::* LISTEN 2025/master
# yum install -y unzip
# unzip wordpress-4.7.3-zh_CN.zip
# mv wordpress/* /www/
# cp /www/wp-config-sample.php /www/wp-config.php
# vi /www/wp-config.php
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名 */
define('DB_USER', 'root');
/** MySQL数据库密码 */
define('DB_PASSWORD', '000000');
/** MySQL主机 */
define('DB_HOST', '192.168.100.10');
/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');
/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');
设置WordPress的站点标题为自己的姓名
2023-02-28
解决linux不识别nfst格式u盘问题技巧 linux无法识别ntfs格式U盘怎么办?2023-02-28
linux扩容swap分区的技巧 linux怎么调整swap大小?2023-02-26
微软Linux资源库首次加入Edge浏览器稳定版当linux在运作时不能直接关闭电源容易将档案系统损毁,因此需要用shutdown以安全的方式关闭,那么这个操作该怎么实现呢?下面就为大家带来了详细教程。...
2022-11-07
由于linux系统和我们常用的windows系统是不一样的,所以如果是初学者,可能会不知道linux怎么强制删除文件,其实我们只要打开终端,使用命令就可以删除了。...
2022-11-03