Posts

Showing posts with the label apache

Enable OPCache on Ubuntu: Alternative to APC Cache

If you are using PHP 5.5, it is not supported by APC Cache. For reference, see PHP Bug #65731 PHP 5.5 comes with it's own opcode cache which can be enabled with the following steps: 1. Enable opcache in php.ini sudo nano /etc/php5/apache2/php.ini Look for the line: ;opcache.enable=0 And replace with: opcache.enable=1 2. Enable the php mod sudo php5enmod opcache sudo service apache2 restart If you are using PHP lower than 5.5, then you can still use APC. Just run this line in the terminal to install APC. sudo apt-get install php-apc

Ubuntu 14.04 Changing Apache2 Document Root to Home Directory

The default DocumentRoot setting for Apache is in /var/www/html/ . During development, this is sometimes troublesome cause we might ran into permission issues. To prevent that we can change our document root to a location where we have more control ie. your home directory. Here is what you need to do to change your document root. 1. Look for the ff. lines in /etc/apache2/apache2.conf . <Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> 2. Change /var/www/html to your home directory /home/<user>/public_html 3. Look for the ff. line in /etc/apache2/sites-available/000-default.conf DocumentRoot /var/www/html 4. Change /var/www/html to your home directory /home/<user>/public_html 5. After saving the changes, create a public_html folder in your home directory, restart apache. sudo service apache2 reload 6. To test if it the document root is now pointed at your home directory, ...