1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      在CentOS6.2上安裝Nginx+PHP5(PHP-FPM)+MySQL

      1.使用非官方軟件源

      麥蓋提網(wǎng)站制作公司哪家好,找成都創(chuàng)新互聯(lián)!從網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、響應(yīng)式網(wǎng)站開發(fā)等網(wǎng)站項目制作,到程序開發(fā),運營維護(hù)。成都創(chuàng)新互聯(lián)自2013年起到現(xiàn)在10年的時間,我們擁有了豐富的建站經(jīng)驗和運維經(jīng)驗,來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選成都創(chuàng)新互聯(lián)

      rpm --import https://fedoraproject.org/static/0608B895.txt rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm

      rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
      rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

      yum install yum-priorities
      編輯/etc/yum.repos.d/epel.repo文件,啟用這個源,使其優(yōu)先級高

      [epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=1 priority=10 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [...]

      同樣的,也需要對remi源進(jìn)行優(yōu)先級編輯和啟用

      [remi] name=Les RPM de remi pour Enterprise Linux $releasever - $basearch #baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/ mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror enabled=1 priority=10 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi failovermethod=priority

      [remi-test]
      name=Les RPM de remi en test pour Enterprise Linux $releasever – $basearch
      #baseurl=http://rpms.famillecollet.com/enterprise/$releasever/test/$basearch/
      mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/test/mirror
      enabled=0
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

      2.安裝MYSQL

      yum install mysql mysql-server

      設(shè)置系統(tǒng)啟動時,在235的運行級運行mysqld守護(hù)進(jìn)程

      chkconfig --levels 235 mysqld on /etc/init.d/mysqld start

      需要按系統(tǒng)配置優(yōu)化my.cnf文件,之后設(shè)置root的密碼,否則任何人都能訪問你的數(shù)據(jù)庫。

      [root@server1 ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we\'ll need the current password for the root user. If you\'ve just installed MySQL, 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): < -- ENTER OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] <-- ENTER New password: <-- yourrootsqlpassword Re-enter new password: <-- yourrootsqlpassword Password updated successfully! Reloading privilege tables.. ... Success! 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? [Y/n] <-- ENTER ... 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] <-- ENTER ... 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? [Y/n] <-- ENTER - 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] <-- ENTER ... Success! Cleaning up... All done! If you\'ve completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! [root@server1 ~]#

      3.安裝nginx

      nginx在epel源中有包,可以直接yum安裝。

      yum install nginx

      之后創(chuàng)建nginx的系統(tǒng)啟動連接并啟動它

      chkconfig --levels 235 nginx on service nginx start

      之后在瀏覽器中打開服務(wù)器的IP地址,應(yīng)該能看到nginx的歡迎頁面。

      4.安裝php和php-fpm

      yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy

      其中使用的php-x擴展,可以根據(jù)自己的需要添加。之后,編輯php.ini文件,修改cgi.fix_pathinfo為0。為什么要這么做?請查閱該文檔。

      vi /etc/php.ini

      cgi.fix_pathinfo = 0 date.timezone = "Asia/Shanghai"

      5.配置nginx

      關(guān)于配置nginx可以查閱官方的兩個例子,例子1,例子2。

      6.讓PHP-FPM使用unix套接字

      默認(rèn)情況下,php-fpm使用127.0.0.1:9000監(jiān)聽請求,當(dāng)然也可以使用unix套接字,這樣可以避免TCP的額外流量。編輯/etc/php-fpm.d/www.conf文件就可以了。

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

      [...] ;listen = 127.0.0.1:9000 listen = /tmp/php5-fpm.sock [...]

      之后,重啟php-fpm。

      service php-fpm restart

      之后編輯nginx的虛擬主機配置文件,將fastcgi_pass這一行內(nèi)容改為unix套接字。

      [...] location ~ .php$ { try_files $uri =404; root /usr/share/nginx/html; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } [...]

      最后,重啟nginx。

      service nginx reload


      本文名稱:在CentOS6.2上安裝Nginx+PHP5(PHP-FPM)+MySQL
      分享路徑:http://www.ef60e0e.cn/article/choiop.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
        1. <ul id="0c1fb"></ul>

          <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
          <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

          宁化县| 天全县| 靖州| 修武县| 灵丘县| 天门市| 桃园县| 铅山县| 云南省| 克东县| 乌兰察布市| 阿拉尔市| 武邑县| 锡林郭勒盟| 友谊县| 安丘市| 福建省| 丽江市| 盈江县| 揭阳市| 博湖县| 兴业县| 儋州市| 疏勒县| 云霄县| 沈丘县| 鲜城| 柘城县| 惠东县| 贵定县| 习水县| 庄浪县| 商丘市| 渭源县| 扶绥县| 修文县| 汾阳市| 鄂伦春自治旗| 廉江市| 五指山市| 韩城市|