午夜无码人妻aⅴ大片色欲张津瑜,国产69久久久欧美黑人A片,色妺妺视频网,久久久久国产综合AV天堂

阿里云CentOS7.4配置Nginx、PHP、Mariadb

CentOS 7.4 基本環(huán)境配置 添加 yum 第三方源

常用的第三方源有兩個(gè):EPEL 和 IUS,可 查看到最新的安裝方法

創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括上街網(wǎng)站建設(shè)、上街網(wǎng)站制作、上街網(wǎng)頁制作以及上街網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,上街網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到上街省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!自動(dòng)安裝

curl -L https://setup.ius.io | sh 手動(dòng)安裝(用了自動(dòng)安裝,這個(gè)就省略)

$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm $ wget 7.iuscommunity.org/ius-release.rpm $ rpm -ivh epel-release-latest-7.noarch.rpm $ rpm -ivh ius-release.rpm

安裝完成更新yum源緩存

$ yum clean all $ yum makecache 安裝開發(fā)工具包

$ yum -y groupinstall "Development Tools" 升級(jí)系統(tǒng)軟件包

$ yum -y upgrade 安裝zsh和autojump(可選)

//安裝zsh前要檢查git是否安裝,如果沒有要進(jìn)行安裝 //$ yum install git $ yum install -y zsh $ curl -L tall.ohmyz.sh | sh $ chsh -s /bin/zsh //修改shell為zsh $ yum install -y autojump $ yum install -y autojump-zsh

修改.zshrc文件,設(shè)置zsh插件和樣式

#樣式 ZSH_THEME="ys"或者"af-magic" #插件 plugins=(git extract sudo autojump) #處理命令行no match錯(cuò)誤 setopt no_nomatch 安裝 jemalloc

$ yum -y install jemalloc 安裝 redis

$ yum -y install redis

啟動(dòng)redis服務(wù)并設(shè)置為自動(dòng)啟動(dòng)

$ systemctl enable redis $ systemctl start redis 安裝 Mariadb 5.5.56 安裝 mariadb

$ yum -y install mariadb mariadb-server 將mariadb的數(shù)據(jù)目錄移動(dòng)到自定義位置

創(chuàng)建mariadb數(shù)據(jù)目錄

# -p 參數(shù)可以自動(dòng)生成完整路徑,比如上面不存在/data目錄,會(huì)自動(dòng)創(chuàng)建 mkdir -p /data/mariadb #修改目錄所有者 chown -R mysql:mysql /data/mariadb

配置 mariadb

#備份 mariadb-libs生成的my.cnf mv /etc/my.cnf /etc/my.cnf.libs.back #從mariadb復(fù)制配置文件 cp /usr/share/mysql/my-large.cnf /etc/my.cnf

修改 /etc/my.cnf

[mysqld] #設(shè)置數(shù)據(jù)目錄 datadir=/data/mariadb #添加字符集設(shè)置utf8 # setting character set init_connect = \'SET NAMES utf8\' character-set-server = utf8 collation-server = utf8_unicode_ci skip-character-set-client-handshake #修改thread_concurrentcy為CPU數(shù)量*2 thread_concurrency = 2 #添加mysqld_safe設(shè)置 [mysqld_safe] log-error = /var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid #添加jemalloc支持 malloc-lib=/usr/lib64/libjemalloc.so.1 #最末尾添加包含配置目錄 !includedir /etc/my.cnf.d

啟動(dòng) mariadb

$ systemctl start mariadb

設(shè)置mariadb服務(wù)開機(jī)啟動(dòng)

$ systemctl enable mariadb

初始化mariadb

#修改mysql_secure_installation,否則會(huì)出現(xiàn)找不到sock文件的問題 #找到maike_config函數(shù)在有[mysql]這句下方增加 echo "socket=/data/mariadb/mysql.sock" << $config #保存退出 $ mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we\'ll need the current password for the root user. If you\'ve just installed MariaDB, and you haven\'t set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB 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? [Y/n] 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? [Y/n] y ... Success! By default, MariaDB 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? [Y/n] 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? [Y/n] y ... Success! Cleaning up... All done! If you\'ve completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! 安裝 Nginx

$ yum -y install nginx #設(shè)置開機(jī)啟動(dòng) $ systemctl enable nginx

修改systemctl啟動(dòng)設(shè)置,避免無法找到pid文件的問題

$ mkdir -p /etc/systemd/system/nginx.service.d $ printf "[Service]nExecStartPost=/bin/sleep 0.1n" > /etc/systemd/system/nginx.service.d/override.conf $ systemctl daemon-reload

啟動(dòng) nginx

$ systemctl start nginx 安裝 PHP 7.1

$ yum -y install php71u-fpm php71u-fpm-nginx $ yum -y install php71u-mbstring php71u-common php71u-gd php71u-mcrypt $ yum -y install php71u-mysqlnd php71u-xml php71u-cli php71u-devel $ yum -y install php71u-pecl-redis php71u-opcache

修改/etc/nginx/conf.d/php-fpm.conf

upstream php-fpm { #server 127.0.0.1:9000; server unix:/run/php-fpm/www.sock; }

修改/etc/php-fpm.d/www.conf

#修改php-fpm進(jìn)程用戶 user = nginx group = nginx #修改網(wǎng)絡(luò)方式 ;listen = 127.0.0.1:9000 listen = /run/php-fpm/www.sock #修改生成sock的用戶 listen.owner = nginx listen.group = nginx listen.mode = 0666

啟動(dòng)php-fpm

$ systemctl enable php-fpm $ systemctl start php-fpm 配置nginx虛擬主機(jī)

設(shè)置虛擬主機(jī)

# 添加虛擬主機(jī)配置目錄 $ mkdir -p /etc/nginx/vhosts.d

修改nginx配置文件/etc/nginx/nginx.conf

# 在server配置后面添加 include /etc/nginx/vhosts.d/*.conf;

到/etc/nginx/vhosts.d目錄創(chuàng)建 aaa.conf文件,假設(shè)www.aaa.com為域名

server { listen 80; server_name www.aaa.com; access_log /data/aaa/logs/access.log main; error_log /data/aaa/logs/error.log; charset utf-8; location / { try_files $uri $uri/ /index.php?q=$uri&$args; root /data/aaa/www; index index.php index.html index.htm; } # pass the PHP scripts to FastCGI server listening on Unix socket location ~ .php$ { root /data/aaa/www; fastcgi_pass php-fpm; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # deny access to .htaccess files, if Apache\'s document root # concurs with nginx\'s one location ~ /.ht { deny all; } }

創(chuàng)建虛擬主機(jī)網(wǎng)頁存放目錄和日志目錄

$ mkdir -p /data/aaa/{logs,www}

創(chuàng)建一個(gè)測試文件

echo "<?php phpinfo();" > /data/aaa/www/index.php

重啟動(dòng)nginx和php-fpm

$ systemctl restart nginx $ systemctl restart php-fpm

用瀏覽器訪問域名看看是否看到phpinfo頁面

當(dāng)前題目:阿里云CentOS7.4配置Nginx、PHP、Mariadb
文章轉(zhuǎn)載:http://www.ekvhdxd.cn/article36/cjchsg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)品牌網(wǎng)站建設(shè)、做網(wǎng)站、定制開發(fā)域名注冊(cè)、網(wǎng)站營銷

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)