How To Install AVideo - YouPHPTube On Ubuntu 18.04 Server - LinuxBabe
How To Install AVideo - YouPHPTube On Ubuntu 18.04 Server - LinuxBabe
04 Server - LinuxBabe
How to Install
AVideo/YouPHPTube on
Ubuntu 18.04 Server
Last Updated: November 20th, 2020 Xiao Guoan (Admin) 26
Comments Ubuntu
AVideo Features
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 2/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
Log into your Ubuntu 18.04 server via SSH. Then go to the
web root directory.
cd /var/www/
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 3/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
cd AVideo/
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.
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 6/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
sudo mysql
Create the database user. Again, you can use your preferred
name for this user. Replace your-password with your
preferred password.
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
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 8/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
<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 ${APACHE_LOG_DIR}/avide
o.error.log
CustomLog ${APACHE_LOG_DIR}/avide
o.access.log combined
</VirtualHost>
Save and close the file. Then enable this virtual host.
see the default Apache page instead of the setup wizard, then
you need to disable the default virtual host.
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;
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 10/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
error_log /var/log/nginx/avide
o.error.log;
location ~ \.php$ {
fastcgi_split_path_info ^(.+
\.php)(/.+)$;
fastcgi_pass unix:/run/php/ph
p7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
}
iew/?page=$1 last;
}
location /videoOnly {
rewrite ^/videoOnly/?$ /vie
w/?type=video last;
}
location /audioOnly {
rewrite ^/audioOnly/?$ /vie
w/?type=audio last;
}
location = /download {
rewrite ^(.*)$ /view/download
ExternalVideo.php last;
}
location = /downloadNow {
rewrite ^(.*)$ /objects/downl
oadVideo.php last;
}
location = /getDownloadProgress {
rewrite ^(.*)$ /objects/downl
oadVideoProgress.php last;
}
location = /about {
rewrite ^(.*)$ /view/about.ph
p last;
}
location = /contact {
rewrite ^(.*)$ /view/contact.
php last;
}
location = /sendEmail {
rewrite ^(.*)$ /objects/sendE
mail.json.php last;
}
location = /captcha {
rewrite ^(.*)$ /objects/getCa
ptcha.php last;
}
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 12/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
location /monitor {
rewrite ^/monitor/(.+)$ /obje
cts/ServerMonitor/$1 last;
}
location /cat {
rewrite ^/cat/([A-Za-z0-9-]
+)/?$ /view/?catName=$1 last;
}
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;
}
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 13/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
location = /users.json {
rewrite ^(.*)$ /objects/user
s.json.php last;
}
location = /updateUser {
rewrite ^(.*)$ /objects/userU
pdate.json.php last;
}
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
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 14/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
sersGroups.php last;
}
location = /usersGroups.json {
rewrite ^(.*)$ /objects/users
Groups.json.php last;
}
location = /addNewUserGroups {
rewrite ^(.*)$ /objects/userG
roupsAddNew.json.php last;
}
location = /deleteUserGroups {
rewrite ^(.*)$ /objects/userG
roupsDelete.json.php last;
}
location = /ads {
rewrite ^(.*)$ /view/managerA
ds.php last;
}
location = /addNewAd {
rewrite ^(.*)$ /objects/video
_adsAddNew.json.php last;
}
location = /ads.json {
rewrite ^(.*)$ /objects/video
_ads.json.php last;
}
location = /deleteVideoAd {
rewrite ^(.*)$ /objects/video
_adDelete.json.php last;
}
location /adClickLo {
rewrite ^/adClickLog /object
s/video_adClickLog.php last;
}
location = /categories {
rewrite ^(.*)$ /view/managerC
ategories.php last;
}
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 15/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
location = /categories.json {
rewrite ^(.*)$ /objects/categ
ories.json.php last;
}
location = /addNewCategory {
rewrite ^(.*)$ /objects/categ
oryAddNew.json.php last;
}
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
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 16/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
Status.json.php last;
}
location = /reencodeVideo {
rewrite ^(.*)$ /objects/video
Reencode.json.php last;
}
location = /addViewCountVideo {
rewrite ^(.*)$ /objects/video
AddViewCount.json.php last;
}
location = /saveComment {
rewrite ^(.*)$ /objects/comme
ntAddNew.json.php last;
}
location /comments {
rewrite ^/comments.json/([0-
9]+)$ /objects/comments.json.php?vide
o_id=$1 last;
}
location = /login {
rewrite ^(.*)$ /objects/logi
n.json.php last;
}
location = /logoff {
rewrite ^(.*)$ /objects/logof
f.php last;
}
location = /like {
rewrite ^(.*)$ /objects/like.
json.php?like=1 last;
}
location = /dislike {
rewrite ^(.*)$ /objects/like.
json.php?like=-1 last;
}
location /update {
rewrite ^/update/?$ /update/u
pdate.php last;
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 17/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
}
location = /siteConfigurations {
rewrite ^(.*)$ /view/configur
ations.php last;
}
location = /updateConfig {
rewrite ^(.*)$ /objects/confi
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;
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 18/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
location = /upload/serverStatus {
rewrite ^(.*)$ /upload/view/statu
s.php?serverStatus=1 last;
}
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 {
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 19/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
location = /upload/queue.json {
rewrite ^(.*)$ /upload/view/queu
e.json.php last;
}
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
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 20/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
-Za-z0-9=/]+)/([0-9]+)/([0-9]+)$ /upl
oad/objects/getSpiritsFromVideo.php?b
ase64Url=$1&tileWidth=$2&totalClips=
$3 last;
}
location /upload/getLinkInfo {
rewrite ^/getLinkInfo/([A-Za-z0-9
=/]+)$ /upload/objects/getLinkInfo.js
on.php?base64Url=$1 last;
}
sudo nginx -t
Where
Now go to
tube.yourdomain.com/install/index.php and the
setup wizard will appear. On the left side, you can see if your
server meet the requirements.
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 23/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
If you use Nginx with PHP-FPM, then you need to edit the
FPM version of php.ini file.
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 Apache for the changes to
take effect.
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 24/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 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/ubuntu/install-youphptube-ubuntu-18-04-server 25/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 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/ubuntu/install-youphptube-ubuntu-18-04-server 26/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
If you use Nginx with PHP-FPM, then you need to edit the
FPM version of php.ini file.
max_execution_time = 30
memory_limit = 128M
max_execution_time = 7200
memory_limit = 512M
Save and close the file. Restart Apache for the changes to
take effect.
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 28/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
sudo rm /var/www/AVideo/upload/instal
l/ -r
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 29/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 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
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 30/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
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.
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 31/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
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
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
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 33/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
youtube-dl -a video-list.txt
Wrapping Up
[Total: 4 Average: 5]
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 34/35
1/2/23, 21:16 How to Install AVideo/YouPHPTube on Ubuntu 18.04 Server - LinuxBabe
Ubuntu Server YouPHPTube
https://www.linuxbabe.com/ubuntu/install-youphptube-ubuntu-18-04-server 35/35