2

I want to host my blog on it's own server, but have the URL be at mysite.com/blog

Should I do this using mod_proxy or an apache redirect, and how would I set this up on apache?

My first pass attempt looks like so in the vhost file, but failed:

<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass /blog http://blog.server's.ip.address/
    ProxyPassReverse /blog http://blog.server's.ip.address/
    ServerAdmin me@myemail.com
    ServerName mysite.com
    DocumentRoot /var/www

    <Directory /var/www>
             Order allow,deny
            allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

With this is place I get the following error when restarting apache:

  • Restarting web server apache2 /sbin/start-stop-daemon: warning: failed to kill 11306: Operation not permitted [fail]
  • The apache2 configtest failed, so we are trying to kill it manually. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now!
Sherms
  • 1,567
  • 1
  • 15
  • 31

2 Answers2

1

mod_proxy needs to be enabled before working >_<

Once I enabled it my config worked as expected.

a2enmod proxy_http
Sherms
  • 1,567
  • 1
  • 15
  • 31
-1
<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass /blog http://server4.hostinger.co.uk.ip.31.170.164.19/
    ProxyPassReverse /blog http://server4.hostinger.co.uk.ip.31.170.164.19/
    ServerAdmin http://webmail.hostinger.co.uk
    ServerName armukul.com.ip address 31.170.164.123 domain ip  ("A" DNS record) to this IP: 31.170.164.123
    DocumentRoot /var/www.armukul.com/home/u311366417

    <Directory /var/www>armukul.com
             Order allow,deny
            allow from all
    </Directory>www>armukul.net
    </Directory>www>facebook.com

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>[][1]

[1]: http://armukul.com/home