WHMCS安装流程
whmcs安装环境:(https://docs.whmcs.com/System_Environment_Guide)
1. PHP Version 5.6.0 or later 2. MySQL Version 5.2.0 or later 3. Curl Support (with SSL) 4. GD2 Image Library 5. PHP JSON support 6. PHP PDO (PDO & MySQL PDO) 7. PHP Memory Limit 64MB (minimum) 8. MySQL Strict Mode disabled 9. Ioncube Loader 10.1.0 or later
总的安装脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | yum -y install epel-release rpm -Uvh https: //mirror .webtatic.com /yum/el7/webtatic-release .rpm yum -y update yum -y remove firewalld yum -y install iptables-services vim gcc make lrzsz sed -i "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config setenforce 0 yum -y install httpd php72w php72w-cli php72w-mysqlnd php72w-gd yum -y install mariadb yum -y install mairadb-server ##install ioncube cd /tmp/ if [ ! -f /tmp/ioncube_loaders_lin_x86-64 . tar .gz ]; then wget https: //downloads .ioncube.com /loader_downloads/ioncube_loaders_lin_x86-64 . tar .gz tar zxvf ioncube_loaders_lin_x86-64. tar .gz fi \ cp -f /tmp/ioncube/ioncube_loader_lin_7 .2*.so /usr/lib64/php/modules/ \ cp -f /tmp/ioncube/loader-wizard .php /var/www/html/loader .php cat > /var/www/html/info .php<<EOF <?php phpinfo(); ?> EOF cat > /etc/php .d /ioncube .ini <<EOF zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7 .2.so EOF cat > /etc/httpd/conf/httpd .conf<<EOF ServerRoot "/etc/httpd" Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost <Directory /> AllowOverride none Require all denied < /Directory > DocumentRoot "/var/www/html" <Directory "/var/www" > AllowOverride None Require all granted < /Directory > <Directory "/var/www/html" > Options Indexes FollowSymLinks AllowOverride All Require all granted < /Directory > <IfModule dir_module> DirectoryIndex index.html < /IfModule > <Files ".ht*" > Require all denied < /Files > ErrorLog "logs/error_log" LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio < /IfModule > CustomLog "logs/access_log" combined < /IfModule > <IfModule alias_module> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" < /IfModule > <Directory "/var/www/cgi-bin" > AllowOverride None Options None Require all granted < /Directory > <IfModule mime_module> TypesConfig /etc/mime .types AddType application /x-compress .Z AddType application /x-gzip .gz .tgz AddType text /html .shtml AddOutputFilter INCLUDES .shtml < /IfModule > AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf /magic < /IfModule > EnableSendfile on IncludeOptional conf.d/*.conf EOF cat > /etc/mysql/conf .d /disable_strict_mode .cnf<<EOF<br>[mysqld]<br>sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION<br>EOFsystemctl enable httpd systemctl enable mariadb systemctl restart httpd systemctl restart mariadb grep mod_rewrite.so /etc/httpd/conf .modules.d /00-base .conf&& echo "mod_rewrite.so ok" || echo "LoadModule rewrite_module modules/mod_rewrite.so" >> /etc/httpd/conf .modules.d /00-base .conf |
1 安装centos7
2 安装
MYSQL本身自带的maridb(5.5)能满足需要 yum -y install mariadb*
create database whmcs default charset utf8; //创建数据库 set password for 'root'@'localhost'=password('kkkkkk'); //修改密码
Strict Mode功能说明
不支持对not null字段插入null值
不支持对自增长字段插入”值
不支持text字段有默认值
关闭:
To disable strict SQL mode, SSH in to your server as root and create this file:
/etc/mysql/conf.d/disable_strict_mode.cnf
1
Open the file and enter these two lines:
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
php centos7自带为php5.4,需要手工安装(
PHP高版本,使用webtatic源来安装 rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
webtatic包括高版本的php55w php56w php70w php71w php72w
我们选择安装php72w
yum -y install php72w*
systemctl enable php-fpm
systemtctl start php-fpm
)
ioncube https://www.ioncube.com/loaders.php从官方下载最新版就可以了
https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
文件解压后,复制7.2的两个so文件到/usr/lib64/php/modules中
复制loader-wizard.php 到/var/www/html
cat /etc/php.d/ioncube.ini zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.2.so
安装nginx(发现nginx url处理复杂,安装后登录时,URL处理有问题,没有走完,还是用httpd)
https://hostup.org/blog/whmcs-friendly-urls-configuration-for-nginx/
yum -y install nginx*
在/etc/nginx/nginx.conf中增加支持php模块
server { listen 80; listen [::]:80; server_name _; ## root /usr/share/nginx/html; root /var/www/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; error_page 404 /404.html; location = /404.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } location ~ \.php?.*$ { root /var/www/html; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
-------------------------------------------------
使用lamp
yum -y install httpd httpd-*
yum -y install php72w php72w-*
对httpd进行支持php72的支持
在/etc/httpd/conf/httpd.conf 末尾增加(libphp7.so可以从系统中搜索,放到/etc/httpd/modules中,如果没有可以官方网站下载源码,编译使用 ./configure --with-apxs2=/usr/bin/apxs 生成)
LoadModule php7_module modules/libphp7.so <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch> PHPIniDir /etc/php.ini
系统安装自带的libphp7.so不能用,需要自己编译,在www.php.net找到7.2版本下载编译
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 编译参数 ./configure --with-apxs2=/usr/bin/apxs \ --enable-mbstring \ --enable-zip \ --enable-bcmath \ --enable-pcntl \ --enable-ftp \ --enable-exif \ --enable-calendar \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --with-curl \ --with-mcrypt \ --with-iconv \ --with-gmp \ --with-pspell \ --with-gd \ --with-openssl \ --with-pdo-mysql |
https://www.php.net/distributions/php-7.2.34.tar.gz
在/etc/php.ini中增加
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.2.so
打开http://ip/loader-wizard.php 测试ioncube是否加载成功
上传whmcs安装包到/var/www/html 然后打开http://ip/admin进程安装就可以了
配置http的rewrite及允许.htaccess (https://devops.ionos.com/tutorials/install-and-configure-mod_rewrite-for-apache-on-centos-7/)
1 2 3 4 5 6 7 8 9 10 11 | 文件 /etc/httpd/conf .modules.d /00-base .conf 添加: LoadModule rewrite_module modules /mod_rewrite .so 文件 /etc/httpd/conf/httpd .conf 将AllowOverride None 改为All <Directory /var/www/html > AllowOverride All < /Directory > |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)