Useful Linux Commands for Embraiz Web Hosting

Useful Linux Commands for Embraiz Web Hosting

At Embraiz, we provide hosting services to our valued customers, along with software maintenance. Below, you will find some essential Linux commands and setup procedures we use for managing our 24 cloud hosting servers in 2023.

Please note that although Embraiz is not a web hosting company, we are committed to offering comprehensive support to our customers. Here are the commands for setting up PHP and JAVA servers, as well as essential services:

For Both PHP and JAVA Servers:

Install and Setup MariaDB:

yum -y install epel-release
yum update
yum install mariadb-server
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
yum install htop

//enable mysql remote login
GRANT ALL PRIVILEGES ON *.* TO ‘root’@”%” IDENTIFIED BY ‘password’ WITH GRANT OPTION;
flush privileges;

Certbot Installation (https):

yum install snapd
systemctl enable –now snapd.socket
ln -s /var/lib/snapd/snap /snap

snap install –classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot

Reference: https://certbot.eff.org/instructions?ws=nginx&os=centosrhel7

For JAVA Servers:

yum install java
yum install tomcat

yum install nginx

For PHP Servers:

yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd php-fpm

Edit php.ini:
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Edit php.ini
cgi.fix_pathinfo=0

Edit /etc/php-fpm.d/www.conf:
listen = /var/run/php-fpm/php-fpm.sock
listen.owner = nginx
listen.group = nginx

systemctl start php-fpm
systemctl enable php-fpm

Other Server commands
netstat -plten|grep java
lsof -Pnl +M -i4
chown -R root:root /data/demo5
chmod -R 755 /data/production/
iftop -n

//search for text
grep -rl “payment” /data/demo2_production/englishname
mysqlcheck -u root -p -A

//transfer between servers
scp -P 22 -r /data/tomcat7/webapps_asap root@10.8.36.22:/data/tomcat7
tail -n1000 /data/tomcat7/logs/catalina.out

//check folder size
du -h –max-depth=1
service iptables stop
mysqldump -u root -p sakila > C:\MySQLBackup\sakila_20200424.sql
mysqldump -u root -p –databases sakila employees > C:\MySQLBackup\sakila_employees_20200424.sql

//check port and process
netstat -tulpn | grep :80