Skip to content

Instantly share code, notes, and snippets.

@fongreecss
Last active July 20, 2017 19:42
Show Gist options
  • Save fongreecss/15aa4454cbb53e589b61bce4a060b772 to your computer and use it in GitHub Desktop.
Save fongreecss/15aa4454cbb53e589b61bce4a060b772 to your computer and use it in GitHub Desktop.
#install apache2
sudo apt-get install apache2 -y
sudo service apache2 start
#/var/www/html/
#A. open
#sudo nano /etc/apache2/apache2.conf
#A.1
#Timeout 30
#KeepAlive On
#MaxKeepAliveRequests 0
#KeepAliveTimeout 5
#install mysql
sudo apt-get install mysql-server mysql-client php5-mysql -y
sudo service mysql start #restart, stop, status
sudo mysql_secure_installation #important (choose all y)
#install php
sudo apt-get install php5 libapache2-mod-php5 -y
sudo service apache2 restart
sudo apt-get install php5-curl php5-fpm php5-cli php5-mcrypt
sudo service apache2 restart
#create php.php with phpinfo(); in /var/www/html to test php,mysql,apache
sudo nano /etc/apache2/mods-enabled/dir.conf
#<IfModule mod_dir.c>
# DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
#</IfModule>
#phpmyadmin
sudo apt-get install phpmyadmin -y
#select apache2 when prompted (dont forget to press space to check it)
#dbconfig-common select yes and conf it
sudo service apache2 restart
#enabling php modules
sudo php5enmod mcrypt #dismod for disabling
sudo a2enmod ssl
sudo a2enmod rewrite
sudo phpenmod mbstring
#AllowOverride All (for seo friendly urls - /etc/apache2/apache2.config(change default values) or (older) in /etc/apache2/sites-available/default
#allow .htacces (rewrite rules) to override default rewrite rules AllowOverride All
#AllowOverrite None for not allowing .htacces to override rules
sudo chgrp $(whoami) -R /var/www/html
sudo find /var/www/html -type d -exec chmod 775 {} \;
sudo find /var/www/html -type f -exec chmod 664 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment