Install AVideo on CentOS 8 Guide
Install AVideo on CentOS 8 Guide
How to Install
AVideo/YouPHPTube on
CentOS 8 Server
Last Updated: November 20th, 2020 Xiao Guoan (Admin) 3
Comments CentOS
AVideo Features
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 2/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
Log into your CentOS 8 server via SSH. Then go to the web
root directory.
cd /var/www/
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 3/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
cd AVideo/
Apache
Nginx
It’s very important that you use the latest version, or you
might not be able to download videos from other sites. We
can create a Cron job to automatically check and install the
latest version.
sudo crontab -e
Add the following line at the end of the Crontab file to try
upgrading YouTube-DL daily.
mysql -u root -p
Create the database user. Again, you can use your preferred
name for this user. Replace your-password with your
preferred password.
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 6/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
Grant privileges.
flush privileges;
exit;
Apache
Put the following text into the file. Replace the red-colored
text with your actual data. I use a subdomain in this tutorial.
You can use your main domain name if you prefer. Don’t
forget to set DNS A record for the domain name in your DNS
record manager. Also, note that the document root directory
is case-sensitive and you should not add a forward slash at
the end.
<VirtualHost *:80>
ServerName tube.yourdomain.com
DocumentRoot /var/www/AVideo
<Directory /var/www/AVideo>
DirectoryIndex index.php
Options +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/avideo.er
ror.log
CustomLog /var/log/httpd/avideo.a
ccess.log combined
</VirtualHost>
Save and close the file. Restart Apache for the changes to
take effect.
Nginx
Put the following text into the file. Replace the red-colored
text with your actual data. I use a subdomain in this tutorial.
You can use your main domain name if you prefer. Don’t
forget to set DNS A record for the domain name in your DNS
record manager. Also note that the document root directory is
case-sensitive.
server {
listen 80;
listen [::]:80;
server_name tube.yourdomain.com;
root /var/www/AVideo;
index index.php index.html index.
htm;
charset utf-8;
client_max_body_size 2G;
access_log /var/log/nginx/avide
o.access.log;
error_log /var/log/nginx/avide
o.error.log;
location ~ \.php$ {
fastcgi_split_path_info ^(.+
\.php)(/.+)$;
fastcgi_pass unix:/run/php-fp
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 9/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
m/www.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
}
}
location /video {
rewrite ^/video/([A-Za-z0-9-
_.]+)/?$ /view/?videoName=$1 last;
}
location /videoEmbeded {
rewrite ^/videoEmbeded/([A-Za
-z0-9-_.]+)/?$ /view/videoEmbeded.ph
p?videoName=$1 last;
}
location = /upload {
rewrite ^(.*)$ /view/mini-upl
oad-form/ last;
}
location = /fileUpload {
rewrite ^(.*)$ /view/mini-upl
oad-form/upload.php last;
}
location /uploadStatu {
rewrite ^/uploadStatus /view/
mini-upload-form/videoConversionStatu
s.php last;
}
location = /user {
rewrite ^(.*)$ /view/user.php
last;
}
location = /users {
rewrite ^(.*)$ /view/managerU
sers.php last;
}
location = /users.json {
rewrite ^(.*)$ /objects/user
s.json.php last;
}
location = /updateUser {
rewrite ^(.*)$ /objects/userU
pdate.json.php last;
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 12/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
}
location = /savePhoto {
rewrite ^(.*)$ /objects/userS
avePhoto.php last;
}
location = /addNewUser {
rewrite ^(.*)$ /objects/userA
ddNew.json.php last;
}
location = /deleteUser {
rewrite ^(.*)$ /objects/userD
elete.json.php last;
}
location = /recoverPass {
rewrite ^(.*)$ /objects/userR
ecoverPass.php last;
}
location = /saveRecoverPassword {
rewrite ^(.*)$ /objects/userR
ecoverPassSave.json.php last;
}
location = /signUp {
rewrite ^(.*)$ /view/signUp.p
hp last;
}
location = /createUser {
rewrite ^(.*)$ /objects/userC
reate.json.php last;
}
location = /usersGroups {
rewrite ^(.*)$ /view/managerU
sersGroups.php last;
}
location = /usersGroups.json {
rewrite ^(.*)$ /objects/users
Groups.json.php last;
}
location = /addNewUserGroups {
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 13/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
}
location = /deleteCategory {
rewrite ^(.*)$ /objects/categ
oryDelete.json.php last;
}
location = /orphanFiles {
rewrite ^(.*)$ /view/orphanFi
les.php last;
}
location = /mvideos {
rewrite ^(.*)$ /view/manager
Videos.php last;
}
location = /videos.json {
rewrite ^(.*)$ /objects/video
s.json.php last;
}
location = /deleteVideo {
rewrite ^(.*)$ /objects/video
Delete.json.php last;
}
location = /addNewVideo {
rewrite ^(.*)$ /objects/video
AddNew.json.php last;
}
location = /refreshVideo {
rewrite ^(.*)$ /objects/video
Refresh.json.php last;
}
location = /setStatusVideo {
rewrite ^(.*)$ /objects/video
Status.json.php last;
}
location = /reencodeVideo {
rewrite ^(.*)$ /objects/video
Reencode.json.php last;
}
location = /addViewCountVideo {
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 15/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
gurationUpdate.json.php last;
}
location = /charts {
rewrite ^(.*)$ /view/charts.p
hp last;
}
location = /upload/index.php {
rewrite ^(.*)$ /upload/view/in
dex.php last;
}
location = /upload/isAdmin {
rewrite ^(.*)$ /upload/view/isA
dmin.php last;
}
location = /upload/removeStreamer
{
rewrite ^(.*)$ /upload/view/remo
veStreamer.php last;
}
location = /upload/priority {
rewrite ^(.*)$ /upload/view/prio
rity.php last;
}
location = /upload/status {
rewrite ^(.*)$ /upload/view/stat
us.php last;
}
location = /upload/serverStatus {
rewrite ^(.*)$ /upload/view/statu
s.php?serverStatus=1 last;
}
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 17/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
location = /upload/upload {
rewrite ^(.*)$ /upload/view/uploa
d.php last;
}
location = /upload/listFiles.json {
rewrite ^(.*)$ /upload/view/listFi
les.json.php last;
}
location = /upload/deleteQueue {
rewrite ^(.*)$ /upload/view/delet
eQueue.php last;
}
location = /upload/saveConfig {
rewrite ^(.*)$ /upload/view/saveC
onfig.php last;
}
location = /upload/youtubeDl.json {
rewrite ^(.*)$ /upload/view/youtu
beDl.json.php last;
}
location = /upload/send.json {
rewrite ^(.*)$ /upload/view/send.
json.php last;
}
location = /upload/streamers.json {
rewrite ^(.*)$ /upload/view/strea
mers.json.php last;
}
location = /upload/queue.json {
rewrite ^(.*)$ /upload/view/queu
e.json.php last;
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 18/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
location = /upload/queue {
rewrite ^(.*)$ /upload/view/queu
e.php last;
}
location = /upload/login {
rewrite ^(.*)$ /upload/objects/lo
gin.json.php last;
}
location = /upload/logoff {
rewrite ^(.*)$ /upload/objects/lo
goff.json.php last;
}
location /upload/ {
rewrite "^/getImage/([A-Za-z0-9
=/]+)/([A-Za-z0-9]{3})$" /upload/obje
cts/getImage.php?base64Url=$1&format=
$2 last;
rewrite "^/getImageMP4/([A-Za-z0-
9=/]+)/([A-Za-z0-9]{3})/([0-9.]+)$" /
upload/objects/getImageMP4.php?base64
Url=$1&format=$2&time=$3 last;
}
location /upload/getSpiritsFromVide
o {
rewrite ^/getSpiritsFromVideo/([A
-Za-z0-9=/]+)/([0-9]+)/([0-9]+)$ /upl
oad/objects/getSpiritsFromVideo.php?b
ase64Url=$1&tileWidth=$2&totalClips=
$3 last;
}
location /upload/getLinkInfo {
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 19/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
rewrite ^/getLinkInfo/([A-Za-z0-9
=/]+)$ /upload/objects/getLinkInfo.js
on.php?base64Url=$1 last;
}
sudo nginx -t
Where
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 21/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
post_max_size = 8M
upload_max_filesize = 2M
Change the values according to the video file size you are
going to upload. For example, if you allow uploading 1G
video file, then
post_max_size = 1024M
upload_max_filesize = 1024M
Save and close the file. Restart PHP-FPM for the changes to
take effect.
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 23/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
sudo rm /var/www/AVideo/install/ -r
Click the Go to the main page button and you will see
the AVideo main page.
You can click the drop-down menu on the left and login as
the admin user and with the password you set just a few
moments ago.
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 24/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
Go to https://tube.yourdomain.com/upload/ . You
will be redirected to the Encoder setup wizard. If you are not
automatically redirected, then you can manually enter the
setup wizard URL.
https://tube.yourdomain.com/upload/in
stall/index.php/
The left-hand side will show you if your server meet the
requirements of AVideo Encoder.
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 25/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
Find the following line, and remove the semicolon (;) at the
beginning.
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 26/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
;env[PATH] = /usr/local/bin:/usr/bi
n:/bin
max_execution_time = 30
memory_limit = 128M
max_execution_time = 7200
memory_limit = 512M
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 28/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
sudo rm /var/www/AVideo/upload/instal
l/ -r
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 29/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
Now log out and log back in. If you click the encode
video and audio button on the upper-right corner, you
will be taken to your own encoder to upload videos. It should
be noted that the encoding speed depends on your server’s
CPU power. It doesn’t require much RAM because the
encoder will copy the video to a temporary file in the upload
directory ( /var/www/AVideo/upload/videos ).
Enable SMTP.
Enable SMTP Auth.
Use tls in SMTP Secure.
Use 587 as the SMTP port.
Enter your mail server’s hostname.
Enter an SMTP username and password.
Click the Save button to save the settings, then click Test
Email to see if it’s working.
Add the following two lines at the end of the file.
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 31/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
sudo sysctl -p
sysctl net.ipv4.tcp_congestion_contro
l
Output:
net.ipv4.tcp_congestion_control = bbr
Mobile Apps
You can download the free android app or iOS app by doing
a search for AVideo on Google Play Store or YPT Mobile
in Apple Store. White-label mobile app require a paid
license.
Troubleshooting
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 32/35
1/2/23, 21:14 How to Install AVideo/YouPHPTube on CentOS 8 Server - LinuxBabe
It’s likely that you have added extra forward slash in the
Apache or Nginx virtual host file for the web root directory.
Instead of using
DocumentRoot /var/www/AVideo/
DocumentRoot /var/www/AVideo
If the main website isn’t working properly, you can check the
log file at /var/www/AVideo/videos/avideo.log . If
your encoder isn’t working properly, you can check the log
file at
/var/www/AVideo/upload/videos/avideo.log .
Other Tidbits
cd /var/www/AVideo/videos/
sudo rm *Low.mp4
sudo rm *SD.mp4
youtube-dl -a video-list.txt
Wrapping Up
[Total: 2 Average: 5]
https://www.linuxbabe.com/centos/install-avideo-youphptube-centos-8-server 35/35