- Run sudo command without a password
- LAMP (Linux Apache, MySQL and PHP)
- Install Composer
- Install SQL Server PDO Driver
- Location
- Secure Shell Extension to Chrome - Remove host from
.ssh/known_hosts
[here]
- Laravel
- Folder permission: browser to Laravelprojetc and run this command
sudo chmod -R 775 storage && sudo chmod -R 775 bootstrap && sudo chown -R root:www-data .
- Starting The Scheduler
- Open cronjob config
crontab -e
- Paste the cronjob config documented here
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
- Open cronjob config
- Folder permission: browser to Laravelprojetc and run this command
- Backup your /etc/sudoers file by typing the following command:
sudo cp /etc/sudoers /root/sudoers.bkp
- Edit the
/etc/sudoers
file by typing the visudo command:sudo visudo
- Append the following entry to run ALL command without a password for a user named tom:
tom ALL=(ALL) NOPASSWD:ALL
- It must be like this image https://i.imgur.com/OWDs8jG.jpg
sudo apt update
sudo apt-get install cron
sudo apt install apache2 --yes
sudo ufw allow in "Apache Full"
Hide System info in Apache config(Well explained here)
sudo nano /etc/apache2/conf-enabled/security.conf
Set this configs
ServerTokens Prod
ServerSignature Off
sudo apt install mysql-server --yes
sudo mysql_secure_installation
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'passwordhere';
FLUSH PRIVILEGES;
exit
sudo apt install php libapache2-mod-php php-mysql
sudo systemctl restart apache2
sudo apt install curl php-cli php-mbstring git unzip --yes # install php dependences
cd ~ # browser do user directore
curl -sS https://getcomposer.org/installer -o composer-setup.php # download composer setup
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer # run composer setup and install into binaries path
rm composer-setup.php # delete composer setup
Step 1. Install 7.3
sudo su
add-apt-repository ppa:ondrej/php -y
apt-get update
apt-get install php7.3 php7.3-dev php7.3-xml -y --allow-unauthenticated
exit
Step 2. Install prerequisites
Driver version 17.2 or higher is required for Ubuntu 18.04 support. Driver version 17.3 or higher is required for Ubuntu 18.10 support.
This tutorial is to Ubuntu 18.10. To others versions, please verify over Para outras versões verifique here.
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
sudo ACCEPT_EULA=Y apt-get install mssql-tools
sudo echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
sudo echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
sudo apt-get install unixodbc-dev --yes
Step 3. Install Ubuntu Dependencies
sudo apt-get install libc6 --yes #(>= 2.21)
sudo apt-get install libstdc++6 --yes #(>= 4.9)
sudo apt-get install libkrb5-3 --yes
sudo apt-get install libcurl3 --yes
sudo apt-get install openssl --yes
sudo apt-get install debconf --yes #(>= 0.5)
# sudo apt-get install unixodbc --yes #(>= 2.3.1-1)
Step 4. Install the PHP drivers for Microsoft SQL Server
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
sudo su
echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini
echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini
exit
Step 5. Install Apache and configure driver loading
sudo su
apt-get install libapache2-mod-php7.3 apache2
a2dismod mpm_event
a2enmod mpm_prefork
a2enmod php7.3 #enable php 73
a2dismod php7.2 #disable php 72
echo "extension=pdo_sqlsrv.so" >> /etc/php/7.3/apache2/conf.d/30-pdo_sqlsrv.ini
echo "extension=sqlsrv.so" >> /etc/php/7.3/apache2/conf.d/20-sqlsrv.ini
exit
Step 6. Restart Apache and test the sample script
sudo service apache2 restart
sudo dpkg-reconfigure locales # regenerating the supported locale list
sudo update-locale LANG=pt_BR.UTF-8 #change the current default locale
sudo dpkg-reconfigure tzdata