Skip to content

Instantly share code, notes, and snippets.

@Art2B
Last active February 5, 2016 19:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Art2B/571b1a8fcfb7dcc82772 to your computer and use it in GitHub Desktop.
Save Art2B/571b1a8fcfb7dcc82772 to your computer and use it in GitHub Desktop.
Easy Wordpress with Apache2 on Ubuntu

#Easy Wordpress with Apache on Ubuntu

For the following instructions, I've use apache2 with ubuntu 14.04. The objective here is to setup quickly a wordpress site with a local domain name.

Create your Virtual host

Personnaly I follow this tutorial (french only). For your conf file, Copy the conf file I've uploaded.

##Setup Apache2 mod You need to enable mod_rewrite on apache to allow you to choose whatever url style you want. To do this run a2enmod rewrite then restart apache.

##Htaccess Copy the .htaccess I've uploaded. It allow you to use the mod_rewrite

##Good to go ! Now do what you want with your wordpress, everything is good :) !

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<VirtualHost *:80>
ServerAdmin your@mail.com
ServerName youradress.local
DocumentRoot /path/to/your/wordpress/folder
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /path/to/your/wordpress/folder>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment