欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Centos7.2/Linux的下搭建LAMP環(huán)境的搭建和配置虛擬主機-創(chuàng)新互聯(lián)

LAMP環(huán)境:LINUX + Apahce的+ MYSQL + PHP的網(wǎng)絡服務器環(huán)境。

創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設,克州企業(yè)網(wǎng)站建設,克州品牌網(wǎng)站建設,網(wǎng)站定制,克州網(wǎng)站建設報價,網(wǎng)絡營銷,網(wǎng)絡優(yōu)化,克州網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力。可充分滿足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學習、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。

(一)。準備工作

1.下載并安裝CentOS7.2,配置好網(wǎng)絡環(huán)境,確保centos能上網(wǎng),可以獲取到y(tǒng)um源(阿里云服務器已配置好,不需要自己動手)
2。配置防火墻,開啟21,80,3306端口。 CentOS 7.0默認使用的是防火墻作為防火墻,這里改為iptables 防火墻。停止防火墻服務輸入命令systemctl stop firewalld.service 禁止防火墻開機啟動輸入命令systemctl disable firewalld.service 安裝iptables 防火墻輸入命令:yum install iptables-services 編輯防火墻配置文件輸入命令vim / etc / sysconfig / iptables 打開后,在-A INPUT -p tcp -m state -state NEW -m tcp -dport 22 -j ACCEPT下方添加:-A INPUT -p tcp -m state -state NEW -m tcp -dport 80 -j ACCEPT -A INPUT -p tcp -m state -state NEW -m tcp -dport 3306 -j ACCEPT 保存退出,最后重啟防火墻使配置生效systemctl restart iptables.service 設置防火墻開機啟動systemctl啟用iptables.service










  1. 關閉seinux(阿里云已配置好)
    修改配置文件
    vi / etc / selinux / config

SELINUX =強制#注釋掉
SELINUXTYPE =有針對性#注釋掉
SELINUX =禁用#增加
:wq!#退出保存
使配置|立即生效

setenforce 0

(二)。安裝燈環(huán)境
1.安裝apahce (http://www.1jaz.com)
yum install httpd 
設置apache開機啟動
systemctl啟用httpd.service 
重啟apache服務系統(tǒng)
重啟httpd.service

ps:可能會用到的:
systemctl start httpd.service#啟動apache 
systemctl stop httpd.service #dail止apache 
systemctl restart httpd.service#重啟apache 
systemctl enable httpd.service#settings置apache開機啟動

2.安裝mysql(可不安裝)
由于yum源上沒有mysql-server。所以必須去官網(wǎng)下載,這里我們用wget命令,直接獲取。依次輸入下方三條命令:    
wget http://dev.mysql.com/get /mysql-community-release-el7-5.noarch.rpm    http://www.1jaz.com
rpm -ivh mysql-community-release-el7-5.noarch.rpm 
yum install mysql-community-server

安裝完成后重啟mysql,輸入命令:
systemctl restart mysqld.service

此時mysql的root用戶沒有密碼:    
[root @linuxidc -web linuxidc] #mysql -u root

設置msyql密碼為123456 
mysql>為'root'設置密碼@'localhost'=密碼('123456');

遠程連接設置,所有以root賬號連接的遠程用戶,設其密碼為123456 
mysql>授予所有權限。來自'123456'標識的@'%';

更新權限
mysql>刷新權限;

退出,mysql 
退回回車

3.安裝php輸入命令:
yum install php 
安裝PHP組件,使用PHP支持mysql輸入命令:
yum install php-mysql php-gd libjpeg * php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php -bcmath php- 
mhash 
重啟對應服務systemctl重啟mysqld.service 
systemctl restart httpd.service

(三。)配置虛擬主機
1.創(chuàng)建自定義網(wǎng)站根目錄
mkdir / home / webroot 
2.打開httpd主配置文件
vim /etc/httpd/conf/httpd.conf 
3.找到以下代碼


AllowOverride無

# Allow open access:Require all granted


將其改為:


AllowOverride All

# Allow open access:Require all granted


4.找到以下代碼


# Possible values for the Options directive are "None", "All",# or any combination of:#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews## Note that "MultiViews" must be named *explicitly* --- "Options All"# doesn't give it to you.## The Options directive is both complicated and important.  Please see# http://httpd.apache.org/docs/2.4/mod/core.html#options# for more information.#Options Indexes FollowSymLinks## AllowOverride controls what directives may be placed in .htaccess files.# It can be "All", "None", or any combination of the keywords:#   Options FileInfo AuthConfig Limit#AllowOverride None## Controls who can get stuff from this server.#Require all granted


改為[Options -Indexes為禁止訪問目錄列表]:


# Possible values for the Options directive are "None", "All",# or any combination of:#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews## Note that "MultiViews" must be named *explicitly* --- "Options All"# doesn't give it to you.## The Options directive is both complicated and important.  Please see# http://httpd.apache.org/docs/2.4/mod/core.html#options# for more information.#Options Indexes FollowSymLinksOptions -Indexes## AllowOverride controls what directives may be placed in .htaccess files.# It can be "All", "None", or any combination of the keywords:#   Options FileInfo AuthConfig Limit#AllowOverride None## Controls who can get stuff from this server.#Require all granted


5.追加自動壓縮網(wǎng)頁代碼功能,在主配置文件繼續(xù)加入
添加Gzip


SetOutputFilter DEFLATE 
SetEnvIfNoCase Request_URI。(?:gif | jpe?g | png)$ no-gzip不變
SetEnvIfNoCase Request_URI。(?:exe | t?gz | zip | bz2 | sit | rar)$ no-gzip不變
SetEnvIfNoCase Request_URI。(?:pdf | mov | avi | mp3 | mp4 | rm)$ no-gzip不要改變
AddOutputFilterByType DEFLATE text / 
AddOutputFilterByType DEFLATE application / ms application / vnd * application / postscript application / javascript appliction / x-javascript 
AddOutputFilterByType DEFLATE application / x-httpd-php application / x-httpd-fastphp

6.建立一個項目目錄
mkdir / home / webroot / demo 
7.進入apache子配置文件夾,建立對應的項目配置文件
cd /etc/httpd/conf.d 
vim demo.conf 
8.在打開的配置文件中,輸入以下代碼


DocumentRoot“/ home / webroot / demo” 
ServerName你的公網(wǎng)IP

ps:如果已經(jīng)申請下域名,則輸入以下代碼(上方作者),允許r-collar.com www.hehaoke.com兩種方式的域名訪問,并禁止直接訪問服務器IP的方式訪問項目

ServerName你的公網(wǎng)IP

訂單允許,拒絕
所有人拒絕



DocumentRoot“/ home / webroot / demo” 
ServerName r-collar.com

DocumentRoot“/ home / webroot / demo” 
ServerName www.hehaoke.com

9.重啟apache 
systemctl重啟httpd.service

注:此方式是基于端口實現(xiàn)的虛擬主機,如要添加新端口來訪問新項目,還需要注意去主配置文件httpd.conf中給新端口添加監(jiān)聽,并在防火墻中允許新端口的訪問。

更多:http://www.1jaz.com

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

當前文章:Centos7.2/Linux的下搭建LAMP環(huán)境的搭建和配置虛擬主機-創(chuàng)新互聯(lián)
網(wǎng)頁網(wǎng)址:http://www.chinadenli.net/article14/dcppge.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供ChatGPT網(wǎng)站導航自適應網(wǎng)站外貿(mào)建站用戶體驗靜態(tài)網(wǎng)站

廣告

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

外貿(mào)網(wǎng)站建設