1.重設ip
先使用DHCP
在/etc/sysconfig/network-scripts/ifcfg-eno***中加入
ONBOOT=YES
BOOTPROTO=DHCP
# systemctl restart network
2.更新yum的源為國內源
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
# yum clean all
# yum makecache
3.安裝和更新一些必要工具
yum install net-tools make gcc kernel-devel ntsysv tree links wget
4.安裝Apache
yum install httpd
修改配置文件
vi /etc/httpd/conf/httpd.conf
ServerSignature On#添加,在錯誤頁中顯示Apache的版本,Off為不顯示
#AddHandler cgi-script .cgi #修改為:AddHandler cgi-script .cgi .pl (允許擴展名為.pl的CGI腳本運行)
AllowOverride None #修改為:AllowOverride All (允許.htaccess)
AddDefaultCharset UTF-8 #修改為:AddDefaultCharset GB2312?。ㄌ砑覩B2312為默認編碼)
#Options Indexes FollowSymLinks #修改為 Options FollowSymLinks(不在瀏覽器上顯示樹狀目錄結構)
DirectoryIndex index.html#修改為:DirectoryIndex index.html index.htm Default.html Default.htm index.php(設置默認首頁文件,增加index.php)
MaxKeepAliveRequests500#添加MaxKeepAliveRequests 500 (增加同時連接數)
重啟httpd
systemctl restart httpd.service
增加自啟動
systemctl enable httpd.service
5.增加防火墻
firewall-cmd--permanent--zone=public--add-service=http
firewall-cmd--permanent--zone=public--add-service=https
firewall-cmd--reload
firewall-cmd --list-all
6.安裝MariaDB
更新epel
rpm--import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum-y install epel-release
yum -y install mariadb-server mariadbsystemctl start mariadb.servicesystemctl enable mariadb.serviceMySQL_secure_installation
7.安裝PHP7
刪除之前的舊版本
# yum remove php* php-common
設置yum 源:
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
安裝php7
# yum install php70w
# php -v
# systemctl restart httpd.service
獲得支持
#yum install php70w-dba.x86_64 php70w-devel.x86_64 php70w-embedded.x86_64 php70w-enchant.x86_64 php70w-fpm.x86_64 php70w-gd.x86_64 php70w-imap.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysqlnd.x86_64 php70w-odbc.x86_64 php70w-opcache.x86_64 php70w-pdo.x86_64 php70w-pdo_dblib.x86_64 php70w-pear.noarch php70w-pecl-apcu.x86_64 php70w-pecl-apcu-devel.x86_64 php70w-pecl-imagick.x86_64 php70w-pecl-imagick-devel.x86_64 php70w-pecl-mongodb.x86_64 php70w-pecl-redis.x86_64 php70w-pecl-xdebug.x86_64 php70w-pgsql.x86_64 php70w-xml.x86_64 php70w-xmlrpc.x86_64 php70w-intl php70w-bcmath.x86_64 -y
8.安裝 phpMyAdmin
#yum install phpMyAdmin
#vi /etc/httpd/conf.d/phpMyAdmin.conf
<Directory /usr/share/phpMyAdmin/>
Options none
AllowOverrideLimit
Require all granted
</Directory>
將phpMyAdmin的認證cookie修改為http
# vi /etc/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http';9安裝Drupal
在安裝時報文件和目錄不可寫,主是要selinux進行了控制,先查看下不可寫目錄與文件的值:
ls -lZ
-rwxr--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 default.settings.phpdrwxrwxrwx. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 files-rwxrwxrwx. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 settings.php
需要增加以下命令:
chcon -t httpd_sys_content_rw_t sites/default/ chcon -t httpd_sys_content_rw_t sites/default/settings.php chcon -t httpd_sys_content_rw_t sites/default/files
完成Drupal安裝。
|
新聞熱點
疑難解答