Linux--YUM 安裝 nginx php mysql

來源:互聯網
上載者:User

標籤:

Linux--YUM 安裝 nginx php mysql(2011-11-13 11:27:14) 轉載
標籤:雜談 分類: Linux
1.先建立一個 repo# vi /etc/yum.repos.d/centos.21andy.com.repo放入如下內容[21Andy.com]name=21Andy.com Packages for Enterprise Linux 5 - $basearchbaseurl=http://www.21andy.com/centos/5/$basearch/enabled=1gpgcheck=0protect=12.啟用 EPEL repo32位機器啟用:rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm64位機器啟用:rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm 附:查看Linux版本及CPU位元:查看系統版本:lsb_release -a查看CPU位元:getconf LONG_BIT 3.匯入keyrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL4.一鍵安裝yum install nginx php-fpm mysql-server如果 nginx 你要用 0.7.65 最新穩定版,把yum -y install nginx換成yum -y install nginx-stable就可以了附:完整的安裝yum -y updateyum -y mysql-serverservice mysqld startmysqladmin -u root password rootservice mysqld stopyum -y install nginx php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator# APC 和 eAccelerator 有衝突,2選1yum -y install php-pecl-apc或只要一句yum -y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator 最後只要 yum -y update 一下,全是最新的5.開機啟動chkconfig --level 345 mysqld onchkconfig --level 345 php-fpm onchkconfig --level 345 nginx on 補充:所有的設定檔都在 /etc 目錄下,包括 nginx, php-fpm, mysql 的設定檔,請自行尋找設定. 6.配置注意:fastcgi_params 要加入這一行# vim /etc/nginx/fastcgi_paramsfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; nginx配置:在/etc/nginx/nginx.conf 的 http 節點下的 server 下(所有要支援 php 的 server)添加:location ~ .*\.(php|php5)?$ {   fastcgi_pass   unix:/tmp/php-cgi.sock;   fastcgi_index index.php;   include fastcgi_params;            root   /home/wwwroot/;            index  index.html index.htm index.php;        }php配置然後,更改/etc/php-fpm.conf 檔案,將listen_address 的值設定成如下(和上面的nginx配置一樣):<value name="listen_address"> /tmp/php-cgi.sock</value> 7.重啟 nginx, php-fpm service nginx restartservice php-fpm restart

Linux--YUM 安裝 nginx php mysql

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.