centos中快速搭建Magento&Makingware Nginx主機環境

來源:互聯網
上載者:User


centos中快速搭建Magento&Makingware Nginx主機環境 本文主要使用yum方式安裝適應magento啟動並執行LNMP主機環境。*適用於純淨版Centos, 如果有httpd之類的進程請先停止httpd。本文安裝完後為 nginx/1.2.2 Mysql5.5 PHP5.3.14 APC 3.1.9 匯入外部軟體庫請選擇對應的centos版本,別錯了哦不確定版本及32還是64可以使用一下命令檢查more /etc/redhat-release (查看centos版本)uname -r(查看核心位元) centos-5 32位:1rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm2rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm3  www.2cto.com  rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm centos-5 64位:1rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm2rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-10.ius.el5.noarch.rpm3rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm  www.2cto.com  centos 6 在下面尋找對應的包 使用  rpm -Uvh xxx 提示衝突可使用   rpm -e 對應的衝突包軟體庫:http://dl.iuscommunity.org/pub/ius/stable/Redhat/Nginx : http://nginx.org/packages/centos/ vi /etc/yum.repos.d/ius.repo,以下行注釋:1mirrorlist=http://dmirr.iuscommunity.org/mirrorlist?repo=ius-el5&arch=$basearch以下行刪除注釋:1#baseurl=http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/$basearch 更新yum1yum -y update使用yum安裝所需要的程式/庫1yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers  www.2cto.com  安裝php相關外掛程式1yum install php53u-gd php53u-xml php53u-mysql php53u-mcrypt php53u-mbstring php53u-pear pcre-devel php53u-devel pecl方式安裝apc1pecl install apc 添加apc擴充到php中vim /etc/php.d/apc.ini下面代碼僅供參考根據具體配置來修改01extension = apc.so02[apc]03apc.enabled = 104apc.shm_size = 256M05apc.ttl = 720006  www.2cto.com  apc.user_ttl  = 720007apc.num_files_hint = 1024008apc.max_file_size = 128M09apc.stat = 010apc.include_once_override = 1 配置nginxvi /etc/nginx/conf.d/default.conf也可以在 /etc/nginx/conf.d/目錄下面建立.conf檔案參考( 適合magento 的設定檔)其他系統可參考:)01server {02    listen       80;03    server_name  demo.makingware.com;#你的網域名稱04  www.2cto.com   05    root  /var/www/demo.makingware.com;#你的目錄06    index index.php index.html index.htm;07    location / {08    if (-f $request_filename) {09      expires 30d;10      break;11    }12    if (!-e $request_filename) {13      rewrite ^(.+)$ /index.php last;14    }15  }16  location ~ \.php$ {17 18    include       fastcgi_params;19    fastcgi_pass  127.0.0.1:9000;20    fastcgi_index index.php;21    fastcgi_param SCRIPT_NAME $fastcgi_script_name;22    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;23  www.2cto.com    }24  location /app/etc {25    deny all;26  }27} 啟動lnmpchkconfig php-fpm onchkconfig nginx onchkconfig mysqld onservice php-fpm startservice nginx startservice mysqld start 進入網站目錄 修改使用者權限1chown -R apache:apache *php-fpm預設使用者名及使用者組是apache修改預設使用者組vi /etc/php-fpm.d/www.conf  www.2cto.com  修改mysql root 密碼mysqladmin -u root -p password 你的密碼 使用ssh方式連結 Mysql如果出現 密碼錯誤使用下面辦法解決vim /etc/my.cnf注釋#skip-name-resolveservice mysqld restart *nginx中修改php配置後使用 service php-fpm restart更新修改  作者 哥哥

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.