更新系统
更新全部程序包
yum update
出现“No package ***** available.”说明软件包名字错误,用yum list name*这种格式查找一下
httpd(apache)安装及配置
yum install httpd
修改/etc/httpd/conf/httpd.conf文件
取消 ServerName localhost的注释(配置主机名,实际生产环境下配置为指向到本机的域名)
修改/etc/firewalld/zones/public.xml文件
加入 <service name="http"/>(开启防火墙WEB服务通道),重启防火墙服务
service firewalld restart
启动并查看WEB服务状态
service httpd start
service httpd status
临时关闭selinux
setenforce 0
不建议永久关闭selinxu,作为系统保护程序,有机会还是应该认真研究一下。永久关闭方法自行百度
安装和配置mariadb(mysql)
安装
yum install mariadb,mariadb-server
安装完成后启动mariadb服务
service mariadb start
然后使用mysql_secure_installation 进行包括root密码在内的一系列初始化
登录测试
mysql -u root -p 设置的密码
show databases;
php 5.6 安装小记
查看已安装的PHP组件
yum list installed | grep php*
导入EPEL源和REMI源
可在http://rpms.remirepo.net中找到最合适的镜像
rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/epel-release-latest-7.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
创建一个名称为remi-php56.repo的文件,从remi.repo中抽出remi-php56部分,复制到其中。非base源设置为 enabled=0 以免安装时不同源混杂(可选步骤)
安装程序包
由于yum包依赖管理不到位部分依赖可能需要手动安装,以下是参考
yum install libzip-last --enablerepo=remi-safe
yum install gd-last --enablerepo=remi(php-gd依赖)
安装PHP 5.6主程序
yum install php --enablerepo=remi-php56
安装列表参考(其他必备组件会自动安装,比如pod等)
php.x86_64 5.6.18-1.el7.remi @remi-php56
php-gd.x86_64 5.6.18-1.el7.remi @remi-php56
php-dom
php-mbstring.x86_64 5.6.18-1.el7.remi @remi-php56
php-mysqlnd.x86_64 5.6.18-1.el7.remi @remi-php56
php-opcache.x86_64 5.6.18-1.el7.remi @remi-php56
php-pecl-uploadprogress.x86_64 1.0.3.1-4.el7.remi.5.6 @remi-php56
php-twig.x86_64 1.24.0-1.el7.remi.5.6 @remi-php56
安装完成后重启httpd服务
service httpd restart
启用apache短链接(URL重写)
将/etc/httpd/conf/htttpd.conf文件中的
AllowOverride None全部替换三处改成 AllowOverride All 这个是以保证重写可以启用
在drupal根目录中修改 .htaccess 文件
RewriteBase /dp8
网友评论