Vous souhaitez redirect le chemin / blog vers un autre serveur à l’aide d’Apache

Je souhaite héberger mon blog sur son propre serveur, mais avoir l’URL sur mysite.com/blog

Dois-je le faire en utilisant mod_proxy ou une redirection apache, et comment pourrais-je configurer cela sur apache?

Ma première tentative de passe ressemble à ceci dans le fichier vhost, mais a échoué:

 ProxyPreserveHost On ProxyPass /blog http://blog.server's.ip.address/ ProxyPassReverse /blog http://blog.server's.ip.address/ ServerAdmin [email protected] ServerName mysite.com DocumentRoot /var/www  Order allow,deny allow from all  ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined  

Avec cet endroit, je reçois l’erreur suivante lors du redémarrage d’Apache:

  • Redémarrage du serveur Web apache2 / sbin / start-stop-daemon: avertissement: échec de la suppression 11306: opération non autorisée [échec]
  • Le test de configuration apache2 a échoué, nous essayons donc de le tuer manuellement. C’est presque certainement sous-optimal, alors assurez-vous que votre système fonctionne comme vous le souhaitez maintenant!

mod_proxy doit être activé avant de travailler> _ <

Une fois que je l’ai activé, ma configuration a fonctionné comme prévu.

 a2enmod proxy_http 
  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 armukul.com Order allow,deny allow from all www>armukul.net www>facebook.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined [][1] 

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