CentOSのは、Ubuntu、windows2012システムの問題----概要をインストールします

ていないネットワーク上のLiteのインストールCentOSの後1、:
/ etc / sysconfig / network-scriptsにへ
のifcfg-ens33を修正する
ここに画像を挿入説明
ここに画像を挿入説明
ONBOOTに変更されますはい
ここに画像を挿入説明
、それは後に再起動することができます

2、CentOSのは、ホスト名を変更します
ここに画像を挿入説明
ここに画像を挿入説明

3、Ubuntuのソース交換
1>ファイルがsource.listオリジナルソースバックアップ
のコマンドを実行し、ターミナルを開き、デスクトップをします。sudo CPの/etc/apt/sources.list /etc/apt/sources.list.bak
2> source.list修正したソースファイルを
( 1)コマンドを実行する端末:須藤は、それを編集可能にするために777の/etc/apt/source.list変更ファイルのアクセス権をchmodは、
(2)コマンドを実行します。sudo geditの/etc/apt/source.list編集するファイルを開く;
(3)削除文書のオリジナルコンテンツ、そこに次のいずれかのコピーと保存(共通ソースと清華ソースはアリで、アリはソースをお勧めします)

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

3>アップデート元:
須藤はaptアップデート

4、centos换源
1>备份本地yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
2>获取阿里yum源配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3>更新cache
yum makecache
4>安装
yum -y update

5、ubuntu如果用xshell无法连接,则需要安装:
sudo apt-get install openssh-server

6、centos是通过防火墙控制端口开放:
查看已经开放的端口:firewall-cmd --list-ports
开启端口:firewall-cmd --zone=public --add-port=80/tcp --permanent

#重启firewall  
firewall-cmd --reload  
#停止firewall  
systemctl stop firewalld.service  
#禁止firewall开机启动  
systemctl disable firewalld.service

7、centos安装nginx,php和配置流程:
nginx安装:

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install -y nginx

systemctl start nginx    //开启nginx
systemctl status nginx   //查询nginx状态
systemctl stop nginx    //停止nginx服务
systemctl enable nginx    //设置开机自启动

yum安装php-fpm相关组件:

yum -y install php php-fpm php-gd php-mysql php-common php-pear php-mbstring php-mcrypt

systemctl status php-fpm   //查看状态
systemctl start php-fpm    //开启
systemctl enable php-fpm   //开机自启动

编辑/etc/nginx/conf.d/default.conf并添加以下内容以支持php

vim /etc/nginx/conf.d/default.conf

#
location ~ \.php$ {
    root           /usr/share/nginx/html;    //这儿需要改
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name; //这个需要改
    include        fastcgi_params;
}

ここに画像を挿入説明
这里的index后面加上一个index.php,之后部署项目的时候,root那里修改网站所在目录,然后在index后面添加打开定位的文件如index.php即可
建立index.php文件并测试

vim /usr/share/nginx/html/index.php

<?php
    phpinfo();
?>

ここに画像を挿入説明

8、centos部署项目遇到403的时候:
这篇文章真的好,有用:
四种解决Nginx出现403 forbidden 报错的方法:
https://www.jianshu.com/p/e008d6b76bdf

9、ubuntu安装nginx+php,并配置:
安装nginx:

sudo apt-get install nginx
sudo service nginx start   //开启
sudo service nginx status  //查看状态
sudo service nginx stop  //停止
sudo service nginx restart   //重启

安装php和php-fpm:

sudo apt-get install php php-fpm  php-mysql php-gd php-mbstring
sudo service php7.2-fpm start   //开启
sudo service php7.2-fpm status   //查看状态
sudo service php7.2-fpm stop   //停止
sudo service php7.2-fpm restart   //重启

配置nginx的php环境:

cd /etc/nginx/sites-available
//修改default
sudo vim default
//将下面对应的#字号去掉
location ~ \.php$ {
                include snippets/fastcgi-php.conf;
#
#       # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
 //(要和 /etc/php/7.2/fpm/pool.d 中的 www.conf 中的 listen = /run/php/php7.2-fpm.sock 一致)
#       # With php-cgi (or other tcp sockets):
#       fastcgi_pass 127.0.0.1:9000;
}
//之后去/var/www/html,新建index.php,添加内容
<?php
	phpinfo();
?>
//nginx配置文件编译和重启
sudo nginx -t
sudo service nginx restart

结果如下:
ここに画像を挿入説明
设置开机自启动:
nginx服务:sudo systemctl enable nginx.service
php7.2-fpm服务: sudo systemctl enable php7.2-fpm.service

赋予写的权限:
sudo chmod -R 777 dvwa

10、windows2012中VMware虚拟化安装Tools时候提示更新KB2919355:
解决方法:https://www.xxshell.com/1430.html

11、windows2012安装nginx和php
链接:https://www.cnblogs.com/huayangmeng/archive/2011/06/15/2081337.html

12、Windows2012开机启动项设置
链接:https://blog.csdn.net/tmtongming/article/details/77155677

13は、nginxの設定ファイルを変更Ubuntuは、次のように入力してください:
sudoのnginxの-sリロード、または再起動障害が発生した後、再起動する必要がありました

14、負荷分散のCentOSのnginxの設定:
リンク:
https://www.cnblogs.com/iforever/p/4246352.html
https://www.linuxidc.com/Linux/2015-12/125875.htm

公開された271元の記事 ウォン称賛33 ビュー80000 +

おすすめ

転載: blog.csdn.net/qq_36386435/article/details/104332820