%name Wordpress en localhost con proxyWordPress requires internet connection in order to receive the update of the core and plugins. But if we are in a proxy network, and have our WordPress test locally, we disable the proxy to use our WordPress, but we will need to use the proxy to install new updates and plugins.

To perform this task, you have to change the configuration of Apache and our WordPress.

Let's make the example assuming that we have our WordPress installed locally on Xampp on Windows. The configuration is identical in other operating systems. The only thing I would change is the path of the files will change.

First you have to check the Apache configuration (C:xamppapacheconfhttpd.conf) and we ensure that the following modules are active (uncommented lines):

include "Conf / extra / httpd-proxy.conf"
LoadModule proxy_module modules/mod_proxy.SW
LoadModule proxy_connect_module modules/mod_proxy_connect.SW
LoadModule proxy_http_module modules/mod_proxy_http.SW

Then we open the specific configuration file for Apache Proxy (C:xamppapacheconfextrahttpd-proxy.conf) And erase everything and we bring the following:

# Implements a proxy / gateway for Apache. # Required modules: mod_proxy, mod_proxy_http # <IfModule proxy_module> <IfModule proxy_http_module> ProxyRequests On ProxyVia On <Proxy *> Order deny, allow Allow from 127.0.0.1 </ Proxy> ProxyBlock web-1.com web-2.com </ IfModule> </ IfModule>

Now we restart our Apache from XAMPP Control Panel or by running the "service http restart" command in linux.

Then we go to our WordPress configuration file (c:xampphtdocswordpresswp-config.php) And add the following customizing it with the correct values ​​of our proxy. If no user name and password discussed these lines:

# HTTP Proxies
# Dirección del proxy: proxy.web.com o IP
define( 'WP_PROXY_HOST',          '127.0.1.1' );
# Puerto del proxy
define( 'WP_PROXY_PORT',          '8080' );
# Usuario del proxy
define( 'WP_PROXY_USERNAME',      'USUARIO' );
# Contraseña del usuario del proxy
define( 'WP_PROXY_PASSWORD',      'CONTRASEÑA' );
# URLs que no quieres que pasen por el proxy
define( 'WP_PROXY_BYPASS_HOSTS',  'localhost, www.web-ejemplo.com' );

Desktop accede again to our WordPress (https: //localhost/wordpress/wp-admin/index.php) and block news should already show news, and the installation panel to search Plugins plugins you want to install.

 

 

Advertisements

Use of cookies

This site uses cookies for you to have the best user experience. If you continue to browse you are giving your consent to the acceptance of the above cookies and acceptance of our cookies policy, Click the link for more information.

OK
Notice of cookies

Pin it on Pinterest

Share This

Share

Share this with your friends!