Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

command to install Apache

$ sudo apt install apache2
Comment

Install Apache2 Linux

sudo apt install apache2 -y
Comment

apache install

sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2
sudo apt-get purge apache2
sudo apt-get install apache2
apt-get purge libapache2-mod-php5 php5 
apt-get install libapache2-mod-php5 php5
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 :: remove user from sudoers 
Shell :: increase upload size apache 
Shell :: alpine linux /bin/sh: node: not found 
Shell :: resolvconf set dns 
Shell :: spotify linux 
Shell :: run cron once a week 
Shell :: set sublime text as git editor 
Shell :: npm_config_node_gyp 
Shell :: port kill ubuntu 
Shell :: windows cmd schedule shutdown 
Shell :: how do i know if a gem is installed 
Shell :: how to install prompt-sync in node js 
Shell :: install packer on ubuntu 
Shell :: @react-navigation/bottom-tabs install 
Shell :: install qemu 
Shell :: users list linux 
Shell :: git add commit in one command 
Shell :: ip config ubuntu 
Shell :: ubuntu install jdk 14 
Shell :: where are ubuntu files stored in windows 10 
Shell :: git commit and tag 
Shell :: ubuntu extract rar file 
Shell :: linuxbrew 
Shell :: ffprobe find video codec 
Shell :: linux restart service 
Shell :: install vim in alpine 
Shell :: npm ERR! path /usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules while installing angular cli 
Shell :: count occurrences of word in file linux ignoring case 
Shell :: generate key and certificate openssl 
Shell :: djanog shell change password 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =