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:
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 [][1]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