Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   NexusPHP (http://www.bvlist.com/forumdisplay.php?f=137)
-   -   [HOW-TO] Install NexusPHP 1.8.0 and above (http://www.bvlist.com/showthread.php?t=12710)

MasterPlebien 22nd May 2023 15:14

[HOW-TO] Install NexusPHP 1.8.0 and above
 
Hey guys, I've been experimenting with this script which appears to still be actively maintained here: https://github.com/xiaomlove/nexusphp and hopefully we will be able to help each other out here as well. :ok:

Here's a quick installation guide for anyone else who's interested.

I'll be using Ubuntu Server with aaPanel (FOSS). If you are not using aaPanel, and doing manual installation of Nginx, MySQL etc, take note of the PHP_USER and ROOTPATH used below.

Requirements:
PHP => 8.0
MySQL => 5.7
Redis => 2.6.12
Extensions: bcmath, ctype, curl, fileinfo, json, mbstring, openssl, pdo_mysql, tokenizer, xml, mysqli, gd, redis, pcntl, sockets, posix, gmp, zend opcache

1) Update you Linux Server
Code:

apt update
apt upgrade
apt clean
 apt autoremove

2) Install some additional packages unless you have your preferred ones
Code:

apt install screen wget curl vim
3) Install aaPanel
Code:

wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && bash install.sh aapanel
4) Enter aaPanel from your browser.
5) Use the one-click install option to install Nginx, mysql, pure-ftpd, php8 and phpmyadmin.
6) After installation is done, head over to "App Store" in aaPanel and select settings for PHP.
8) Under PHP setings, navigate to Install extensions and installing the following extensions:
Code:

fileinfo
opcache
redis
 gmp

9) Under PHP settings, navigate to Disabled functions and delete the following:
Code:

proc_open
exec
putenv
 symlink

10) Restart PHP
11) Navigate to "Files" in aaPanel
12) Download the latest release of NexusPHP from https://github.com/xiaomlove/nexusphp/releases using the remote download button.
13) Right-click the .zip file that was downloaded and select unzip. Rename the folder that was extracted to a preferred name. In this case, I'll name it nexusphp.
14) Now, head over to "Databases" in aaPanel and add a database.
15) Head over to "Websites" and select "Add site", input the detailed and submit.
Code:

Domain name: Enter your domain/ip
Description: Enter any description
Website Path: Your root path, for me its /www/wwwroot/nexusphp as i named my folder nexusphp earlier on.
FTP: Not required unless you need it
Database: Not needed now, we will create it during the installation of the site.
PHP version: PHP 8.0 or above.

14) Click submit


15) Click "Conf" under Operation and do the following:
Code:

Nagivate to Site Directory, untick Anti-XSS attack.


Ensure, Site Directory is pointing to your root path /www/wwwroot/nexusphp


 Running directory is set to /public

16) Now head over to "Config" and insert the following code:
Code:

location / {
    index index.html index.php;
    try_files $uri $uri/ /nexus.php$is_args$args;
}

# Filament
location ^~ /filament {
    try_files $uri $uri/ /nexus.php$is_args$args;
}

17) Click save and close the windows, we can now proceed with the creation of the installer for your site.

18) Using your terminal navigate to your root path
Code:

cd /www/wwwroot/nexusphp
19) Now to create the installer using composer.
Code:

composer install
20) Copying the install folder to the public folder.

Code:

cp -R nexus/Install/install public/
21) To change the owner/permission of your root folder to PHP user. If you are using aaPanel, your PHP_USER will be www.

Code:

chown -R PHP_USER:PHP_USER ROOT_PATH
22) If you are not using aaPanel and you don't know your PHP user you can also give the entire directory 0777 permission as such. However, this method is unadvisable.
Code:

chmod -R 0777 ROOT_PATH
23) You can now head over to your website/ip to start the installation of the website and creation of your admin account.

But before that, we have to create some cronjobs and daemons to keep the site running and maintained.

24) Create these 2 cronjobs to keep the website running, setup the following cronjobs by heading over to "Cron" in aaPanel:
Code:

Type of Task: Shell Script
Name of Task: Schedule Cron
Execution Cycle: 1 Minute
Script content: su -c "cd /www/wwwroot/nexusphp && php artisan schedule:run >> /tmp/schedule_nexusphp.log" -s /bin/sh www


Type of Task: Shell Script
Name of Task: CLI Cleanup Cron
Execution Cycle: 1 Minute
Script  content: su -c "cd /www/wwwroot/nexusphp && php include/cleanup_cli.php >> /tmp/cleanup_cli_nexusphp.log" -s /bin/sh www

25) Head over to "App Store", install the app "Supervisor" and Add a daemon:
Code:

Name: nexus-queue
Run user: www
Run dir: /www/wwwroot/nexusphp
Start command: php /www/wwwroot/nexusphp/artisan queue:work --tries=3 --max-time=3600
Processes: Input the number of processes your server has. In my case, my server has a dual-core CPU. Therefore, it is 2.

Your site should now be fully functional :drink:


Credits:
NexusPHP: https://github.com/xiaomlove/nexusphp
NexusPHP Docs: https://doc.nexusphp.org/en/installa...et-the-program

mogo 24th May 2023 00:44

Quote:

Originally Posted by MasterPlebien (Post 56820)
15) Click "Conf" under Operation and do the following:
Nagivate to Site Directory, untick Anti-XSS attack.

Thanks for that, but there are things that are not right:

Permissions set with 777 are not correct and even less certain.
Also "(15) Click "Conf" under Operation and do the following:
Nagivate to Site Directory, untick Anti-XSS attack."
This is absolutely not recommended!!!

There is a configuration in the AApanel that indicates what and how to use it i mean user.ini

MasterPlebien 24th May 2023 12:42

Yes, you can re-enable Anti-XSS attack after installation. Also, mentioned that having permission 777 is not recommended.

Mahmoud 18th June 2023 14:08

for some reason i got the famous

Quote:

502 Bad Gateway

nginx
what i missed?

Subzero 18th June 2023 15:00

Could be any number of reasons, check your nginx error log.

MasterPlebien 19th June 2023 09:33

Quote:

Originally Posted by Mahmoud (Post 56952)
for some reason i got the famous



what i missed?


Yeap, check the nginx log as subzero mentioned. If you are still unable to get it to work, maybe you can share the log here and I'll see if i am able to help you.

xblade 19th June 2023 11:43

aaPanel as never been a go for not very good at all.go with somthing else or evern none and do from frash start from shell aka putty

chevyman78 1st August 2023 06:14

Enter aaPanel from your browser, how do we do this?

MasterPlebien 2nd August 2023 11:17

type
Code:

bt
into your terminal and select option 14.

DND 2nd August 2023 11:37

from what i see code is still on mysql
that's bad
it doesn't even have prepared statements and/or parameterized queries


All times are GMT +2. The time now is 15:38.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.