├── Dockerfile ├── README.md ├── assets ├── cpanel.config ├── forceupdate └── wwwacct.conf └── start.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | MAINTAINER MIRhosting 3 | 4 | ENV container docker 5 | 6 | RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs 7 | RUN yum -y update; yum clean all; 8 | RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ 9 | rm -f /lib/systemd/system/multi-user.target.wants/*;\ 10 | rm -f /etc/systemd/system/*.wants/*;\ 11 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ 12 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ 13 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ 14 | rm -f /lib/systemd/system/basic.target.wants/*;\ 15 | rm -f /lib/systemd/system/anaconda.target.wants/*; 16 | CMD ["/usr/sbin/init"] 17 | 18 | RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs 19 | 20 | RUN yum -y update 21 | RUN yum -y install wget 22 | RUN yum -y install openssh-server 23 | 24 | COPY assets/wwwacct.conf /etc/wwwacct.conf 25 | RUN mkdir /root/cpanel_profile/ 26 | COPY assets/cpanel.config /root/cpanel_profile/cpanel.config 27 | 28 | RUN rm -f /etc/sysconfig/iptables 29 | RUN wget -O /usr/local/src/latest.sh http://httpupdate.cpanel.net/latest 30 | RUN chmod +x /usr/local/src/latest.sh 31 | RUN /usr/local/src/latest.sh --target /usr/local/src/cpanel/ --noexec 32 | RUN sed -i 's/check_hostname();/# check_hostname();/g' /usr/local/src/cpanel/install 33 | RUN touch /etc/fstab 34 | RUN chmod 0640 /etc/fstab 35 | RUN cd /usr/local/src/cpanel/ && ./bootstrap --force 36 | 37 | COPY start.sh /root/start.sh 38 | RUN chmod +x /root/start.sh 39 | 40 | EXPOSE 20 21 22 25 53 80 110 143 443 465 587 993 995 2077 2078 2082 2083 2086 2087 2095 3306 41 | 42 | ENTRYPOINT /root/start.sh 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Centos 7 with WHM/cPanel 2 | 3 | cPanel is one of the most recognized hosting management tools in the world and it delivers the most complete functionality combined with unparalleled localization. 4 | MIRhosting is now pleased to offer our unique and innovative cPanel image for everybody's evaluation and experiments. Our cPanel docker can now be deployed with one click within our cloud platform. If you will decide to use MIRhsoting's cloud platform your license will be activated instantly and you will be billed hourly for the actual consumption. If you need a license only for one hour, we can easily provision that and bill you exactly for one hour! 5 | MIRhosting based cPanel is simple and cost effective: 6 | 7 | Hourly billing for what was actually consumed 8 | Real time resource scalability (without limitations) 9 | Fully redundant infrastructure (99,95% uptime) 10 | 24x7x365 technical support 11 | Full and unlimited backups of all data deployed on our cloud 12 | 13 | As an extra incentive for all Github and Dockerhub visitors to try cPanel on our cloud please claim your 5 EUR one time activation credit! Activate now - https://mir.host/dockerhub 14 | 15 | Please consult a short video to get a better understanding! - https://www.youtube.com/watch?v=oR2OaP5rX44 16 | 17 | # IMPORTANT NOTE 18 | Since we are using "automated build" to build docker container in Docker Hub and currently it is not properly working with systemd and d-bus, its advised to run 19 | /scripts/upcp --force 20 | directly after you deploy your docker container to install all missing software. 21 | -------------------------------------------------------------------------------- /assets/cpanel.config: -------------------------------------------------------------------------------- 1 | #### NOTICE #### 2 | # After manually editing any configuration settings in this file, 3 | # please run '/usr/local/cpanel/scripts/restartsrv_cpsrvd' or 4 | # 'service cpanel restart' to fully update your server's configuration. 5 | 6 | RS=x3 7 | VFILTERDIR=/etc/vfilters 8 | access_log=/usr/local/cpanel/logs/access_log 9 | account_login_access=owner_root 10 | adminuser=cpanel 11 | allow_login_autocomplete=0 12 | allow_server_info_status_from= 13 | allow_weak_checksums=0 14 | allowcpsslinstall=1 15 | allowparkhostnamedomainsubdomains=0 16 | allowparkonothers=0 17 | allowremotedomains=1 18 | allowresellershostnamedomainsubdomains=0 19 | allowunregistereddomains=1 20 | allowwhmparkonothers=0 21 | alwaysredirecttossl=1 22 | anon_data_optout=0 23 | apache_port=0.0.0.0:80 24 | apache_ssl_port=0.0.0.0:443 25 | api_shell=0 26 | autocreateaentries=1 27 | autodiscover_host=cpanelemaildiscovery.cpanel.net 28 | autodiscover_mail_service=imap 29 | autodiscover_proxy_subdomains=1 30 | awstatsbrowserupdate=0 31 | awstatsreversedns=0 32 | basename=cpanel 33 | bind_deferred_restart_time=0 34 | blockcommondomains=1 35 | bwcycle=2 36 | cgiemaildisabled=1 37 | cgihidepass=1 38 | check_zone_owner=1 39 | check_zone_syntax=1 40 | chkservd_check_interval=300 41 | chkservd_hang_allowed_intervals=2 42 | chkservd_plaintext_notify=0 43 | cluster_autodisable_threshold=10 44 | cluster_failure_notifications=1 45 | conserve_memory=1 46 | cookieipvalidation=strict 47 | coredump=0 48 | cpaddons_adminemail= 49 | cpaddons_autoupdate=1 50 | cpaddons_max_moderation_req_all_mod=99 51 | cpaddons_max_moderation_req_per_mod=99 52 | cpaddons_moderation_request=0 53 | cpaddons_no_3rd_party=0 54 | cpaddons_no_modified_cpanel=1 55 | cpaddons_notify_owner=1 56 | cpaddons_notify_root=1 57 | cpaddons_notify_users=Allow users to choose 58 | cpanel_locale= 59 | cpredirect=Origin Domain Name 60 | cpredirectssl=SSL Certificate Name 61 | cpsrvd-domainlookup=0 62 | create_account_dkim=1 63 | create_account_spf=1 64 | cycle_hours=24 65 | database_prefix=1 66 | debughooks=0 67 | default_archive-logs=1 68 | default_login_theme=cpanel 69 | default_remove-old-archived-logs=1 70 | defaultmailaction=fail 71 | disable-php-as-reseller-security=0 72 | disableipnscheck=1 73 | disablequotacache=0 74 | discardformmailbccsubject=1 75 | disk_usage_include_mailman=1 76 | disk_usage_include_sqldbs=1 77 | dnsadmin_log=0 78 | dnsadmin_verbose_sync=0 79 | dnsadminapp 80 | dnslookuponconnect=0 81 | docroot=/usr/local/cpanel/base 82 | domainowner_mail_pass=0 83 | dormant_services=cpdavd,cphulkd,cpsrvd,dnsadmin,spamd 84 | dumplogs=1 85 | email_account_quota_default_selected=userdefined 86 | email_account_quota_userdefined_default_value=1024 87 | email_send_limits_count_mailman=0 88 | email_send_limits_defer_cutoff=125 89 | email_send_limits_max_defer_fail_percentage 90 | email_send_limits_min_defer_fail_to_trigger_protection=5 91 | emailarchive=0 92 | emailpasswords=0 93 | emailusers_diskusage_critical_contact_admin=1 94 | emailusers_diskusage_critical_percent=90 95 | emailusers_diskusage_full_contact_admin=1 96 | emailusers_diskusage_full_percent=98 97 | emailusers_diskusage_warn_contact_admin=0 98 | emailusers_diskusage_warn_percent=80 99 | emailusers_mailbox_critical_percent=90 100 | emailusers_mailbox_full_percent=98 101 | emailusers_mailbox_warn_percent=80 102 | emailusersbandwidthexceed=0 103 | emailusersbandwidthexceed70=0 104 | emailusersbandwidthexceed75=0 105 | emailusersbandwidthexceed80=1 106 | emailusersbandwidthexceed85=0 107 | emailusersbandwidthexceed90=0 108 | emailusersbandwidthexceed95=0 109 | emailusersbandwidthexceed97=0 110 | emailusersbandwidthexceed98=0 111 | emailusersbandwidthexceed99=0 112 | enable_piped_logs=0 113 | enablecompileroptimizations=1 114 | engine=cpanel 115 | enginepl=cpanel.pl 116 | engineroot=/usr/local/cpanel 117 | exim-retrytime=15 118 | exim_retention_days=10 119 | eximmailtrap=1 120 | extracpus=0 121 | file_upload_max_bytes 122 | file_upload_must_leave_bytes=5 123 | file_usage=0 124 | ftppasslogs=0 125 | ftpquotacheck_expire_time=30 126 | ftpserver=pure-ftpd 127 | gzip_compression_level=6 128 | gzip_pigz_block_size=4096 129 | gzip_pigz_processes=1 130 | htaccess_check_recurse=2 131 | ignoredepreciated=0 132 | ionice_bandwidth_processing=6 133 | ionice_cpbackup=6 134 | ionice_dovecot_maintenance=7 135 | ionice_email_archive_maintenance=7 136 | ionice_ftpquotacheck=6 137 | ionice_log_processing=7 138 | ionice_quotacheck=6 139 | ionice_userbackup=7 140 | ionice_userproc=6 141 | ipv6_control=0 142 | ipv6_listen=0 143 | jailapache=0 144 | jaildefaultshell=0 145 | jailmountbinsuid=0 146 | jailmountusrbinsuid=0 147 | jailprocmode=mount_proc_jailed_fallback_full 148 | keepftplogs=0 149 | keeplogs=0 150 | keepstatslog=0 151 | loadthreshold 152 | local_nameserver_type=bind 153 | log_successful_logins=0 154 | logchmod=0640 155 | logout_redirect_url= 156 | mailbox_storage_format=maildir 157 | mailserver=dovecot 158 | maintenance_rpm_version_check=1 159 | maintenance_rpm_version_digest_check=1 160 | maxcpsrvdconnections=200 161 | maxemailsperhour=120 162 | maxmem=512 163 | minpwstrength=65 164 | modsec_keep_hits=7 165 | mycnf_auto_adjust_innodb_buffer_pool_size=0 166 | mycnf_auto_adjust_maxallowedpacket=1 167 | mycnf_auto_adjust_openfiles_limit=1 168 | myname=cpaneld 169 | mysql-host=localhost 170 | mysql-version=5.6 171 | mysqldebug=0 172 | nobodyspam=1 173 | nocpbackuplogs=0 174 | nosendlangupdates=0 175 | numacctlist=30 176 | overwritecustomproxysubdomains=0 177 | overwritecustomsrvrecords=0 178 | permit_appconfig_entries_without_acls=0 179 | permit_appconfig_entries_without_features=0 180 | permit_unregistered_apps_as_reseller=0 181 | permit_unregistered_apps_as_root=0 182 | php_max_execution_time=90 183 | php_post_max_size=55 184 | php_system_default_version=ea-php56 185 | php_upload_max_filesize=50 186 | phploader=ioncube 187 | phpopenbasedirhome=0 188 | popbeforesmtp=0 189 | popbeforesmtpsenders=0 190 | postgresdebug=0 191 | product=cPanel 192 | proxysubdomains=1 193 | proxysubdomainsfornewaccounts=1 194 | proxysubdomainsoverride=0 195 | publichtmlsubsonly=0 196 | referrerblanksafety=1 197 | referrersafety=1 198 | remotewhmtimeout=35 199 | repquota_timeout=60 200 | requiressl=1 201 | resetpass=0 202 | resetpass_sub=0 203 | root=/usr/local/cpanel 204 | rotatelogs_size_threshhold_in_megabytes=300 205 | roundcube_db=mysql 206 | security_advice_changes_notifications=0 207 | send_error_reports=1 208 | send_server_configuration=1 209 | send_server_usage=1 210 | server_locale=en 211 | showwhmbwusageinmegs=0 212 | signature_validation=Release Keyring Only 213 | skip_chkservd_recovery_notify=0 214 | skipanalog=0 215 | skipapacheclientsoptimizer=0 216 | skipawstats=0 217 | skipboxcheck=1 218 | skipboxtrapper=1 219 | skipbwlimitcheck=0 220 | skipchkservd=0 221 | skipcpbandwd=1 222 | skipdiskcheck=0 223 | skipdiskusage=0 224 | skipeximstats=1 225 | skipformmail=1 226 | skiphorde=0 227 | skiphttpauth=1 228 | skipjailmanager=0 229 | skipmailauthoptimizer=0 230 | skipmailman=1 231 | skipmodseclog=0 232 | skipnotifyacctbackupfailure=0 233 | skipoomcheck=0 234 | skipparentcheck=0 235 | skiprecentauthedmailiptracker=0 236 | skiproundcube=0 237 | skipspamassassin=0 238 | skipspambox=1 239 | skipsqmail=0 240 | skiptailwatchd=0 241 | skipwebalizer=0 242 | skipwhoisns=0 243 | smtpmailgidonly=1 244 | stats_log=/usr/local/cpanel/logs/stats_log 245 | statsloglevel=1 246 | statthreshhold=256 247 | system_diskusage_critical_percent=92.55 248 | system_diskusage_warn_percent=82.55 249 | tcp_check_failure_threshold=3 250 | transfers_timeout=1800 251 | tweak_unset_vars= 252 | upcp_log_retention_days=45 253 | update_log_analysis_retention_length=90 254 | use_apache_md5_for_htaccess=1 255 | use_information_schema=0 256 | useauthnameservers=0 257 | usemailformailmanurl=0 258 | usemysqloldpass=0 259 | userdirprotect=1 260 | verify_3rdparty_cpaddons=0 261 | version=3.4 262 | -------------------------------------------------------------------------------- /assets/forceupdate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | grep -q HOST /etc/wwwacct.conf && sed -i_bak "s/\(HOST\) .*/\1 $2/" /etc/wwwacct.conf || echo "HOST $2" >> /etc/wwwacct.conf 4 | /usr/local/cpanel/bin/set_hostname $2 5 | 6 | if [ "$1" = "true" ]; then 7 | /scripts/upcp --force 8 | fi 9 | -------------------------------------------------------------------------------- /assets/wwwacct.conf: -------------------------------------------------------------------------------- 1 | DEFWEBMAILTHEME paper_lantern 2 | HOMEDIR /home 3 | CONTACTEMAIL email@example.com 4 | NSTTL 86400 5 | NS2 ns2.example.com 6 | NS3 7 | ETHDEV venet0:0 8 | HOST 9 | CONTACTPAGER 10 | HOMEMATCH home 11 | LOGSTYLE combined 12 | ADDR 127.0.0.1 13 | TTL 14400 14 | ADDR6 15 | NS4 16 | SCRIPTALIAS n 17 | NS ns1.example.com 18 | DEFMOD paper_lantern 19 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LC_ALL="en_US.utf8" 4 | iptables --flush 5 | /scripts/restartsrv_cpsrvd 6 | systemctl restart mysql 7 | 8 | echo "[client]" > /root/.my.cnf; 9 | echo "password=" >> /root/.my.cnf; 10 | echo "user=root" >> /root/.my.cnf; 11 | 12 | mysql_password=$( /var/cpanel/cpnat; 23 | grep -q ADDR /etc/wwwacct.conf && sed -i_bak "s/\(ADDR\) .*/\1 $new_ip/" /etc/wwwacct.conf || echo "ADDR $new_ip" >> /etc/wwwacct.conf 24 | 25 | /scripts/mainipcheck 26 | 27 | killall /usr/local/cpanel/bin/safeapacherestart 28 | killall /usr/local/cpanel/scripts/restartsrv_httpd 29 | killall /usr/bin/systemctl 30 | 31 | /scripts/rebuildhttpdconf 32 | 33 | /scripts/restartsrv_httpd 34 | 35 | /bin/bash 36 | --------------------------------------------------------------------------------