<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>http_proxy &#8211; SMsoft &#8211; informatica e dintorni</title>
	<atom:link href="https://blog.smsoft.it/tag/http_proxy/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.smsoft.it</link>
	<description>consigli settimanali su MacOS, GNU/Linux ed Open Source</description>
	<lastBuildDate>Thu, 10 Sep 2020 13:47:04 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=67598</generator>
	<item>
		<title>Utilizzare un proxy per far &#8220;navigare&#8221; script PHP</title>
		<link>https://blog.smsoft.it/2012/06/22/utilizzare-un-proxy-per-far-navigare-script-php/</link>
					<comments>https://blog.smsoft.it/2012/06/22/utilizzare-un-proxy-per-far-navigare-script-php/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 22 Jun 2012 12:41:26 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Html e PHP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[http_proxy]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[proxy]]></category>
		<guid isPermaLink="false">http://blog.smsoft.it/?p=1881</guid>

					<description><![CDATA[Il titolo è abbastanza emblematico, lo so ma è difficile racchiudere tutto in poche parole. Cerchiamo di fare chiarezza. Lo scenario è il seguente: Un server web in una rete interna che può raggiungere l&#8217;esterno solo tramite un proxy. Impostando il proxy per gli utenti di sistema (come indicato negli aritcoli riportati tra le note ... <a title="Utilizzare un proxy per far &#8220;navigare&#8221; script PHP" class="read-more" href="https://blog.smsoft.it/2012/06/22/utilizzare-un-proxy-per-far-navigare-script-php/" aria-label="Per saperne di più su Utilizzare un proxy per far &#8220;navigare&#8221; script PHP">Leggi tutto</a>]]></description>
										<content:encoded><![CDATA[<p>Il titolo è abbastanza emblematico, lo so ma è difficile racchiudere tutto in poche parole.</p>
<p>Cerchiamo di fare chiarezza.<br />
Lo scenario è il seguente: Un server web in una rete interna che può raggiungere l&#8217;esterno solo tramite un proxy. Impostando il proxy per gli utenti di sistema (come indicato negli aritcoli riportati tra le note di seguito), non sarà comunque possibile la connessione degli script PHP all&#8217;esterno, operazione che potrebbe essere necessaria, ad esempio, per installare un plugin o altro.<br />
In questo caso sarà necessario indicare il proxy anche tra le variabili d&#8217;ambiente di apache. Basterà inserire nel file <strong>/etc/apache2/envvars</strong> la seguente direttiva:<br />
<code>export http_proxy=http://user:pass@IP:port<br />
export https_proxy=http://user:pass@IP:port<br />
export no_proxy=10.110.120.14,host_da_escludere</code></p>
<p>Nel caso PHP sia usato come <strong>FPM</strong>, bisognerà inserire delle direttive anche nel file del pool relativo al sito, es in <strong>/etc/php/7.0/fpm/pool.d/nomesito.conf</strong>:<br />
<code>env[http_proxy] = http://user:pass@IP:port<br />
env[https_proxy] = http://user:pass@IP:port<br />
env[no_proxy] = 10.110.120.14,host_da_escludere</code></p>
<p>dove ovviamente:<br />
<strong>user</strong>: l&#8217;username per accedere al server proxy<br />
<strong>pass</strong>: la password per accedere al server proxy<br />
<strong>IP</strong>: l&#8217;IP del server proxy<br />
<strong>port</strong>: la porta usata dal server proxy</p>
<p>Infine riavviare <strong>apache</strong> e <strong>php-fpm</strong>. Ora gli script PHP che tramite curl tenteranno la connessione all&#8217;esterno, funzioneranno correttamente.</p>
<p>Nota: consiglio anche i precedenti post relativi a <a href="http://blog.smsoft.it/2008/08/25/connettersi-con-linux-tramite-proxy/">Connettersi con linux tramite proxy</a>, <a href="http://blog.smsoft.it/2012/04/03/linux-installare-un-proxy-http-semplice-e-veloce/">Linux: Installare un proxy http semplice e veloce</a>.</p>
<p>enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2012/06/22/utilizzare-un-proxy-per-far-navigare-script-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
