欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到夢飛科技

服務(wù)器租用

當前優(yōu)惠活動:

Ubuntu 16.04 LTS系統(tǒng)安裝配置Nginx/PHP 7/MySQL 5.7環(huán)境

Nginx (讀”engine x”) 是一款免費、開源的高機能 HTTP 處事。Nginx 不變、富厚的成果集、設(shè)置簡樸、資源耗損低。本教程先容了如何通過PHP7支持(通過PHP-FPM)和MySQL5.7支持(LEMP= LINUX + nginx(發(fā)音為“engine x”)+ MySQL+ PHP)在Ubuntu 16.04處事器上安裝Nginx處事器。

1 劈頭說明

在本教程中,我利用的IP 地點192.168.1.100,主機名server1.example.com。這些配置大概與你的差異,所以你不得不在適當環(huán)境下改換他們。

我運行的所有步調(diào)在本教程中利用root權(quán)限,所以必然要確保你以root身份登錄:

2 安裝 MySQL 5.7

安裝 MySQL 運行呼吁:

apt-get -y install mysql-server mysql-client

你會被要求提供MySQL的root用戶暗碼 :

New password for the MySQL “root” user: <– yourrootsqlpassword
Repeat password for the MySQL “root” user: <– yourrootsqlpassword

Ubuntu 16.04 LTS系統(tǒng)安裝設(shè)置Nginx/PHP 7/MySQL 5.7情況

為了確保數(shù)據(jù)庫處事器,并刪除匿名用戶和測試數(shù)據(jù)庫,運行mysql_secure_installation呼吁。

mysql_secure_installation

你會問這些問題:

[email protected]:~# mysql_secure_installation

掩護MySQL處事器陳設(shè)。

Enter password for user root: <– Enter the MySQL root password

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: <– Press y if you want this function or press Enter otherwise.
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) : <– Press enter

… skipping.
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? (Press y|Y for Yes, any other key for No) : <– 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? (Press y|Y for Yes, any other key for No) : <– 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? (Press y|Y for Yes, any other key for No) : <– 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? (Press y|Y for Yes, any other key for No) : <– y
Success.

All done!

MySQL is secured now.

3 安裝 Nginx

在你已經(jīng)安裝了Apache2的話,那么利用這些呼吁先刪除再安裝nginx:

service apache2 stop
update-rc.d -f apache2 remove
apt-get remove apache2

Ubuntu16.04有Nginx安裝包,我們可以安裝。

apt-get -y install nginx

Start nginx afterwards:

service nginx start

輸入您的Web處事器的IP地點或主機名到欣賞器(譬喻http://192.168.1.100),你應(yīng)該看到如下頁面:

Ubuntu 16.04 LTS系統(tǒng)安裝設(shè)置Nginx/PHP 7/MySQL 5.7情況

在Ubuntu16.04的默認nginx的文檔根目次為/var/www/html

4 安裝 PHP 7

我們可以通過使nginx的PHP事情PHP-FPM(PHP-FPM(FastCGI歷程打點器)是為任何局限的網(wǎng)站,尤其是忙碌的網(wǎng)站有用的一些附加成果的替代PHP的FastCGI實現(xiàn)),我們安裝如下:

apt-get -y install php7.0-fpm

5 設(shè)置 nginx

打開設(shè)置文件 /etc/nginx/nginx.conf:

nano /etc/nginx/nginx.conf

設(shè)置是很容易領(lǐng)略 (你可以點擊官方教程: http://wiki.nginx.org/NginxFullExample 或:http://wiki.nginx.org/NginxFullExample2)

首先(這是可選)調(diào)解keepalive_timeout到一個公道的值:

[...]
    keepalive_timeout   2;
[...]

虛擬主機處事器{}容器界說。默認的虛擬主機是在文件中界說的/etc/nginx/sites-available/default – 讓我們來修改它,如下所示:

nano /etc/nginx/sites-available/default

[...]
server {
 listen 80 default_server;
 listen [::]:80 default_server;
 # SSL configuration
 #
 # listen 443 ssl default_server;
 # listen [::]:443 ssl default_server;
 #
 # Note: You should disable gzip for SSL traffic.
 # See: https://bugs.debian.org/773332
 #
 # Read up on ssl_ciphers to ensure a secure configuration.
 # See: https://bugs.debian.org/765782
 #
 # Self signed certs generated by the ssl-cert package
 # Don't use them in a production server!
 #
 # include snippets/snakeoil.conf;
 root /var/www/html;
 # Add index.php to the list if you are using PHP
 index index.html index.htm index.nginx-debian.html;
 server_name _;
 location / {
 # First attempt to serve request as file, then
 # as directory, then fall back to displaying a 404.
 try_files $uri $uri/ =404;
 }
 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 #
 location ~ \.php$ {
 include snippets/fastcgi-php.conf;
 # With php7.0-cgi alone:
 # fastcgi_pass 127.0.0.1:9000;
 # With php7.0-fpm:
 fastcgi_pass unix:/run/php/php7.0-fpm.sock;
 }
 # deny access to .htaccess files, if Apache's document root
 # concurs with nginx's one
 #
 location ~ /\.ht {
  deny all;
 }
}
[...]

server_name _; 使這是一個默認捕獲所有虛擬主機(雖然,你可以同時喜歡這里www.example.com指定主機名)。

根目次 /var/www/html;意味著文檔根目次/var/www/html.

PHP的重要構(gòu)成部門位置 ~ \.php$ {} stanza. 打消注釋它來啟用它。

此刻生存文件并從頭加載nginx:

service nginx reload

下一步打開 /etc/php/7.0/fpm/php.ini…

nano /etc/php/7.0/fpm/php.ini

配置 cgi.fix_pathinfo=0:

夢飛科技 - 全球數(shù)據(jù)中心基礎(chǔ)服務(wù)領(lǐng)先供應(yīng)商

Copyright © 2003-2019 MFISP.COM. 國外服務(wù)器租用 IDC公司 版權(quán)所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 延寿县| 青铜峡市| 筠连县| 安丘市| 应城市| 司法| 仁布县| 黑河市| 静宁县| 天柱县| 鄂伦春自治旗| 万载县| 新营市| 淮滨县| 中宁县| 韶关市| 离岛区| 无锡市| 施秉县| 金平| 临沭县| 仪陇县| 南投县| 永春县| 桂东县| 壤塘县| 文山县| 临猗县| 新河县| 阿尔山市| 古浪县| 阳曲县| 敦化市| 磐安县| 肃宁县| 津南区| 昌吉市| 彭水| 大姚县| 嘉祥县| 柳林县|