Skip to content

Instantly share code, notes, and snippets.

@Bhavya8181
Created November 17, 2023 05:42
Show Gist options
  • Save Bhavya8181/c5a443a41bedace3f176058999f083b5 to your computer and use it in GitHub Desktop.
Save Bhavya8181/c5a443a41bedace3f176058999f083b5 to your computer and use it in GitHub Desktop.
Setup Live server project in linux
Setup Live server project
.pem file
.ppk file
3.89.237.111
ubantu
===========================================
.ppk file
.pem file
user name of server = ubuntu@3ntu
host: 3.89.237.111
Download .ppk fike and go to downloaded path and login to server using below command
1. Server Login
=======================================
=> ssh ubuntu@3.89.237.111 -i bransspot.ppk
if permission denied (publickey) issue occur then run below command
=> chmod 400 brandspot.pem
=> ssh -i brandspot.pem ubuntu@3.89.237.111
2. Perform ALL Step to setup appache, php, mysql & composer in server
=============================
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2
sudo apache2ctl configtest -> system ok
sudo systemctl restart apache2 //active running accu joi e
sudo apt install mysql-server mysql-client
mysql --version
sudo systemctl status mysql.service // active running avvu joi e
sudo apt install php
php --version
sudo apt install php-curl php-gd php-mbstring php-mysql php-zip php-json php-xml
sudo chown www-data:www-data -R /var/www/html/
sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo systemctl restart apache2
sudo vim /etc/apache2/apache2.conf
Include /etc/phpmyadmin/apache.conf // add this lind to end of file
sudo systemctl restart apache2 // restarting the service.
------------------------
phpmyadmin error root login - do this
---SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'--
1. sudo mysql -p -u root and enter password
2. CREATE USER 'pmauser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password_here';
3. GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'localhost';
4. Now you can login using new user.
---------------
sudo apt install wget php-cli php-zip unzip
------------------------------- Allow Override code and .htccess
open this
/etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
and change it to;
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
For above change do below step
apache config vim editor open
add below line
Include /etc/phpmyadmin/apache.conf (esc +shift + :)
type "wq" and then enter
--------------------------------
install composer
sudo apt-get update
sudo apt-get install curl php5-cli git
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
To test your installation, run:
composer
More infor: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-14-04
3. Setup laravel project
=====================================
1. Clone project to /var/www/html and respective folder. (or add zip of your project)
2. Put.htaccess file to that folder - Link - https://drive.google.com/file/d/1fT-rkw9ZMJp_Hr4kKOBJ1m37rpz6XA3R/view?usp=sharing
3. If still its not working - then Server - rewrite rule is not working. needs to be updated it.
4. Go to /etc/apache2/apache2.conf file.
Make it like this
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All <----------- by default its None - make it to All
Require all granted <------------ denied by default
</Directory>
5. Restart apache
sudo service restart apache2
6. Give basic permissions
sudo chmod -R 777 storage
sudo chmod -R 777 public/assets
sudo chmod -R 777 bootstrap/cache
php artisan storage:link (link storage to public).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment