luckymaoyy 2015-08-19
1.如果没有ftp软件,直接安装运行下面程序:
yum -y install vsftpd chkconfig vsftpd on
安装出现下面错误:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" Error: Cannot find a valid baseurl for repo: base
是因为缺少DNS,解决如下:到/etc目录下配置resolv.conf加入nameserver IP: [root@localhost ~]# vi /etc/resolv.conf #下面地址是福建电信DNS nameserver 218.85.157.99
2.命令
启动vsftpd: service vsftpd start 停止vsftpd: service vsftpd stop 重启vsftpd: service vsftpd restart
1.安装nginx+ php+ mysql
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm //下载rpm文件 rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm //解压 rpm -qa | grep nginx 检查nginx 是否加入源路径 安装 php mysql nginx yum install mysql mysql-server php php-mysql php-fpm nginx php组件库 选择安装 如果找不到源地址,请查找小技巧里面的更新第三方源库 yum install php-cli php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy php-common php-devel
如需单独安装,请参考下面
1.1.单独安装php-fpm服务
yum install -y php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm #启动php-fpm /etc/rc.d/init.d/php-fpm start 设置自动启动 chkconfig php-fpm on
1.2.单独安装mysql
安装MYSQL yum -y install mysql mysql-server 启动mysql service mysqld start chkconfig mysqld on #设为开机启动 为root账户设置密码 mysql_secure_installation 重启所有服务 service mysqld restart service nginx restart /etc/rc.d/init.d/php-fpm restart 测试成功
2.安装svn客户端
yum install subversion 获取代码: svn checkout 路径 svn update //到获取目录下,更新代码
3.添加服务自启动
nginx 服务 chkconfig --add nginx chkconfig nginx on service nginx start php-fpm chkconfig --add php-fpm chkconfig php-fpm on service php-fpm start mysql chkconfig --add mysqld chkconfig mysqld on service mysqld start
4.卸载软件
yum remove httpd yum remove mysql yum remove php
5.防火墙配置
修改文件/etc/sysconfig/iptables [root@bogon ~]# cd /etc/sysconfig/ [root@bogon sysconfig]# vi iptables
6.centos7 mysql不能直接用
需安装mariadb
# yum install mariadb-server -y # systemctl start mariadb.service # systemctl enable mariadb.service # mysql
把数据库文件指到另个文件中(用软链接)
selinux打开的时候创建的,那么即使你关闭selinux,它的权限控制还是会起作用的。
7.yum安装
# yum -y remove php* # yum install epel-release # rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # yum -y install --enablerepo=remi --enablerepo=remi-php56 httpd php php-mbstring php-pear # yum list | grep httpd entOs 5.x rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm CentOs 6.x rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm CentOs 7.X rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath 安装php5.6
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
systemctl enable nginx.service systemctl enable mysqld.service systemctl enable php-fpm.service
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install -y nginx systemctl start nginx.service systemctl enable nginx.service
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm yum -y install mysql57-community-release-el7-10.noarch.rpm yum -y install mysql-community-server新安装数据库可能会有密码,查看方式
grep 'temporary password' /var/log/mysqld.log
修改root密码 # alter user 'root'@'localhost' IDENTIFIED by '#20as3SElkSDs0ew98'; 查看密码设置 # SHOW VARIABLES LIKE 'validate_password%'; 设置密码复杂度 # set global validate_password.policy=05.安装php-redis扩展
//先装git yum install git //git下扩展 cd /usr/local/src git clone https://github.com/phpredis/phpredis.git //安装扩展 cd phpredis phpize //修改php配置 vi /etc/php.ini 添加extension=redis.so //重启php service php-fpm restart更改数据库数据目录
vim /etc/selinux/config SELINUX=disabled