Closed magicmissile72 closed 6 years ago
Hi, why didnt you let the script creates your database?
I did that the first time, and same effect. Build attempt 1 a. Changed user from root to my created user for the database b. built DB in Maria and added user (see above commands) c. selected the 'create database and tables' options
This did not work and I get the missing tables.
So I rebuilt it with the same process, but selected 'create only the tables' option.
Are you suggesting I should be giving the script 'root' to create and use the database?
@magicmissile72 I dont know what is happening.
Usually is very simple, you just let the script creates the database.
and that is the way I usually do.
I tried it again with a fresh install. Attempted to use root...but, if I run the 'mysql_secure_installtion', the root@localhost fails. So I continued with the install like before, and this time captured the error the install page gives:
It seems to create everythine else correctly...
The Encoder seems to install fine and works...that is I can login, upload a video and it makes three versions and dumps in the video directory.
I will try again without the secure install...but for security sake, requiring an insecure installation and requiring 'root' access is a very poor practice. It also makes it next to impossible to extract the DB function into it's own tier.
Did a fresh install again, installed as root, left mysql alone, etc...exactly like your directions. I am still getting the install error it is not making the video directory...
Looks like the problem is the MySQL/MariaDB version try to search on google for "Specified key was too long; max key length is 767 bytes"
Thank you Daniel, I did some research and found that this is in fact a problem with MariaDB 10.1...the best fix for Debian 9 users which installs version 10.1 is to manually install 10.2. I did that on a fresh install of Debian 9.3, added the Maria DB repository, installed, the continued on with your original config minus the 'mysql-server' and 'mysql-client' files. Also I did not install as 'root', but created the DB manually.
It works like a CHAMP!!!! Wow!!!
I am super impressed with what you have done and you should be quite proud of your accomplishment.
Next step is to separate the encoder and DB and build as a multi-tier application.
Install Debian 9.3 from net-install cd or dvd1
Select only 'ssh server' and 'common tools'
Finish install and secure/customize with any additional apps you need (like htop, vmware-tools, etc)
ssh in and configure IP and DNS
Install MariaDB 10.2 from the repository
apt-get install software-properties-common dirmngr (wait for install to complete...)
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 (wait for install to complete...)
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.osuosl.org/pub/mariadb/repo/10.2/debian stretch main'
apt-get update
apt-get install mariadb-server
MariaDB will ask for a password during install...so enter one
Run the 'secure install' for MySQL/MariaDB
mysql_secure_installation
mysql -u root -p
CREATE DATABASE youPHPTube; CREATE USER 'youphptube'@'localhost' IDENTIFIED BY '---------------'; GRANT ALL PRIVILEGES ON youPHPTube.* TO youphptube@localhost; FLUSH PRIVILEGES;
CREATE DATABASE youPHPTubeEncoder; CREATE USER 'youphptubecoder'@'localhost' IDENTIFIED BY '---------------'; GRANT ALL PRIVILEGES ON youPHPTubeEncoder.* TO youphptubecoder@localhost; FLUSH PRIVILEGES;
quit;
apt-get install curl apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql \ php7.0-curl php7.0-gd php7.0-intl ffmpeg git libimage-exiftool-perl \ && cd /var/www/html && sudo git clone https://github.com/DanielnetoDotCom/YouPHPTube.git \ && cd /var/www/html && sudo git clone https://github.com/DanielnetoDotCom/YouPHPTube-Encoder.git \ && sudo apt-get install python \ && sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl \ && sudo chmod a+rx /usr/local/bin/youtube-dl && sudo a2enmod rewrite
note: should be all one line...
restart Apache systemctl restart apache2
Pre-configre YouPHPTube copy-n-paste the following in the CLI and wait... The 'cat' show command before and after as a sort of error checking...so you can see if it changed the value correctly. note: I need to make this into a shell script...
mkdir /var/www/html/YouPHPTube/videos
mkdir /var/www/html/YouPHPTube-Encoder/videos
chown -R www-data:www-data /var/www/html/YouPHPTube/
chmod 755 /var/www/html/YouPHPTube/videos
chown -R www-data:www-data /var/www/html/YouPHPTube-Encoder/
chmod 755 /var/www/html/YouPHPTube-Encoder/videos
cat /etc/php/7.0/apache2/php.ini | grep post_max_size
sed -i -e 's/post_max_size = 8M/post_max_size = 1000M/g' /etc/php/7.0/apache2/php.ini
cat /etc/php/7.0/apache2/php.ini | grep post_max_size
cat /etc/php/7.0/apache2/php.ini | grep upload_max_filesize
sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 1000M/g' /etc/php/7.0/apache2/php.ini
cat /etc/php/7.0/apache2/php.ini | grep upload_max_filesize
cat /etc/php/7.0/apache2/php.ini | grep max_execution_time
sed -i -e 's/max_execution_time = 30/max_execution_time = 7200/g' /etc/php/7.0/apache2/php.ini
cat /etc/php/7.0/apache2/php.ini | grep max_execution_time
cat /etc/php/7.0/apache2/php.ini | grep memory_limit
sed -i -e 's/memory_limit = 128M/memory_limit = 512M/g' /etc/php/7.0/apache2/php.ini
cat /etc/php/7.0/apache2/php.ini | grep memory_limit
End pasting
vi /etc/apache2/apache2.conf
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted
systemctl restart apache2
Go to your main site URL:
Go to your encoder site URL:
Thanks again!
@magicmissile72 I really apprecciate your tutorial, I am positive it will help others
@DanielnetoDotCom can you paste it in the wiki beside the ubunut 16.04-article? i think that would be the best place for the tutorial :)
i made this wiki-entry for it
https://github.com/DanielnetoDotCom/YouPHPTube/wiki/Install-YouPHPTube-in-Debian-9.3
so i think this can be closed. thank you for this, @magicmissile72 !
Fresh build on Debian 9.3 Followed directions and install went well. The only deviation I made from the install was i created a user account and database for both streamer and encoder rather than use the root.
I added both accounts on the install page and it 'appears' to have installed correctly, however several options in the streamer admin portal generate db errors. Example: Login as admin click "My Video's" click "Video Chart" generates this error:
Similarly, clicking "Dashboard" generates this:
Looks to be the same...