1.卸载系统中默认的php和httpd

[root@x ~]# yum remove httpd* php*
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: php*
base | 3.7 kB :
base/primary_db | 3.6 MB :
extras | 3.4 kB :
extras/primary_db | kB :
updates | 3.4 kB :
updates/primary_db | 2.5 MB :
vz-base | B :
vz-base/primary | 1.3 kB :
vz-base /
vz-updates | B :
vz-updates/primary | 2.1 kB :
vz-updates /
Package(s) php* available, but not installed.
Resolving Dependencies
--> Running transaction check
---> Package httpd.i686 :2.2.-.el6.centos will be erased
---> Package httpd-tools.i686 :2.2.-.el6.centos will be erased
--> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================
Removing:
httpd i686 2.2.-.el6.centos installed 2.8 M
httpd-tools i686 2.2.-.el6.centos installed k Transaction Summary
=================================================================================================================================================================
Remove Package(s) Installed size: 2.9 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : httpd-2.2.-.el6.centos.i686 /
warning: /etc/httpd/conf/httpd.conf saved as /etc/httpd/conf/httpd.conf.rpmsave
Erasing : httpd-tools-2.2.-.el6.centos.i686 /
Verifying : httpd-2.2.-.el6.centos.i686 /
Verifying : httpd-tools-2.2.-.el6.centos.i686 / Removed:
httpd.i686 :2.2.-.el6.centos httpd-tools.i686 :2.2.-.el6.centos Complete!

2.添加安装源

[root@x ~]# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Retrieving http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.2QHCGj: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [%]
:epel-release ########################################### [%]

3.安装nginx

[root@x ~]# yum install -y nginx
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/metalink | kB :
* base: centos.sonn.com
* epel: linux.mirrors.es.net
* extras: centos.sonn.com
* updates: repos.lax.quadranet.com
epel | 4.3 kB :
epel/primary_db | 4.9 MB :
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.i686 :1.0.-.el6 will be installed
--> Processing Dependency: nginx-filesystem = 1.0.-.el6 for package: nginx-1.0.-.el6.i686
--> Processing Dependency: nginx-filesystem for package: nginx-1.0.-.el6.i686
--> Processing Dependency: libxslt.so.(LIBXML2_1.0.18) for package: nginx-1.0.-.el6.i686
--> Processing Dependency: libxslt.so.(LIBXML2_1.0.11) for package: nginx-1.0.-.el6.i686
--> Processing Dependency: libxslt.so. for package: nginx-1.0.-.el6.i686
--> Processing Dependency: libgd.so. for package: nginx-1.0.-.el6.i686
--> Processing Dependency: libexslt.so. for package: nginx-1.0.-.el6.i686
--> Processing Dependency: libGeoIP.so. for package: nginx-1.0.-.el6.i686
--> Processing Dependency: gd for package: nginx-1.0.-.el6.i686
--> Processing Dependency: GeoIP for package: nginx-1.0.-.el6.i686
--> Running transaction check
---> Package GeoIP.i686 :1.6.-.el6 will be installed
--> Processing Dependency: geoipupdate for package: GeoIP-1.6.-.el6.i686
--> Processing Dependency: GeoIP-data for package: GeoIP-1.6.-.el6.i686
---> Package gd.i686 :2.0.-.el6 will be installed
--> Processing Dependency: libfreetype.so. for package: gd-2.0.-.el6.i686
--> Processing Dependency: libfontconfig.so. for package: gd-2.0.-.el6.i686
--> Processing Dependency: libXpm.so. for package: gd-2.0.-.el6.i686
--> Processing Dependency: libX11.so. for package: gd-2.0.-.el6.i686
---> Package libxslt.i686 :1.1.-.el6_3. will be installed
---> Package nginx-filesystem.noarch :1.0.-.el6 will be installed
--> Running transaction check
---> Package GeoIP-GeoLite-data.noarch :2015.04-.el6 will be installed
--> Processing Dependency: GeoIP-GeoLite-data-extra = 2015.04-.el6 for package: GeoIP-GeoLite-data-2015.04-.el6.noarch
---> Package fontconfig.i686 :2.8.-.el6 will be installed
---> Package freetype.i686 :2.3.-.el6_6. will be installed
---> Package geoipupdate.i686 :2.2.-.el6 will be installed
---> Package libX11.i686 :1.6.-.el6 will be installed
--> Processing Dependency: libX11-common = 1.6.-.el6 for package: libX11-1.6.-.el6.i686
--> Processing Dependency: libxcb.so. for package: libX11-1.6.-.el6.i686
---> Package libXpm.i686 :3.5.-.el6 will be installed
--> Running transaction check
---> Package GeoIP-GeoLite-data-extra.noarch :2015.04-.el6 will be installed
---> Package libX11-common.noarch :1.6.-.el6 will be installed
---> Package libxcb.i686 :1.9.-.el6 will be installed
--> Processing Dependency: libXau.so. for package: libxcb-1.9.-.el6.i686
--> Running transaction check
---> Package libXau.i686 :1.0.-.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================
Installing:
nginx i686 1.0.-.el6 epel k
Installing for dependencies:
GeoIP i686 1.6.-.el6 epel k
GeoIP-GeoLite-data noarch 2015.04-.el6 epel k
GeoIP-GeoLite-data-extra noarch 2015.04-.el6 epel M
fontconfig i686 2.8.-.el6 base k
freetype i686 2.3.-.el6_6. base k
gd i686 2.0.-.el6 base k
geoipupdate i686 2.2.-.el6 epel k
libX11 i686 1.6.-.el6 base k
libX11-common noarch 1.6.-.el6 base k
libXau i686 1.0.-.el6 base k
libXpm i686 3.5.-.el6 base k
libxcb i686 1.9.-.el6 base k
libxslt i686 1.1.-.el6_3. base k
nginx-filesystem noarch 1.0.-.el6 epel 8.1 k Transaction Summary
=================================================================================================================================================================
Install Package(s) Total download size: M
Installed size: M
Downloading Packages:
(/): GeoIP-1.6.-.el6.i686.rpm | kB :
(/): GeoIP-GeoLite-data-2015.04-.el6.noarch.rpm | kB :
(/): GeoIP-GeoLite-data-extra-2015.04-.el6.noarch.rpm | MB :
(/): fontconfig-2.8.-.el6.i686.rpm | kB :
(/): freetype-2.3.-.el6_6..i686.rpm | kB :
(/): gd-2.0.-.el6.i686.rpm | kB :
(/): geoipupdate-2.2.-.el6.i686.rpm | kB :
(/): libX11-1.6.-.el6.i686.rpm | kB :
(/): libX11-common-1.6.-.el6.noarch.rpm | kB :
(/): libXau-1.0.-.el6.i686.rpm | kB :
(/): libXpm-3.5.-.el6.i686.rpm | kB :
(/): libxcb-1.9.-.el6.i686.rpm | kB :
(/): libxslt-1.1.-.el6_3..i686.rpm | kB :
(/): nginx-1.0.-.el6.i686.rpm | kB :
(/): nginx-filesystem-1.0.-.el6.noarch.rpm | 8.1 kB :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.1 MB/s | MB :
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS- Key (CentOS Official Signing Key) <centos--key@centos.org>
Package: centos-release--.el6.centos.11.2.i686 (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL () <epel@fedoraproject.org>
Package: epel-release--.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : GeoIP-GeoLite-data-extra-2015.04-.el6.noarch /
Installing : GeoIP-GeoLite-data-2015.04-.el6.noarch /
Installing : libX11-common-1.6.-.el6.noarch /
Installing : nginx-filesystem-1.0.-.el6.noarch /
Installing : freetype-2.3.-.el6_6..i686 /
Installing : fontconfig-2.8.-.el6.i686 /
Installing : geoipupdate-2.2.-.el6.i686 /
Installing : GeoIP-1.6.-.el6.i686 /
Installing : libXau-1.0.-.el6.i686 /
Installing : libxcb-1.9.-.el6.i686 /
Installing : libX11-1.6.-.el6.i686 /
Installing : libXpm-3.5.-.el6.i686 /
Installing : gd-2.0.-.el6.i686 /
Installing : libxslt-1.1.-.el6_3..i686 /
Installing : nginx-1.0.-.el6.i686 /
Verifying : libX11-1.6.-.el6.i686 /
Verifying : nginx-filesystem-1.0.-.el6.noarch /
Verifying : freetype-2.3.-.el6_6..i686 /
Verifying : GeoIP-GeoLite-data-2015.04-.el6.noarch /
Verifying : libxslt-1.1.-.el6_3..i686 /
Verifying : GeoIP-1.6.-.el6.i686 /
Verifying : gd-2.0.-.el6.i686 /
Verifying : libX11-common-1.6.-.el6.noarch /
Verifying : libxcb-1.9.-.el6.i686 /
Verifying : nginx-1.0.-.el6.i686 /
Verifying : GeoIP-GeoLite-data-extra-2015.04-.el6.noarch /
Verifying : libXpm-3.5.-.el6.i686 /
Verifying : libXau-1.0.-.el6.i686 /
Verifying : fontconfig-2.8.-.el6.i686 /
Verifying : geoipupdate-2.2.-.el6.i686 / Installed:
nginx.i686 :1.0.-.el6 Dependency Installed:
GeoIP.i686 :1.6.-.el6 GeoIP-GeoLite-data.noarch :2015.04-.el6 GeoIP-GeoLite-data-extra.noarch :2015.04-.el6 fontconfig.i686 :2.8.-.el6
freetype.i686 :2.3.-.el6_6. gd.i686 :2.0.-.el6 geoipupdate.i686 :2.2.-.el6 libX11.i686 :1.6.-.el6
libX11-common.noarch :1.6.-.el6 libXau.i686 :1.0.-.el6 libXpm.i686 :3.5.-.el6 libxcb.i686 :1.9.-.el6
libxslt.i686 :1.1.-.el6_3. nginx-filesystem.noarch :1.0.-.el6 Complete!

4.设置nginx服务开机自启动

[root@x ~]# chkconfig --level  nginx on

5.安装php和php-fpm

[root@x ~]# yum install -y php php-fpm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.sonn.com
* epel: linux.mirrors.es.net
* extras: centos.sonn.com
* updates: repos.lax.quadranet.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.i686 :5.3.-.el6_6 will be installed
--> Processing Dependency: php-common(x86-) = 5.3.-.el6_6 for package: php-5.3.-.el6_6.i686
--> Processing Dependency: php-cli(x86-) = 5.3.-.el6_6 for package: php-5.3.-.el6_6.i686
--> Processing Dependency: httpd-mmn = for package: php-5.3.-.el6_6.i686
--> Processing Dependency: httpd for package: php-5.3.-.el6_6.i686
---> Package php-fpm.i686 :5.3.-.el6_6 will be installed
--> Running transaction check
---> Package httpd.i686 :2.2.-.el6.centos will be installed
--> Processing Dependency: httpd-tools = 2.2.-.el6.centos for package: httpd-2.2.-.el6.centos.i686
---> Package php-cli.i686 :5.3.-.el6_6 will be installed
---> Package php-common.i686 :5.3.-.el6_6 will be installed
--> Running transaction check
---> Package httpd-tools.i686 :2.2.-.el6.centos will be installed
--> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================
Installing:
php i686 5.3.-.el6_6 updates 1.1 M
php-fpm i686 5.3.-.el6_6 updates 1.2 M
Installing for dependencies:
httpd i686 2.2.-.el6.centos updates k
httpd-tools i686 2.2.-.el6.centos updates k
php-cli i686 5.3.-.el6_6 updates 2.2 M
php-common i686 5.3.-.el6_6 updates k Transaction Summary
=================================================================================================================================================================
Install Package(s) Total download size: 5.9 M
Installed size: M
Downloading Packages:
(/): httpd-2.2.-.el6.centos.i686.rpm | kB :
(/): httpd-tools-2.2.-.el6.centos.i686.rpm | kB :
(/): php-5.3.-.el6_6.i686.rpm | 1.1 MB :
(/): php-cli-5.3.-.el6_6.i686.rpm | 2.2 MB :
(/): php-common-5.3.-.el6_6.i686.rpm | kB :
(/): php-fpm-5.3.-.el6_6.i686.rpm | 1.2 MB :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total kB/s | 5.9 MB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-common-5.3.-.el6_6.i686 /
Installing : php-cli-5.3.-.el6_6.i686 /
Installing : httpd-tools-2.2.-.el6.centos.i686 /
Installing : httpd-2.2.-.el6.centos.i686 /
Installing : php-5.3.-.el6_6.i686 /
Installing : php-fpm-5.3.-.el6_6.i686 /
Verifying : httpd-2.2.-.el6.centos.i686 /
Verifying : php-fpm-5.3.-.el6_6.i686 /
Verifying : php-common-5.3.-.el6_6.i686 /
Verifying : httpd-tools-2.2.-.el6.centos.i686 /
Verifying : php-5.3.-.el6_6.i686 /
Verifying : php-cli-5.3.-.el6_6.i686 / Installed:
php.i686 :5.3.-.el6_6 php-fpm.i686 :5.3.-.el6_6 Dependency Installed:
httpd.i686 :2.2.-.el6.centos httpd-tools.i686 :2.2.-.el6.centos php-cli.i686 :5.3.-.el6_6 php-common.i686 :5.3.-.el6_6 Complete!

6.设置php-fpm服务开机自启动

[root@x ~]# chkconfig --level  php-fpm on

7.安装php其他模块,如mysql相关模块php-mysql,xml相关模块php-xml等

[root@x ~]# yum install -y  php-gd php-mysql php-mbstring php-xml php-mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.sonn.com
* epel: linux.mirrors.es.net
* extras: centos.sonn.com
* updates: repos.lax.quadranet.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-gd.i686 :5.3.-.el6_6 will be installed
---> Package php-mbstring.i686 :5.3.-.el6_6 will be installed
---> Package php-mcrypt.i686 :5.3.-.el6 will be installed
--> Processing Dependency: libmcrypt.so. for package: php-mcrypt-5.3.-.el6.i686
---> Package php-mysql.i686 :5.3.-.el6_6 will be installed
--> Processing Dependency: php-pdo(x86-) for package: php-mysql-5.3.-.el6_6.i686
--> Processing Dependency: libmysqlclient.so.(libmysqlclient_16) for package: php-mysql-5.3.-.el6_6.i686
--> Processing Dependency: libmysqlclient.so. for package: php-mysql-5.3.-.el6_6.i686
---> Package php-xml.i686 :5.3.-.el6_6 will be installed
--> Running transaction check
---> Package libmcrypt.i686 :2.5.-.el6 will be installed
---> Package mysql-libs.i686 :5.1.-.el6_6 will be installed
---> Package php-pdo.i686 :5.3.-.el6_6 will be installed
--> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================================
Installing:
php-gd i686 5.3.-.el6_6 updates k
php-mbstring i686 5.3.-.el6_6 updates k
php-mcrypt i686 5.3.-.el6 epel k
php-mysql i686 5.3.-.el6_6 updates k
php-xml i686 5.3.-.el6_6 updates k
Installing for dependencies:
libmcrypt i686 2.5.-.el6 epel k
mysql-libs i686 5.1.-.el6_6 base 1.2 M
php-pdo i686 5.3.-.el6_6 updates k Transaction Summary
=================================================================================================================================================================
Install Package(s) Total download size: 2.2 M
Installed size: 7.1 M
Downloading Packages:
(/): libmcrypt-2.5.-.el6.i686.rpm | kB :
(/): mysql-libs-5.1.-.el6_6.i686.rpm | 1.2 MB :
(/): php-gd-5.3.-.el6_6.i686.rpm | kB :
(/): php-mbstring-5.3.-.el6_6.i686.rpm | kB :
(/): php-mcrypt-5.3.-.el6.i686.rpm | kB :
(/): php-mysql-5.3.-.el6_6.i686.rpm | kB :
(/): php-pdo-5.3.-.el6_6.i686.rpm | kB :
(/): php-xml-5.3.-.el6_6.i686.rpm | kB :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total kB/s | 2.2 MB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libmcrypt-2.5.-.el6.i686 /
Installing : mysql-libs-5.1.-.el6_6.i686 /
Installing : php-pdo-5.3.-.el6_6.i686 /
Installing : php-mysql-5.3.-.el6_6.i686 /
Installing : php-mcrypt-5.3.-.el6.i686 /
Installing : php-gd-5.3.-.el6_6.i686 /
Installing : php-mbstring-5.3.-.el6_6.i686 /
Installing : php-xml-5.3.-.el6_6.i686 /
Verifying : php-xml-5.3.-.el6_6.i686 /
Verifying : php-pdo-5.3.-.el6_6.i686 /
Verifying : mysql-libs-5.1.-.el6_6.i686 /
Verifying : php-mysql-5.3.-.el6_6.i686 /
Verifying : php-mbstring-5.3.-.el6_6.i686 /
Verifying : php-gd-5.3.-.el6_6.i686 /
Verifying : php-mcrypt-5.3.-.el6.i686 /
Verifying : libmcrypt-2.5.-.el6.i686 / Installed:
php-gd.i686 :5.3.-.el6_6 php-mbstring.i686 :5.3.-.el6_6 php-mcrypt.i686 :5.3.-.el6 php-mysql.i686 :5.3.-.el6_6 php-xml.i686 :5.3.-.el6_6 Dependency Installed:
libmcrypt.i686 :2.5.-.el6 mysql-libs.i686 :5.1.-.el6_6 php-pdo.i686 :5.3.-.el6_6 Complete!

8.完成上面操作后就可以启动nignx和php-fpm服务了

[root@x ~]# service php-fpm start
Starting php-fpm: [ OK ]
[root@x ~]# service nginx start
Starting nginx: [ OK ]

9.接下来我们需要详配置一下nginx服务器,如服务器主目录,用户等

(1).为nginx服务器添加一个专用账号

[root@x html]# useradd www

(2).创建nginx服务主目录并设置访问权限

[root@x html]# mkdir -p /home/www/domain.local/public_html
[root@x html]# mkdir -p /home/www/domain.local/log
[root@x html]# chown -R www.www /home/www/
[root@x html]# chmod /home/www/

(3).添加nginx配置文件,可以复制一份 /etc/nginx/conf.d/virtual.conf ,然后用以下配置覆盖原内容

[root@x html]# cd /etc/nginx/conf.d/
[root@x conf.d]# cp virtual.conf www.conf
[root@x conf.d]# vi www.conf
server {
server_name domain.local; #这里改为你的域名,其他不动
root /home/www/domain.local/public_html;
access_log /home/www/domain.local/log/domain.local-access.log;
error_log /home/www/domain.local/log/domain.local-error.log; location / {
index index.html index.htm index.php;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

配置完成后保存退出,并检查是否有语法错误:

[root@x conf.d]# /etc/init.d/nginx configtest
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

如果你的输出信息和上面相似,则表示配置文件没有问题了。

(4).编辑php-fpm的配置文件,将用于nginx进程的用户和组修改为刚才创建的账号,即www

vi /etc/php-fpm.d/www.conf

在文件中搜索 user = apache 和 group = apache ,改为

user = www
group = www

(5).将nignx运行账号修改为www

[root@x conf.d]# vi /etc/nginx/nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/ user www; #这里修改为你创建的账号

(6).重启php-fpm和nignx服务

[root@x conf.d]# service nginx restart
Stopping nginx: [ OK ]
Starting nginx: [ OK ]
[root@x conf.d]# service php-fpm restart
Stopping php-fpm: [ OK ]
Starting php-fpm: [ OK ]

10.配置防火墙

如果防火墙不开放80端口,是无法访问的,这里需要配置一下:

/sbin/iptables -I INPUT -p tcp --dport  -j ACCEPT
/etc/rc.d/init.d/iptables save

11.至此,关于nginx服务器的基本配置都已经完成了,接下来可以测试一下

在/home/www/domain.local/public_html/ 目录中添加 info.php 文件,并加入如下代码:

<?php
phpinfo();
?>

保存退出后,访问此页面,如果能看到如下界面,则表示配置正确。

参考资料:http://www.lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/

centos 6.5 配置nginx环境的更多相关文章

  1. 在CentOS/Windows下配置Nginx(以及踩坑)

    在CentOS/Windows下配置Nginx(以及踩坑) 1. 序言 因为这类文章网上比较多,实际操作起来也大同小异,所以我并不会着重于详细配置方面,而是将我配置时踩的坑写出来. 2. CentOS ...

  2. CentOS 7 下配置 Nginx + PHP7.1 + MariaDB 以及 Laravel 框架 2018.3.11

    CentOS 7 下配置 Nginx + PHP7.1 + MariaDB 以及 Laravel 框架 阿里云服务器的选择 当然是选择学生优惠啦.这里阿里云还提供了轻量级服务器这个选项,可以预装 LA ...

  3. CentOS 7 下配置 Nginx + PHP7.1 + MariaDB 以及 Laravel 框架

    <!doctype html> CentOS 7 下配置 Nginx + PHP7.1 + MariaDB 以及 Laravel 框架.mdhtml {overflow-x: initia ...

  4. Linux(CentOS)上面搭建Nginx环境

    总体上来说,Linux 这个系统其实挺好用的 除了看不见界面,但是用起来确实是比Window好用太多了,不废话了,直接说搭建环境的步骤! 安装Nginx 编译运行时的环境 参考博客:http://ww ...

  5. CentOS 7 安装 配置 Nginx + PHP

    . CentOS 7 下配置 yum 安装 Nginx. 进入/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo: cd /etc/yum.repos.d/ vim ngi ...

  6. CentOS中安装配置Nginx

    一.安装Nginx '首先我们需要在nginx官网中下载nginx安装包,在这就下载最新版 nginx-1.13.7版本 下载完成以后我们进入下载页面进行查看 下载文件目录为 home/userNam ...

  7. CentOS安装、配置Nginx反向代理

    添加Nginx存储库 sudo yum install epel-release 安装Nginx sudo yum install nginx 启动Nginx sudo systemctl start ...

  8. centos 为OPENJDK配置JAVA_HOME环境变量,安装MAVEN

    1.安装开发者工具包 yum install java--openjdk-devel -y 2.配置环境变量 vim /etc/profile export JAVA_HOME=/usr/lib/jv ...

  9. LNMP笔记:阿里云32位 CentOS 5.4 配置 LNMP环境

    最近比较郁闷的是 WordPress大学 服务器故障,由于诸多原因没及时处理,导致10多天无法访问.倡萌也是刚接触服务器环境配置,维护的确力不从心,没办法排查出错误根源,所以只好重置系统盘,重新配置L ...

随机推荐

  1. 干货-Spring3.2.3的所有注解

    在用到Spring3的时候,我们需要对耦合的struts2的Action层或者SpringMVC的Controller层加上注解,一般是@Controller和@RequestMapping 看到这里 ...

  2. PHP jsonencode unicode 存储问题

    首先是这样的,因为输入的字符串的里面有德语的字符,如下: 当我存储到数据库之后,再用json_encode获取到数据库内的这些字符时,出问题了. 直接encode一个字符串"püüäöä&q ...

  3. ES6数组新增方法总结

    关于数组中forEach() .map().filter().reduce().some().every()的总结 let arr = [1, 2, 3, 4, 5] // forEach遍历数组 a ...

  4. Mybatis学习笔记7 - select查询的相关属性使用

    1.当接口的返回类型是集合List时,resultType要写集合中元素的类型 示例如下: 接口定义: package com.mybatis.dao; import com.mybatis.bean ...

  5. shell中获取本机ip地址

    shell中获取本机ip地址 方法一: /sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr ...

  6. fileupload NPOI导入EXECL数据

    fileupload JS @section scripts{ <script src="~/Content/js/fileupload/vendor/jquery.ui.widget ...

  7. 基于vue-cli 将webpack3 升级到 webpack4 配置

       升级webpack4前 先删除之前的webpack, babel-loader  下载 webpack npm i -D webpack@4 webpack-cli@3 webpack-dev- ...

  8. es6-Set和Map数据结构

    Set 基本用法 ES6 提供了新的数据结构 Set.它类似于数组,但是成员的值都是唯一的,没有重复的值. Set 本身是一个构造函数,用来生成 Set 数据结构. const s = new Set ...

  9. 移动端absolute元素居中

    <div class="db"> <div class="dm"></div> </div> .db{ widt ...

  10. Debug get/set property

    1. Select "Debug -> Windows -> Breakpoints" from VS menu. 2. Click "New -> B ...