Posts

Showing posts with the label apache2

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

Setup Virtual Hosts in Ubuntu

Open terminal then run the command. cd /etc/apache2/sites-available/ sudo cp default llanalewis.dev sudo nano llanalewis.dev Change llanalewis.dev to your vhost name. In some ubuntu versions, default is 000-default Copy and paste the code below to llanalewis.dev : <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName llanalewis.dev DocumentRoot /home/user/public_html/llanalewis_dev <Directory /home/user/public_html/llanalewis_dev> AllowOverride All allow from all </Directory> </VirtualHost> Save and close the file then open /etc/hosts . Add the line below to the list of your hosts 127.0.0.1 llanalewis.dev Save and close /etc/hosts then on the terminal enable your new vhost by running the command below: sudo a2ensite llanalewis To disable the site, just run: sudo a2dissite llanalewis To apply the changes, restart your apache, type on the terminal: sudo service apache2 restart On your favorite browser, type your new virtual hos...