CentOS는 설치, 우분투, windows2012 시스템 문제 ---- 요약

1이 아닌 네트워크에 CentOS 후 라이트 설치 :
은 / etc / sysconfig / network-scripts에로
- ens33는이 ifcfg를 수정하는
그림 삽입 설명 여기
그림 삽입 설명 여기
ONBOOT의 yes로 수정됩니다
그림 삽입 설명 여기
그 후 다시 시작할 수 있습니다

2, CentOS는 호스트 이름을 변경
그림 삽입 설명 여기
그림 삽입 설명 여기

3, 우분투 소스 교환
1> 파일 source.list 원본 백업
명령 실행, 터미널을 열고 바탕 화면 : sudo는 CP /etc/apt/sources.list의 /etc/apt/sources.list.bak
2> source.list 수정 소스 파일을
( ; 1) 명령을 실행 sudo는 단말기가 편집 가능하도록 777 /etc/apt/source.list 변경 권한 파일에 chmod
는 sudo gedit를 /etc/apt/source.list 편집 파일을 열고, (2) 명령을 실행
(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> 업데이트 소스 :
sudo는 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 구성 파일을 수정 우분투는 다음 입력해야
다시 시작해야했다 실패 후 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