当前位置: 首页 > Linux

CentOS6yuminstallNginx1.6+MySQL5.5+PHP5.6

时间:2023-04-06 02:32:15 Linux

CentOS6.8yuminstallNginx下载nginxyum源wgethttp://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpminstallrpm-ivhnginx-release-centos-6-0.el6.ngx.noarch.rpm//获取yum源文件nginx.repo显示结果yumlist|grepnginxnginx-release-centos.noarch6-0.el6.ngx安装nginx.x86_641.16.0-1.el6.ngxnginxnginx-debug.x86_641.8.0-1.el6.ngxnginxnginx-debuginfo.x86_641.16.0-1.el6.ngxnginxnginx-module-geoip.x86_641.16.0-1.el6.ngxnginxnginx-module-geoip-debuginfo.x86_641.16.0-1.el6.ngxnginxnginx-module-image-筛选。x86_641.16.0-1.el6.ngxnginxnginx-module-image-filter-debuginfo.x86_641.16.0-1.el6.ngxnginxnginx-module-njs.x86_641.16.0.0.3.2-1.el6.ngxnginxnginx-module-njs-debuginfo.x86_641.16.0.0.3.2-1.el6.ngxnginxnginx-module-perl.x86_641.16.0-1.el6.ngxnginxnginx-module-perl-debuginfo.x86_641.16.0-1.el6.ngxnginxnginx-module-xslt.x86_641.16.0-1.el6.ngxnginxnginx-module-xslt-debuginfo.x86_641.16.0-1.el6.ngxnginxnginx-nr-agent.noarch2.0.0-12.el6.ngxnginxpcp-pmda-nginx.x86_643.10.9-9.el6base安装nginxyuminstallnginx.x86_64启动servicenginxstartNginx配置phpserver{听80;服务器名称本地主机;根/www/视频;#放在外面索引index.php;字符集utf-8;error_log/root/nginx.error.log错误;access_log/root/nginx.access.logmain;位置~\.php${fastcgi_pass127.0.0.1:9000;fastcgi_indexindex.php;fastcgi_split_path_info^(.+\.php)(.*)$;#打开path_infofastcgi_paramPATH_INFO$fastcgi_path_info;#Openpath_infofastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;包括/nglus;etcgi_xparconf;#开启伪静态}CentOS6.5下用yum安装MySQL5.5查看是否安装1.rpm-qa|grepmysql如果安装了mysql5.1,卸载。2.卸载命令:rpm-emysql-libs--nodepsaddrepo(需要添加两个repo)//下载wgethttp://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpmwgethttp://rpms.famillecollet.com/enterprise/remi-release-6.rpm//addrpm-Uvhhttp://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpmrpm-Uvhhttp://rpms.famillecollet.com/enterprise/remi-release-6.rpm检查是否增加成功yum--enablerepo=remi,remi-testlistmysqlmysql-serverinstallMySQL5.5yum--enablerepo=remi,remi-testinstallmysqlmysql-启动服务器mysql/etc/init.d/mysqldstartbootself-startchkconfig--levels345mysqldonenableMySQLsecuritysettings/usr/bin/mysql_secure_installation验证mysql是否安装成功mysql-uroot-p12345configuremy.inivi/etc/my.cnfCentos6.x/7.xyuminstallphp5.6查看当前安装的PHP包yumlistinstalled|grepphp如果有安装的PHP包,首先删除它们yumremovephp.x86_64php-cli.x86_64php-common.x86_64php-gd.x86_64php-ldap.x86_64php-mbstring.x86_64php-mcrypt.x86_64php-mysql。x86_64php-pdo.x86_64Configureyumsource//下面是CentOS6的源rpm-Uvhhttp://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm-Uvhhttp://rpms.famillecollet.com/enterprise/remi-release-6.rpm//下面是CentOS7.0的源码。yuminstallepel-releaserpm-ivhhttp://rpms.famillecollet.com/enterprise/remi-release-7.rpm使用yumlist命令查看可安装的包(Packege)。yumlist--enablerepo=remi--enablerepo=remi-php56|grepphp安装PHP5.6.xyuminstall--enablerepo=remi--enablerepo=remi-php56phpphp-opcachephp-develphp-mbstringphp-mcryptphp-mysqlndphp-phpunit-PHPUnitphp-pecl-xdebugphp-pecl-xhprofphp-gdphp-redis安装PHP-fpmyuminstall--enablerepo=remi--enablerepo=remi-php56php-fpm安装GD库yum--enablerepo=remi-php56installphp-gd