Installing Apache2
1 2 3 4 5 |
sudo apt install -y apache2 sudo apt install -y unzip zip curl sudo a2enmod rewrite headers expires ssl && sudo service apache2 restart |
Installing PHP 7.2.x
1 2 3 4 5 6 7 8 9 |
sudo apt-cache search php7.2- sudo apt install -y php7.2 sudo apt install -y php7.2-common php7.2-cli \ php7.2-gd \ php7.2-curl php7.2-intl \ php7.2-mbstring php7.2-bcmath \ php7.2-imap php7.2-xml php7.2-zip |
Installing Mod Apache
1 |
sudo apt install -y libapache2-mod-php7.2 |
Installing Mod For Nginx
1 |
sudo apt-get install php7.2-fpm |
Installing Mod MySQL
1 |
sudo apt install -y php7.2-mysql |
Installing Mod PostgreSQL
1 |
sudo apt install -y php7.2-pgsql |
Create Swap Memory (For Low Memory VPS)
1 2 3 4 5 6 7 |
sudo fallocate -l 2G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile |
Installing Composer 1.x
1 |
sudo curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=1.10.19 |
Or Installing Composer 2.x
1 |
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer |
Setup Laravel Project
1 2 3 |
cd /var/www/html sudo chmod -R o+w /var/www/html |
Create project from Laravel repository (Laravel 7.x Framework)
1 2 3 4 5 6 7 8 9 |
sudo composer create-project --prefer-dist laravel/laravel myapp "7.*" sudo chgrp -R www-data /var/www/html/myapp cd var/www/html/myapp/ sudo chmod -R ug+rwx storage bootstrap/cache sudo chgrp -R www-data storage bootstrap/cache |
Installing PostgreSQL 10.x
1 2 3 4 5 6 7 8 9 10 11 |
cd /tmp/ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" > /etc/apt/sources.list.d/postgres.list' sudo apt update sudo apt-get install -y postgresql-10 sudo service postgresql restart |
Set password for DB administrator (postgres)
1 2 3 4 5 6 7 8 9 10 11 |
su - postgres psql postgres=# \password postgres exit su - postgres createdb YOUR_DATABASE_NAME |
Drop Database
1 2 3 |
su - postgres dropdb YOUR_DATABASE_NAME |
Create another Role
1 2 3 |
su - postgres createuser YOUR_USERNAME -s --pwprompt |
Installing Percona Xtra Cluster MySQL 5.7.x
1 |
sudo apt-get remove apparmor |
1 |
sudo apt-get install software-properties-common |
1 2 3 |
apt-key adv --keyserver keys.gnupg.net --recv-keys 8507EFA5 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8507EFA5 |
1 |
sudo nano /etc/apt/source.list |
1 2 |
deb http://repo.percona.com/apt bionic main testing deb-src http://repo.percona.com/apt bionic main testing |
1 |
sudo apt-get update |
1 |
sudo apt-get install -y percona-xtradb-cluster-server percona-xtradb-cluster-server-5.7 |
1 2 3 |
mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'" mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'" mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'" |
1 |
sudo service postgresql restart |
1 2 3 |
cd /etc/mysql/percona-xtradb-cluster.conf.d/ sudo cp mysqld.cnf mysqld.cnf.bak |
Add this command to last line
1 |
sudo nano mysqld.cnf |
1 2 |
bind-address=0.0.0.0 pxc_strict_mode=DISABLED |
1 |
sudo service mysql restart |
Create root user on any address
1 |
sudo mysql -uroot |
1 |
CREATE USER 'root'@'%' IDENTIFIED BY '123456';GRANT ALL on *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;FLUSH PRIVILEGES; |