Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

install apache2 ubuntu

sudo apt update
sudo apt install apache2
Comment

command to install Apache

$ sudo apt install apache2
Comment

Install Apache2 Linux

sudo apt install apache2 -y
Comment

install apache2

To install laravel v9 you will need apache2, php8 and composerv2 (Ubuntu 20.04/Ubuntu 18.04)
sudo apt update
sudo apt upgrade

Install and start apache2
sudo apt install apache2
sudo service apache2 start
Open: http://localhost:80
sudo service apache2 stop

Install php8
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get install php8.0 php8.0-cli php8.0-common php8.0-xml php8.0-curl
php -v

Enable mods
sudo a2enmod php8.0
sudo a2enmod headers
sudo a2enmod rewrite

Install composerv2
cd /home/user
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
compsoer -V

Install laravel project
composer create-project laravel/laravel example-app
php artisan key:generate --ansi
php artisan serve

Configuration file for apache2 example
cd /etc/apache2
sudo a2dissite 000-default.conf
cd /sites-available
sudo touch appName.conf

sudo nano appName.conf
Copy, paste and configurate:
---------------------------------------------------------------------------------
<VirtualHost *:80>
	ServerName name.local

    // If project is based on multiple env (admin/frontend)
	SetEnv ACTIVE_MODULE frontend
	
	DocumentRoot "pathDirectory/laravel/public"
	<Directory "pathDirectory/laravel/public">
	    Options Indexes FollowSymLinks MultiViews
	    AllowOverride All
	    Require all granted
	    Order allow,deny
	    Allow from all
	</Directory>

	ErrorLog /var/log/apache2/fileName.err
	CustomLog /var/log/apache2/fileName combined
</VirtualHost>
---------------------------------------------------------------------------------

sudo a2ensite appName.conf
sudo service apache2 restart
or
sudo service apache2 start
Comment

PREVIOUS NEXT
Code Example
Shell :: rename github repository command line 
Shell :: installing gnome 
Shell :: php artisan doctrine migrations add all 
Shell :: how to update application in ubunut 
Shell :: linux create user with homedir 
Shell :: how to change the directory in git bash 
Shell :: how to delay a script from running linx terminal 
Shell :: how to open a folder using terminal 
Shell :: CocoaPods could not find compatible versions for pod "razorpay_flutter" when running pod install 
Shell :: can i do git push to heroku branch which isnt a master or main 
Shell :: svn commit file 
Shell :: download office 365 for ubuntu 
Shell :: best code editors 2022 
Shell :: install from package.json 
Shell :: Git command to Change the Author Information Just for the Next Commit 
Shell :: enable option in ubuntu to create document on right click 
Shell :: how switching in git branches 
Shell :: remove all files in a directory linux 
Shell :: scan all udp ports nmap 
Shell :: create ssh key 
Shell :: Pyserial is not installed for /Applications/Xcode.app/Contents/Developer/usr/bin/python3 macos 
Shell :: git local git ignore 
Shell :: git to know committed files by author 
Shell :: tar archive all files in directory 
Shell :: creating new branch in git 
Shell :: os installation date 
Shell :: push to docker hub 
Shell :: let latest commit hash 
Shell :: git push commands 
Shell :: run index.js 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =