Apple cms building tutorial to build a movie website for free

How to build a free movie website? Free tutorial to build a movie website using Apple cms

appleTutorial 。如何在Linux环境下快速搭建一个电影网站,在网络上查询了一番后,发现It is open source and its functions meet basic movie website needs. Record it belowprocess. firstBuilt on, you can also use various fool panels for installation.

  • Platform: IIS/Apache//etc+PHP(5.5+)+ (5.5 +)
  • Linux/Unix platform: Apache/Nginx/etc. + PHP (5.5 +) + MySQL (5.5 +) (PHP must be run in non-safe mode)
  • Note: Do not use PHP8 for the PHP version. There will be many errors under PHP8. It is recommended to install PHP7.2.

What is Apple CMS

Apple CMS program is a complete and powerful rapid website building system running in PHP+MYSQL environment. After years of development experience and technology accumulation, Apple's CMS program has gradually matured and has become the best among its peers in terms of ease of use and functionality. The program is small in size and runs fast. After optimizing the program code and efficient caching, it can be perfectly set up with an ordinary virtual host, and the cost of building a website is very low. With MVC-like template separation, built-in tags, custom function tag interfaces, and powerful custom collection functions, you can easily create a personalized website as long as you know HTML. In terms of program ease of use and functionality, we have always actively adopted various good suggestions put forward by the majority of webmasters and responded quickly to various emergency issues. Our service concept runs through it to ensure that every webmaster can calmly handle every step. .

Source code:https://github.com/magicblack

Apple CMS:http://www.maccms.la

Apple cms online manual

Apple CMS building tutorial to install Apple CMS

After logging in to the server via SSH, use the cd command to enter the web storage directory. The general location is /home/www

 cd /home/www 

After entering the www directory, start cloning and pulling the Apple CMS website source code.

 git clone https://github.com/magicblack/maccms10.git 
苹果cms搭建教程 免费搭建电影网站
After the source code of the Apple cms website is pulled, change the directory permissions. The current user and user group with nginx access permissions are nginx. You need to set the Apple cms directory to be accessible to nginx users.
 chown nginx:nginx -R /home/uzbox/maccms10 
苹果cms搭建教程 免费搭建电影网站

Next, start the installation operation. Modify the server module in the configuration file in Nginx. Change the website storage directory to /home/uzbox/maccms10 and then modify the location/root directory content. The specific modifications are as follows:

 # pseudo-static page location / { if (!-e $request_filename) { rewrite ^/index.php(.*)$ /index.php?s=$1 last; rewrite ^/admin.php(.*)$ /admin. php?s=$1 last; rewrite ^/api.php(.*)$ /api.php?s=$1 last; rewrite ^(.*)$ /index.php?s=$1 last; break; } }

The complete code of server.conf:

# domain name port 301 redirect https #uzbox.tk server { listen 80; listen [::]:80; server_name uzbox.tk www.uzbox.tk; return 301 https://uzbox.tk$request_uri; } # website configuration core block server { listen 443 ssl http2; listen [::]:443 http2; server_name uzbox.tk; index index.php index.html index.htm; root /home/vod; include /etc/nginx/default.d/*.conf ; # loads the default server block configuration file from /etc/nginx/default.d. # Config for 0-RTT in TLSv1.3 ssl_certificate /data/uzbox.tk.crt; ssl_certificate_key /data/uzbox.tk.key; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers TLS13-AES-256-GCM- SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20- draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES: !MD5; ssl_early_data on; ssl_stapling_verify on; add_header Strict-Transport-Security "max-age=31536000"; # pseudo-static page location / { if (!-e $request_filename) { rewrite ^/index.php(.*)$ / index.php?s=$1 last; rewrite ^/admin.php(.*)$ /admin.php?s=$1 last; rewrite ^/api.php(.*)$ /api.php?s=$1 last ; rewrite ^(.*)$ /index.php?s=$1 last; break; }

After Nginx is modified, restart the Nginx service or reboot the server and enter nginx -t Verify the configuration information.

Enter the website domain name configured in your Nginx below to start installing Apple CMS-V10.

苹果cms搭建教程 免费搭建电影网站

Click the blue button to agree to the agreement and install the system.

苹果cms搭建教程 免费搭建电影网站

Directory permissions must be configured correctly, otherwise it will prompt that it cannot be read. For example, the user group of the Nginx service installed on the server is nginx, and then the user group and user of the directory where the Web website is stored must also be changed to nginx. The folder permissions of the directory are by default 755.

PHP function extension is here. If it is not installed, it needs to be used on the server. dnf install command to install. For specific installation methods, please refer to:Install PHP8

苹果cms搭建教程 免费搭建电影网站

Click to install immediately. It only requires three steps to set up, and Apple CMS has been installed. Next change the admin.php file.

 

苹果cms搭建教程 免费搭建电影网站
苹果cms搭建教程 免费搭建电影网站

Directory Structure

  • application: standard tp5 application directory, which stores all models, controllers and configuration files of the program.
  • application/extra/maccms.php: All configuration parameters in the background.
  • application/extra/addons.php: Installed third-party application configuration.
  • application/extra/domain.php: Site group domain name configuration.
  • application/extra/timming.php: Custom task configuration.
  • application/extra/vodplayer.php: Installed player configuration.
  • application/extra/voddowner.php: Installed downloader configuration.
  • application/data/backup: Backup data directory, the background backup data is in this directory.
  • application/data/config: Backend custom menu configuration.
  • application/data/install: Initial installation directory. If you need to reinstall, delete the install.lock inside and re-enter the installation steps.
  • application/route.php: Pseudo-static routing file. If the wrong route is written in the background and the background is inaccessible, delete this file and it will be normal.
  • application/database.php: MySQL database connection configuration file.
  • addons: used to store major third-party applicationsDirectory, purchased plug-ins can be placed here.
  • template: theme template directory, a directory used to store front-end templates.
  • static: used to store static files such as default css and js.

Security Settings

For a safer program, it is recommended that the following folders be prohibited from running PHP program files.

  • /application: Restrict php file access.
  • /addons: Restrict php file access.
  • /extend: Restrict php file access.
  • /thinkphp: Restrict php file access.
  • /vendor: Restrict php file access.
  • / :Restrict php file access.

Nginx disables php script access in the directory:

It is forbidden to specify a directory to run PHP scripts under Nginx. Add configuration parameters in the server configuration, and permissions can be prohibited after matching location conditions.

Note: The following code must be placed above the PHP parsing code Fastcgi to take effect.

 
# Location is prohibited in a single directory ~* ^/upload/.*\.(php|php5)$ { deny all; } # Location is prohibited in multiple directories ~* ^/(upload|vendor|thinkphp|extend|addons|application)/ .*\.(php|php5)$ { deny all; }
 

At this point, the installation of Apple CMS is complete, and the framework of the Web website has been set up. Next, various collection rules and front-end templates need to be added.

Apple cms building tutorial installation template

Apple CMS does not have front-end templates by default. You need to make your own or use a third-party template. Only with a template can it be considered a complete website. Installing the template is also very simple.

First download an Apple CMS template: Conch template V4.0 has some minor problems, but they have been fixed and can be used normally. Many js problems are related to the three files hlexpand.js, hlhtml.js, and hlstem.js. The JS file is encrypted, and I found some replacements online. The conch template must be installed with the sg11 extension of PHP before it can be used. Since the template is relatively old, the current sg version has been released to 12, and there is no test whether it supports sg12.

click to download:Conch template v4.0 perfectly repaired version + Dplayer player error-free version download

click to download:The latest version of the conch template, no need for SG11 support, perfect and error-free version

  1. Upload the template to the template directory
  2. PHP must install the sg11 extension
  3. Background shortcut menu configuration added:
    Conch theme settings,/admin.php/admin/conch/theme
  4. Both website templates and mobile phone templates are in the [conch] template directory [moban], clear the cache.
  5. Note that the WeChat viewing function needs to modify the corresponding content in line 301 of the conch/js/jquery.stem.js folder.
  6. Slideshow Recommendation 9: Large picture mode requires uploading a poster image, the recommended size is 1680px*580px. Small picture mode requires setting 3 recommendations before it can be displayed.
  7. Hot recommendation 1 It is recommended to recommend the 18 best ones (adaptive change function).
苹果cms搭建教程 免费搭建电影网站
Conch template v4.0 perfectly repaired version + Dplayer player error-free version download

the template fileAfter that, upload to template directory, please rename the template file directory when uploading, and then change the user and user group of the template file directory. The default upload owner is the root user.

苹果cms搭建教程 免费搭建电影网站

After uploading, change the access permissions of the file directory.

 chown nginx:nginx -R /home/uzbox/maccms10/template/movie 

After changing the owner of the template file, visit the Apple CMS backend and find the website template option on the System > Website Parameter Configuration > Basic Settings page. Drop down the menu and select movie. The website template to be tested is adapted to mobile phones. Here, select single domain and click Save. Template added!

苹果cms搭建教程 免费搭建电影网站

Some templates require the installation of PHP's SG11 extension. SG11 is the abbreviation of SourceGuardian, and 11 represents the version. SourceGuardian is a tool that can encrypt PHP, so users can quickly and safely code and compile PHP programs. The SG11 extension needs to be installed manually. First download the SG11 expansion package.

Click to download the SG11 expansion pack:SG11 WIN LINUX.ZIP

Use the uname -a command on the server to check the system version. For 64-bit versions, x86_64 will be displayed.

Then find the corresponding expansion file in the downloaded expansion package. For example: If the php7.2 version is installed on the server, look for the ixed.7.2.lin file in the Linux x64 directory.

苹果cms搭建教程 免费搭建电影网站

Upload the ixed.7.2.lin file to the /usr/lib64/php directory on the server.

苹果cms搭建教程 免费搭建电影网站

After the upload is completed, save the location of ixed.7.2.lin, which will be used below. /usr/lib64/php/ixed.7.2.lin

Edit the /etc/php.ini file and add extension=/usr/lib64/php/ixed.7.2.lin to the bottom line of the file.

 extension=/usr/lib64/php/ixed.7.2.lin 
苹果cms搭建教程 免费搭建电影网站

After editing php.ini, save and upload, then restart the PHP service, or reboot the server.

Verify whether SG11 is installed successfully:

 php --ri sourceguardian 
苹果cms搭建教程 免费搭建电影网站

The Apple cms template file has been installed. After making some simple settings, the front desk can access the Web page. At this time you will find that the front-end Web page is empty. Next is the collection and entry of data.

Apple cms building tutorial data collection

Apple CMS has many data collection resource websites on the Internet. After setting up the collection interface, you can import data with one click.

The following is an example of collection import:

First, search the Apple CMS collection resource station on the Internet, and then find the URL link of the collection interface in the Apple CMS collection resource station.

Sky Resource Network comprehensive resources:

 https://api.tiankongapi.com/api.php/provide/vod/at/xml/ 

resource:

 https://m3u8.tiankongapi.com/api.php/provide/vod/at/xml/ 

Before collecting data, you need to add the player of the resource station. If you do not add the player, there will be no playback address after collecting the data. Each resource site has its own corresponding player, and the player is not universal!

After downloading and decompressing the resource collection station, you can import the player in the Apple CMS background, Super Console>Video>Player>Import:

苹果cms搭建教程 免费搭建电影网站

After the player is imported, add the collection interface in the Apple CMS background. The specific steps are as follows:

Super Console>Collection>Customized Interface>Add:

苹果cms搭建教程 免费搭建电影网站

The resource name can be customized, the interface address is filled in with the URL link of the collection interface obtained above, and the interface type is selected. xml, the interface type mainly depends on the type of your API interface address. If your collection interface address is json, select json in the interface type. Resource type selection video , data operation selection New + Update, filter address default No filtering. After setting up, click Save.

On the custom interface page, select the resource station you want to collect. In the collection options, first click on the collection day.

苹果cms搭建教程 免费搭建电影网站
When collecting resources, it will prompt that the category is not bound and err will be skipped. Before collecting, classification needs to be bound. After the current collection task is completed, it will automatically jump to the data collection list page.
苹果cms搭建教程 免费搭建电影网站

Click Bind after the category. The category here is created in Basic > Category Management. If you have not created a category yet, you need to create it according to the category of the collection site.

苹果cms搭建教程 免费搭建电影网站

After the categories are created, return to the category binding page of the custom interface, click Binding behind the category, and then select the category to perform category binding.

苹果cms搭建教程 免费搭建电影网站
苹果cms搭建教程 免费搭建电影网站

After the classification is bound, close the custom interface, reopen Collection > Custom Interface, and start collection. Note: There are no bound categories in the category, and the content of unbound categories will not be collected.

苹果cms搭建教程 免费搭建电影网站

After waiting for the video data collection to be completed, collect the playlist data.

If you have not added a dedicated player to the resource site before, there is no way to display the playlist after collecting data. You need to add a player and then collect the data again so that you can add a playlist.

Super console>Collection>Customized interface, click the link to enter the resource station you collected to enter the resource library. In the lower left corner of the movie list, click Collect All.

苹果cms搭建教程 免费搭建电影网站
苹果cms搭建教程 免费搭建电影网站

The video playlist has been collected and stored in the database, just wait patiently.

苹果cms搭建教程 免费搭建电影网站

player

How to set up Apple cmsV10 to automatically play the next episode?

Add Apple cmsV10 to automatically play the next episode, add memory playback, and P2P playback. However, this method can only play videos in the m3u8 format. First, replace the dplayer player code. The replacement path is: static/player/dplayer.html

After the code is modified, you still need to set up the player in the background, Super Console>Video>Player>Add

When adding a new player, do not fill in the wrong encoding. For example, add a player with encoding tkm3u8. After adding the player, fill in the following code in the player code. Then clear the cache.

Problems encountered in data collection

苹果cms搭建教程 免费搭建电影网站
mistake:SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'vod_actor' at row 1

Error: SQLSTATE[22001]: String data, right truncation: 1406 Data for column 'vod_actor' at row 1 is too long

Reason for the error: The length of the inserted field in select mode (strict mode) in the MySQL database exceeds the set length.
Solution: Set sql_mode.

 mysql -u root -p 

Log in to MySQL on the server, enter the MySQL password, and enter the mysql> command line.

苹果cms搭建教程 免费搭建电影网站
 select @@sql_mode; 
苹果cms搭建教程 免费搭建电影网站

sql_mode is mainly used to verify data and legality: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

you canSTRICT_TRANS_TABLES,Remove or clear the parameters in sql_mode.

 SET @@global.sql_mode=''; SET @@sql_mode=''; 

After clearing, use the command to query

 select @@global.sql_mode; select @@sql_mode; 
苹果cms搭建教程 免费搭建电影网站

After the settings are completed, quit MySQL. The above method will be invalid if you restart the MySQL service. If you want it to take effect permanently, you need to change the MySQL configuration file.

 vi /etc/my.cnf.d/mysql-default-authentication-plugin.cnf 

VI edit the mysql-default-authentication-plugin.cnf configuration file and add under [mysqld]:

 key_buffer_size=16M max_allowed_packet=8M sql_mode=ANSI 
  • key_buffer_size: used to specify the size of the index buffer
  • max_allowed_packet: Set the maximum value for a message transmission
  • sql_mode: parameter representing the SQL mode. Through this parameter, you can set the strictness of checking the SQL statement.

After adding, save and exit VI mode, and then restart MySQL.

 systemctl restart mysqld 

After a final check, the mode of sql_mode was set successfully and has become ANSI relaxed mode.

苹果cms搭建教程 免费搭建电影网站

sql_mode mode:

sql_mode There are three modes in total, namely ANSI,TRADITIONAL and STRICT_TRANS_TABLES

ANSI mode:Relaxed mode, changes the syntax and behavior to be more consistent with standard SQL. Verify the inserted data. If it does not meet the defined type or length, the data type will be adjusted or truncated and saved, and a warning will be reported. For the error mentioned at the beginning of this article, you can first set sql_mode to ANSI mode, so that you can insert data. For field values whose divisor is 0, the database will use NULL values instead.A NULL value will be used instead.

TRADITIONAL mode:Strict mode, when inserting data into the mysql database, performs strict verification of the data to ensure that incorrect data cannot be inserted and reportsErrors, not just warnings. When used for things, the rollback of things will be performed. Note: Abandon INSERT/UPDATE as soon as an error is detected. This is not what you want if you are using a non-transactional storage engine, as data changes made before the error will not "roll over", resulting in "only a partial update".

STRICT_TRANS_TABLES mode:Strict mode performs strict data verification. Wrong data cannot be inserted and an error is reported. If the given value cannot be inserted into the transaction table, the statement is abandoned. For non-transactional tables, if a value appears in row 1 of a single-row statement or a multi-row statement, the statement is discarded.

Detailed explanation of sql_mode:

ONLY_FULL_GROUP_BY
For the GROUP BY aggregation operation, if the column in the SELECT does not appear in the GROUP BY, then this SQL is illegal because the column is not in the GROUP BY clause.
NO_AUTO_VALUE_ON_ZERO
This value affects the insertion of auto-growing columns. Under the default settings, inserting 0 or NULL represents generating the next auto-increasing value. This option is useful if the user wants to insert a value of 0 and the column is auto-increasing.
STRICT_TRANS_TABLES
If a value cannot be inserted into a transaction, the current operation is interrupted and there is no limit on non-transaction tables.
NO_ZERO_IN_DATE
Days and months of zero are not allowed.
NO_ZERO_DATE
MySQL database does not allow inserting zero dates, inserting zero dates will throw an error instead of a warning.
ERROR_FOR_DIVISION_BY_ZERO
During insert or update, if the data is divided by zero, an error occurs instead of a warning. If the mode is not given, MySQL returns NULL when the data is divided by zero.
NO_AUTO_CREATE_USER
Disable GRANT from creating users with empty passwords.
NO_ENGINE_SUBSTITUTION
If the required storage engine is disabled or not compiled, an error is thrown. When this value is not set, the default storage engine is used instead and an exception is thrown.
PIPES_AS_CONCAT
Treat "||" as a string concatenation operator rather than an OR operator, which is the same asThe database is the same, and it is similar to the string concatenation function Concat.
ANSI_QUOTES
You cannot use double quotes to quote a string because it is interpreted as an identifier.

Several issues that need to be paid attention to during the tutorial process of setting up Apple CMS

Error: Fatal error: Call to undefined function curl_init()

PHP is missing the curl module, install the php-curl extension

yum install php-curl

Error: Fatal error: Uncaught Error: Call to undefined function mb_check_encoding() in

If you are prompted with an mb_check_encoding() error, install:

yum install php-mbstring

Then modify php.ini: execute vim /etc/php.ini, add extension=/usr/lib64/php/modules/mbstring.so, and make corresponding modifications according to the directory where mbstring.so is stored. Generally there is no need to change it.

Error: Interface 'JsonSerializable' not found

The reason for the error is that PHP lacks the JSON extension or the JSON extension is not enabled.

Install JSON extension under linux:

yum -y install php-json

Error: cms background verification code is invalid

I have entered the correct verification code countless times, but it always prompts that the verification code is wrong. It is a small problem with PHP.

Modify the user group and permissions of the session path (such as /var/lib/php/session), and then go to the corresponding session path.

cd /var/lib/php chown nginx:nginx ./session chmod -R 777 ./session

Error: Fatal error: Call to undefined function \common\model\simplexml_load_string()

This error is because php-xml is not installed. Installing php-xml can solve the problem.

dnf installphp-xml

Except for the homepage, other pages are displayed as not existing, and 404 Page Not Found.

What should I do if everything except the homepage under nginx is 404? Add toPseudo-staticThe rules can generally be solved. If the background file entry admin.php is modified, change it to the corresponding file name. For example, if your background management is changed to dianyingzhanhoutai.php, then admin.php in the pseudo-static page also needs to be replaced with the corresponding file name.

 location / { if (!-e $request_filename) { rewrite ^/index.php(.*)$ /index.php?s=$1 last; rewrite ^/admin_yingyinjia.php(.*)$ /admin_yingyinjia.php?s= $1 last; rewrite ^/api.php(.*)$ /api.php?s=$1 last; rewrite ^(.*)$ /index.php?s=$1 last; break; } }

Regarding the installation problem of sg11, encrypted files of higher versions of PHP are not supported.

SG11 is the abbreviation of SourceGuardian 11. Currently SourceGuardian officialThe version has been updated to SourceGuardian 13. The highest version of PHP encryption for SG11 is PHP 7.3, so when you need to install the SG11 web program, the PHP version cannot be higher than 7.3.

Note: Conch template is encrypted using SourceGuardian 11. If SourceGuardian 13 version is installed, an error will be reported.

If the PHP version is higher than 7.3, you need to install the decryption file online. First, create a new probe page of phpinfo.

https://www.sourceguardian.com/loaders/download.php

苹果cms搭建教程 免费搭建电影网站
苹果cms搭建教程 免费搭建电影网站

What should I do if php7.2 is bound to module flow and can only install nginx1.14 but cannot install higher versions?

You can install Nginx1.20 first, and then install php7.2. If you install php7.2 first, you can only install Nginx1.14.

5/5 - (1 vote)

Leave a Reply

Your email address will not be published. Required fields are marked *