How to setup your Linux Server and install nodejs, python, ffmpeg and java. Working good for Discord Bot hosting and other hostings!
Those commands are all needed to install and setup a Debian (Linux) Server for Bot hosting, and general stuff like everything!
1. Install sudo
apt-get install sudo
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev curl
sudo apt update
sudo apt install -y build-essential curl
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install -y yarn
sudo apt-get install python-pip
sudo apt-get install python3-pip
curl -O https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz
tar -xf Python-3.9.1.tar.xz
cd Python-3.9.1
./configure --enable-optimizations
make -j 4
sudo make altinstall
python3.9 --version
sudo apt update
sudo apt install ffmpeg
ffmpeg -version
wget https://download.java.net/openjdk/jdk13/ri/openjdk-13+33_linux-x64_bin.tar.gz
sudo mkdir -p /usr/lib/jvm
sudo tar zxvf openjdk-13+33_linux-x64_bin.tar.gz -C /usr/lib/jvm
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-13/bin/java" 1
sudo update-alternatives --set java /usr/lib/jvm/jdk-13/bin/java
java -version
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install lighttpd
sudo systemctl start lighttpd
sudo systemctl enable lighttpd
sudo apt-get install mariadb-server mariadb-client -y
sudo mysql_secure_installation
Answer all the questions as shown below:
Change the root password? [Y/n] n
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
sudo apt-get install php php-cgi php-fpm php-mysql -y
sudo nano /etc/php/7.3/fpm/php.ini
Change the following line: (ctrl + w search for it)
cgi.fix_pathinfo=1
sudo nano /etc/php/7.3/fpm/pool.d/www.conf
Find the following line:
listen = /run/php/php7.3-fpm.sock
And replace it with the following line:
listen = 127.0.0.1:9000
sudo systemctl restart php7.3-fpm
sudo nano /etc/lighttpd/conf-available/15-fastcgi-php.conf
Find the following line:s
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php.socket",
And replace it with the following lines:
"host" => "127.0.0.1",
"port" => "9000",
sudo lighty-enable-mod fastcgi
sudo lighty-enable-mod fastcgi-php
sudo nano /etc/lighttpd/conf-available/example.com.conf
Add the following lines:
$HTTP["host"] == "www.example.com" {
server.document-root = "/var/www/html/"
server.errorlog = "/var/log/lighttpd/example.com-error.log"
}
Save and close the file when you are finished. Then, enable the Virtual host with the following command:
ln -s /etc/lighttpd/conf-available/example.com.conf /etc/lighttpd/conf-enabled/
Now feel free to code your php website!
sudo nano /var/www/html/index.php
Example Content:
<?php phpinfo(); ?>
Save and close the file. Then, change the ownership of the Lighttpd document root directory to www-data with the following command:
chown -R www-data:www-data /var/www/html/
Finally, restart Lighttpd service to apply all the configuration changes:
systemctl restart lighttpd
You can always Support me by inviting one of my own Discord Bots
BITTMAX Quality is their solution. Bittmax is our first and probably most important sponsor!
What they are offering:
Quality LXC & KVM (Root) Server Minecraft Hosting, as well as BungeeCord Network Hosting support Cheap and fast Domains WEBHOSTING DISCORD, TEAMSPEAK, Setups / Music Bots GAME SERVER, Rust, Gary's Mod, ..
Discord Server: https://discord.gg/GgjJZCyYKD
Website: https://bittmax.de/
GET 5% OFF EVERYTHING FOR EVER!
Code: x10
MC-Host24.de is selling the Best Digital Hosting Services ever! Like For games..
What they are offering:
Quality LXC & KVM (Root) Server WORLDS BEST Minecraft Hosting, Cheap and fast Domains WEBHOSTING DISCORD, TEAMSPEAK, Setups / Music Bots GAME SERVER, Rust, Gary's Mod, ..
Discord Server: https://discord.com/invite/4dGuGXK4A4
Website: mc-host24.de