Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > NexusPHP
Reply
  #1  
Old 22nd May 2023, 15:14
MasterPlebien's Avatar
MasterPlebien MasterPlebien is offline
Member
 
Join Date: May 2023
P2P
Posts: 4
Default [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.

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


Credits:
NexusPHP: https://github.com/xiaomlove/nexusphp
NexusPHP Docs: https://doc.nexusphp.org/en/installa...et-the-program
Reply With Quote
The Following User Says Thank You to MasterPlebien For This Useful Post:
papad (23rd May 2023)
  #2  
Old 24th May 2023, 00:44
mogo mogo is offline
Senior Member
 
Join Date: Jun 2020
P2P
Posts: 96
Default
Quote:
Originally Posted by MasterPlebien View Post
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
Reply With Quote
  #3  
Old 24th May 2023, 12:42
MasterPlebien's Avatar
MasterPlebien MasterPlebien is offline
Member
 
Join Date: May 2023
P2P
Posts: 4
Default
Yes, you can re-enable Anti-XSS attack after installation. Also, mentioned that having permission 777 is not recommended.
Reply With Quote
  #4  
Old 18th June 2023, 14:08
Mahmoud Mahmoud is offline
Senior Member
 
Join Date: Nov 2009
Andorra
Posts: 72
Default
for some reason i got the famous

Quote:
502 Bad Gateway

nginx
what i missed?
Reply With Quote
  #5  
Old 18th June 2023, 15:00
Subzero's Avatar
Subzero Subzero is offline
Coder
 
Join Date: Jul 2008
P2P
Posts: 190
Default
Could be any number of reasons, check your nginx error log.
Reply With Quote
  #6  
Old 19th June 2023, 09:33
MasterPlebien's Avatar
MasterPlebien MasterPlebien is offline
Member
 
Join Date: May 2023
P2P
Posts: 4
Default
Quote:
Originally Posted by Mahmoud View Post
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.
Reply With Quote
  #7  
Old 19th June 2023, 11:43
xblade's Avatar
xblade xblade is offline
Cod3r
 
Join Date: Nov 2020
P2P
Posts: 239
Default
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
__________________

i do custom mods in torrenttrader for £
Reply With Quote
  #8  
Old 1st August 2023, 06:14
chevyman78 chevyman78 is offline
Member
 
Join Date: Nov 2012
Canada
Posts: 12
Default
Enter aaPanel from your browser, how do we do this?
Reply With Quote
  #9  
Old 2nd August 2023, 11:17
MasterPlebien's Avatar
MasterPlebien MasterPlebien is offline
Member
 
Join Date: May 2023
P2P
Posts: 4
Default
type
Code:
bt
into your terminal and select option 14.
Reply With Quote
  #10  
Old 2nd August 2023, 11:37
DND DND is online now
VIP
 
Join Date: Dec 2008
Posts: 1,242
Default
from what i see code is still on mysql
that's bad
it doesn't even have prepared statements and/or parameterized queries
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 13:17. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.