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

歡迎來(lái)到夢(mèng)飛科技

服務(wù)器租用

當(dāng)前優(yōu)惠活動(dòng):

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

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

1 劈頭說(shuō)明

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

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

2 安裝 MySQL 5.7

安裝 MySQL 運(yùn)行呼吁:

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

你會(huì)被要求提供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ù)庫(kù)處事器,并刪除匿名用戶和測(cè)試數(shù)據(jù)庫(kù),運(yùn)行mysql_secure_installation呼吁。

mysql_secure_installation

你會(huì)問這些問題:

[email protected]:~# mysql_secure_installation

掩護(hù)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地點(diǎn)或主機(jī)名到欣賞器(譬喻http://192.168.1.100),你應(yīng)該看到如下頁(yè)面:

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

在Ubuntu16.04的默認(rèn)nginx的文檔根目次為/var/www/html

4 安裝 PHP 7

我們可以通過使nginx的PHP事情PHP-FPM(PHP-FPM(FastCGI歷程打點(diǎn)器)是為任何局限的網(wǎng)站,尤其是忙碌的網(wǎng)站有用的一些附加成果的替代PHP的FastCGI實(shí)現(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)略 (你可以點(diǎn)擊官方教程: http://wiki.nginx.org/NginxFullExample 或:http://wiki.nginx.org/NginxFullExample2)

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

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

虛擬主機(jī)處事器{}容器界說(shuō)。默認(rèn)的虛擬主機(jī)是在文件中界說(shuō)的/etc/nginx/sites-available/default – 讓我們來(lái)修改它,如下所示:

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 _; 使這是一個(gè)默認(rèn)捕獲所有虛擬主機(jī)(雖然,你可以同時(shí)喜歡這里www.example.com指定主機(jī)名)。

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

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

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

service nginx reload

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

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

配置 cgi.fix_pathinfo=0:

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

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

主站蜘蛛池模板: 津南区| 罗定市| 定襄县| 太谷县| 大庆市| 广平县| 柳州市| 绩溪县| 日喀则市| 新泰市| 扶沟县| 涟源市| 台江县| 盐山县| 浏阳市| 江达县| 灵山县| 博爱县| 闽清县| 泰来县| 遂平县| 宁远县| 津市市| 郯城县| 福鼎市| 九江市| 永和县| 海丰县| 二手房| 井研县| 奎屯市| 琼海市| 张家口市| 盈江县| 贵溪市| 阳山县| 洱源县| 阿克陶县| 遵义市| 民勤县| 大名县|