Deployment/Apache: Difference between revisions
From charlesreid1
| Line 52: | Line 52: | ||
<pre> | <pre> | ||
apt-get install libapache2-mod-php | sudo apt-get install libapache2-mod-php | ||
</pre> | </pre> | ||
See [[PHP/Apache/php.ini]] | See [[PHP/Apache/php.ini]] | ||
<pre> | |||
sudo a2enmod php7.0 | |||
</pre> | |||
See [https://help.ubuntu.com/community/ApacheMySQLPHP] | See [https://help.ubuntu.com/community/ApacheMySQLPHP] | ||
Revision as of 11:27, 28 October 2017
Deploying Apache Server
Conf
Configuration file is in /etc/apache2/apache2.conf
Edit:
- Directory tag corresponding to one-level-up from your web root
Sites Available and Sites Enabled
This always throws me off.
Edit sites-available/000-default.conf (or make your own conf file in sites-available).
sudo a2ensite 000-default sudo service apache2 restart
To disable:
sudo a2dissite 000-default sudo service apache2 restart
PHP
Set Up PHP
Make sure you have php installed:
$ apt-get install -y php
PHP configuration file is in /etc/php/7.0/cli/php.ini
Things you might wanna change:
short_open_tag = On- enables short php open tag <?magic_quotes_gpc = On- puts slashes before quotes in user inputdisplay_errors = Offif your site is live
If you want to send mail, see PHP/Mail page.
Enable PHP in Apache
Start by installing the PHP mod for Apache:
sudo apt-get install libapache2-mod-php
sudo a2enmod php7.0
See [3]
SSL
See LetsEncrypt for creation of SSL certificate.