Skip to content

Instantly share code, notes, and snippets.

@iamnnort
Last active September 8, 2017 22:32
Show Gist options
  • Save iamnnort/4717330c268fef9450daabb0156b1aa4 to your computer and use it in GitHub Desktop.
Save iamnnort/4717330c268fef9450daabb0156b1aa4 to your computer and use it in GitHub Desktop.
sudo a2enmod rewrite && sudo service apache2 restart
1) Install Apache:
sudo apt-get install apache2 - install
sudo service apache2 restart - restart demon
sudo a2enmod <mod-name> - add mode from /etc/apache2/mods-available
sudo a2enconf <config-name> - add config from /etc/apache2/conf-available
sudo a2ensite <site-name> - add vhost from etc/apache2/sites-available
2) Add vhost to apache:
open /etc/hosts and add "127.0.0.1 host1.server1"
open /etc/apache2/sites-available/ and add
<VirtualHost *:80>
#Host name
ServerName host1.server1
#Host document root
DocumentRoot /var/www/host1.server1
<Directory /var/www/host1.server1>
AllowOverride All
</Directory>
</VirtualHost>
open /var/www and sudo mkdir host1.server1 && sudo chmod -R 777 host1.server1
open etc/apache2/sites-available and add file "host1.server1.conf"
sudo a2ensite host1.server1.conf
sudo service apache2 restart
3) Install PHP:
sudo apt-get install libapache2-mod-php5
sudo apt-get install php5-cli
sudo a2enmod php5
sudo apt-get install php5-extension - add extension to php
4) Install MySQL:
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
sudo a2dismod php5.6
sudo a2enmod php7.1
sudo service apache2 restart
@iamnnort
Copy link
Author

iamnnort commented Sep 8, 2017

sudo apt-get remove php*

sudo apt-get install php7.1 php7.1-cli php7.1-common libapache2-mod-php7.1 php7.1-mysql php7.1-fpm php7.1-curl php7.1-gd php7.1-bz2 php7.1-mcrypt php7.1-json php7.1-tidy php7.1-mbstring php-redis php-memcached

@iamnnort
Copy link
Author

iamnnort commented Sep 8, 2017

apt-get install php7.1-xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment