Running WordPress and Ghost on Apache with mod_proxy

Posted by Jack Perry on Server Fault See other posts from Server Fault or by Jack Perry
Published on 2013-10-18T22:58:00Z Indexed on 2013/10/19 9:57 UTC
Read the original article Hit count: 369

Filed under:
|
|
|

I currently have three WordPress sites hosted on Apache with virtual host files to direct the right domain to the right DocumentRoot. Ghost (node.js) just came out and I've wanted to tinker with it and just play around on one of my spare domains. I'm not really interested in moving over to nginx so I'm trying to get Ghost working on Apache via mod_proxy. I've managed to get Ghost working on my spare domain, but I think there's a problem with my virtual host files, as all of my other domains start pointing to Ghost as well. Here are two virtual host files, one for my main WordPress site that works fine, and the second for Ghost. Domains removed and replaced with DOMAIN and DOMAIN2.

DOMAIN

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName DOMAIN.com
ServerAlias www.DOMAIN.com

DocumentRoot /var/www/DOMAIN.com/public_html
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www/DOMAIN.com/public_html>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</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 ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/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>

DOMAIN2

<VirtualHost IP:80>
    ServerAdmin EMAIL
    ServerName DOMAIN2.com
    ServerAlias www.DOMAIN2.com

    ProxyPreserveHost on
    ProxyPass / http://IP:2368/
</VirtualHost>

I get the feeling I'm not working with virtual hosts or mod_proxy right, and Google-fu has let me down after many suggested attempts. Any ideas? Thanks!

© Server Fault or respective owner

Related posts about apache2

Related posts about Wordpress