blob: a884b77aab3e3e24ade645a568f341505cb773d3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
There are several ways to setup Wordpress & Apache in Debian. However the
maintainer's recommended way with the helper script `setup-mysql` uses:
## Virtual host VirtualDocumentRoot
NameVirtualHost *:80
<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot /usr/share/wordpress
Options All
# wp-content in /srv/www/wp-content/$0
RewriteEngine On
RewriteRule ^/wp-content/(.*)$ /srv/www/wp-content/%{HTTP_HOST}/$1
</VirtualHost>
For this configuration to work you'll also need to have mod_rewrite
and mod_vhost_alias loaded and working in Apache.
To enable these modules run
a2enmod rewrite && a2enmod vhost_alias && /etc/init.d/apache2 restart
The above example is checked. Here are some _alternative_ suggestions:
## A defined Virtual host
NameVirtualHost *:80
<VirtualHost *:80>
ServerName blog.example.com
DocumentRoot /usr/share/wordpress/
DirectoryIndex index.php index.html
ErrorLog /var/log/apache2/wp-error.log
TransferLog /var/log/apache2/wp-access.log
# wp-content in /var/lib/wordpress/wp-content
Alias /wp-content /var/lib/wordpress/wp-content
<Directory /usr/share/wordpress>
Options FollowSymLinks
Require all granted
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
## Without using Virtual host, hosted off /blog
Alias /blog/wp-content /var/lib/wordpress/wp-content
Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
# Tips
If permalinks or rewrite is not working you might need:
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
If NameVirtualHost *:80 is not working, you probably need to replace the * with
the actual IP or hostname of your server.
|