Deploy OlaIndex on BtPanel

This article has been included in the column of this site
Microsoft Office Tips

OlaIndex

0. Preface

I have written a tutorial on building OneIndex using the Bt panel before, refer to the article on this site:

Bt panel deployment OneIndex
https://blog.tsinbei.com/archives/281/

But after I deployed it, I found that many functions are not perfect (or the whole framework is too simple). Although the installation is very convenient, the API often expires and causes a white screen. It is more troublesome to reinstall the authorization.

Later, when I searched for related tutorials, I found a project based on OneIndex two-opening: OLAINDEX.

Latest Stable Version Latest Unstable Version  title=  title=  title=

After trying it, I ditched OneIndex completely and moved to OlaIndex.

Deploying OlaIndex on the Bt panel is a bit more troublesome than deploying OneIndex, and it is difficult. I encountered many unexpected problems, and I also searched for solutions through StackOverflow + SegmentFault throughout the process. Therefore, I list all the problems that may be encountered here for your reference.

Demo station:

Comment first then view it after your comment is approved. Join QQ Group to display all hidden texts.

Tip: The demo station I built chose the mdui theme. Open encrypted access, everyone can see the effect~

1. Preliminary preparation

  1. One server (CentOS7 recommended)
  2. Domain name (recommended to record first)
  3. OneDrive account (Personal Edition/Education Edition/Enterprise Edition)
  4. Bt Linux Panel (recommended)
Bt server panel, one-click all-round deployment and management, give you a gift package of 3188 yuan, click me to receive
https://www.bt.cn/?invite_code=MV93cm1wcGQ=

If you think the 5GB space of the personal free version is too small, you can refer to the article:

Get genuine Microsoft Office 365 for free
https://blog.tsinbei.com/archives/258/

You can get (or buy from me) a genuine account for free, with a default space of 5TB.

2, installation

Before installation, please install the Bt Linux panel. If you need to install the professional version/enterprise version, you can refer to this column.

Play Bt Linux Panel

2.1, PHP settings

2.1.1, install extension

Open the Bt panel and install PHP of version 7.1 or above. It is recommended to install PHP 7.4.

After the installation is complete, open the PHP management page, select the Install Extensions tab, and install the FileInfo and OpCache extensions.

install extension

2.1.2, enable function

Still on the PHP management page, select the Disabled Functions tab,

Find exec , shell_exec , proc_open , proc_get_status , putenv these five functions, click delete next to them.

TIP: Functions not in the disable list can be skipped.

Note: PHP needs to be restarted after completing the above configuration.

2.2. Install Composer

Tip: If you use the Bt panel, it will come with Composer, you can skip this step.

implement

Bash
1
2
curl - sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

Note: It is not recommended to use the terminal of the Bt panel, you can use ConnectBot in the Android environment or Putty in the Windows environment.

Replace the Composer software source:

Bash
1
2
3
4
5
6
# Ali Cloud
composer config - g repo.packagist composer https://mirrors.aliyun.com/composer/
# Tencent Cloud (Intranet)
composer config - g repo.packagist composer http://mirrors.tencentyun.com/composer/
# Tencent Cloud (external network)
composer config - g repo.packagist composer http://mirrors.tencent.com/composer

For more software sources, refer to the article on this site:

Comparison of domestic software sources
https://blog.tsinbei.com/archives/238/

To replace Yum/Apt and other software sources, refer to the article on this site:

Server optimization (2) Replacing the software source
https://blog.tsinbei.com/archives/237/

When executing composer, you may be prompted:

Do not use root

That is, it is not recommended to use the Root account. The solution is to switch users, or enter yes to ignore the prompt.

If you need to add a user, you can execute:

Bash
1
2
useradd tsinbei
passwd tsinbei

Just replace the tsinbei with the desired account password.

2.3, add website

Add a website in the Bt panel, bind the domain name, and enable SSL.

Note: HTTPS must be turned on, otherwise the Microsoft account cannot be bound!

Switch to the website directory and execute:

Comment first then view it after your comment is approved. Join QQ Group to display all hidden texts.

Prepend https:// when prompted for a URL.

If you get an error on the way, you can try:

  • Check if the directory is correct
  • Check if composer is already installed
  • set /storage/ directory permissions to 777
  • Change root account
  • Re-execute the install command

If all goes well, the installation is complete.

3, configuration

On the Site Directory tab of the website page of the Bt panel, select the running directory as /public.

Site Directory Configuration

Many tutorials will be written to turn off anti-cross-site, but this is not safe, so it can be modified

/public/.user.ini

e.g. originally could be

INI
1
open_basedir=/www/wwwroot/onedrive/public/:/tmp/

Delete the public in it, that is, change to

INI
1
open_basedir=/www/wwwroot/onedrive/:/tmp/

modify.user.ini

3.2, website configuration file

On the pseudo-static tab of the Bt panel website page, select Laravel 5 and save.

TIP: If this option is not available, you can manually enter:

Comment first then view it after your comment is approved. Join QQ Group to display all hidden texts.

set pseudo-static

In the Profile tab, put

Nginx
1
2
3
4
5
6
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
    expires 30d;
    error_log /dev/null;
    access_log /dev/null;
}

change to

Comment first then view it after your comment is approved. Join QQ Group to display all hidden texts.

That is, add try_files $uri $uri/ /index.php$is_args$query_string; to the first line to prevent 404 from appearing when viewing pictures in OneDrive.

If there are files such as css/js in OneDrive, it is recommended to make the above changes also in location ~ .*\.(js|css)?$.

3.3, bind account

Open the domain name + /admin, log in to the background, and bind the account.

Background Home

Account List

Bind account

Change redirect_uri to your domain name + /callback, click Apply.

Confirm Application

After binding the main account, you can add other accounts (sub-accounts).

3.4, update

If there is a new version, execute

Bash
1
2
3
4
5
6
7
8
9
10
11
12
# switch to website directory
cd /www/wwwroot/yoursite/

# Install dependency update packages
git pull
composer install

# Make sure the cache directory has read and write permissions
chmod - R 755 storage

# Ensure directory ownership
chown - R www:www *

That's it.

4. References

Chinese README
https://github.com/WangNingkai/OLAINDEX/blob/6.0/README_CN.md
Author
Hsukqi Lee
Posted on

2022-06-14

Edited on

2022-07-28

Licensed under

CC BY-NC-ND 4.0

Comments

Name
Mail
Site
None yet