Logo
  • PHP
    • HipHop / HHVM
    • Modern PHP
    • PHPStorm
    • LAMP
    • Laravel
    • Composer
    • PDO
  • JavaScript
    • node.js
    • AngularJS
  • CSS
    • SASS
    • “CSS4” (CSS level 4)
  • HTML
  • Git
  • LAMP
  • Vagrant
  • UI / UX
  • Architecture of …
  • Off-Topic
With ♥ from Berlin
April 21, 2014
Chris
LAMP, Linux, Local Development, PHP, Server, Ubuntu
Comments Off on How to enable mod_rewrite in Ubuntu 14.04 LTS

How to enable mod_rewrite in Ubuntu 14.04 LTS

PreviousNext

A little note first: This is the most basic way to enable mod_rewrite. However, it’s not the best way. The more correct way would be to setup a vhost and change its config, but unless you are a professional and know exactly what you do this thing will do the job perfectly.

Please note that Ubuntu 14.04 LTS comes with Apache 2.4, while Ubuntu 12.04 LTS came with Apache 2.2. This new version introduced different default config filenames and in general some differences.

 

Activate the mod_rewrite module with

sudo a2enmod rewrite

and restart the apache

sudo service apache2 restart

To use mod_rewrite from within .htaccess files (which is a very common use case), edit the default VirtualHost with

sudo nano /etc/apache2/sites-available/000-default.conf

Search for “DocumentRoot /var/www/html” and add the following lines directly below:

<Directory "/var/www/html">
    AllowOverride All
</Directory>

Save and exit the nano editor via CTRL-X, “y” and ENTER.

Restart the server again:

sudo service apache2 restart

Voila! To check if mod_rewrite is installed correctly, check your phpinfo() output. It should have this in it:

mod-rewrite-apache-2-4

apachemodmod_rewriterewrite
Share this
phpstorm-8

Ignore .idea folder from git in PHPStorm

By default (?) PHPStorm will create a hidden folder named .idea directly within your project, containing user-specific stuff like chosen

DigitalOcean coupon voucher 50

Only today: $50 coupon for DigitalOcean SSD VPS / hosting

Wow! The supernice SSD-cloud-server-provider DigitalOcean adds $50 (!) to new customers accounts ONLY TODAY (US-time-zones, so calculate if this is

phpstorm-github-code-color-syntax-theme

Get Github’s code colors in PHPStorm (2014 style)

I really love the colors on GitHub’s code previews but couldn’t find any themes that copy that in a beautiful

forbes 30 under 30

Need motivation ? Check out these 2 awesome “FORBES 30 under 30” lists (web, UI, games)

The FORBES magazine has just published the new “30 under 30” lists, and they are really really interesting! Lots of

(Links) How to fix an extremely slow Symfony inside a Vagrant box

When you work with Vagrant (if not – try it!) on a Windows or Mac machine (which is an excellent

ubuntu-14-04-lts lamp

How to install/setup a basic LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 14.04 LTS

This little tutorial shows how to setup Apache, MySQL and PHP on a Linux server, in this case Ubuntu 14.04

Hacking ATMs – A conference talk about the current security state of Windows XP driven cash machines

A few days ago the 30th edition of Germany’s Chaos Communication Congress took place, a high-profile event for IT-security and

sass

New features in SASS 3.3 (a talk by SASS-creator Chris Eppstein)

A very interesting conference talk by Chris Eppstein, creator of SASS itself, showing some of the new features in SASS

Symfony devs: Creator of Symfony framework is hiring (Cologne, Germany)!

Probably one of the most interesting companies for a PHP developer is currently hiring Juniors and Seniors in Cologne, Germany.

pdo-debug

Debug PDO with this one-line function. Yeah!

Update: This article is a little bit older, the tool has changed gently. Everthing this article still works exactly like

1/4

Categories

Search

How to get a single table out of a massive MySQL .sql database backup file (mysql dump splitter)
mod-rewrite-ubuntu-14-04-lts
EOL lists of Ubuntu, Debian and CentOS for your server plannings
php
Must-read PHP blog: PHPweekly.com
photoshop-cc-deal
Adobe offers Photoshop for $9.99 per month (limited deal)
vagrant
How to copy Vagrant boxes (or duplicate them)
Google I/O 2014 – HTTPS Everywhere (video)
php uk conference
Profiling PHP Applications by Bastian Hofmann (video from PHP UK Conference 2014)
php
PHP 5.7 gets refactored core, is 10%-30% faster than PHP 5.5! Wow!
ubuntu-14-04-lts lamp
How to install/setup a basic LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 12.04 or Debian 7.0/7.1
hiphop php
PHP’s HipHop outperforms PHP 5.5 with Zend OPCache and Nginx by 15-20 times
phpstorm-github-code-color-syntax-theme
Get Github’s syntax highlighting colors in PHPStorm
php
PHP.net hacked, but most things are fine again
The architecture of StackOverflow
set up a local virtual machine for development with vagrant and puphpet / puppet (and ubuntu, linux, php, apache, mysql)
A super-simple pre-configured Vagrant box with HipHop, Hack and Hack code examples
js javascript
Push database changes to all clients in real-time (!) with AngularJS and Firebase

Tags

apache bash centos composer conference coupon CSS debian fonts framework git GitHub hack HHVM HipHop HTML HTML5 IDE JavaScript JS LAMP laravel linux mod_rewrite MVC MySQL Nginx optimization PHP PHP 5.5 PHP 5.6 phpmyadmin PHPStorm security server SSD Ubuntu UI UX vagrant video virtual machine voucher VPS wordpress
Side-Project: Wordle-Solver:
www.wordle-helper.info

Pages

  • Privacy Policy