請選擇對應的centos版本,別錯了哦
不肯定版本及32仍是64能夠使用一下命令檢查
php
more /etc/redhat-release (查看centos版本)
uname -r(查看內核位數)html
centos-5 32位:java
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-10.ius.el5.noarch.rpm rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm
mirrorlist=http://dmirr.iuscommunity.org/mirrorlist?repo=ius-el5&arch=$basearch
#baseurl=http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/$basearch
yum -y update
yum install mysql55-server mysql55 php53u-fpm nginx
yum install php53u-gd php53u-xml php53u-mysql php53u-mcrypt php53u-mbstring php53u-pear pcre-devel php53u-devel
yum -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
pecl install apc
extension = apc.so [apc] apc.enabled = 1 apc.shm_size = 256M apc.ttl = 7200 apc.user_ttl = 7200 apc.num_files_hint = 10240 apc.max_file_size = 128M apc.stat = 0 apc.include_once_override = 1
server { listen 80; server_name demo.makingware.com;#你的域名 root /var/www/demo.makingware.com;#你的目錄 index index.php index.html index.htm; location / { if (-f $request_filename) { expires 30d; break; } if (!-e $request_filename) { rewrite ^(.+)$ /index.php last; } } location ~ \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location /app/etc { deny all; } }
chown -R apache:apache *
*nginx中修改php配置後使用 service php-fpm restart更新修改mysql
打開80端口nginx
vi /etc/sysconfig/iptablesc++
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT sql