How to install and use a Wordpress on a ERPNext VPS

Hi guys, all good?

So, finally I stop working with free VPSs, and start using Vultr. Not a huge improvement… baby steps…

So, I’d like to install a Wordpress in the same VPS, but can’t configure the nginx to see the port.

ERPNext with lets encrypt, with ports 80 and 443 settled.
Installed Wordpress using the same structure, considering that Wordpress uses other directories
Config in the /etc/nginx/sites-enabled:

server {
        listen 8008;
        listen [::]:8008;

        root /var/www/html;

        index.php index.html index.htm index.nginx-debian.html index;

        server_name http://my.sub.domain;

        location / {

                root /var/www/html;
        }
}

In the bench, ERPNext is config normally, with the nginx.conf pointing to the frappe/frappe-bench/sites directory, with 443 and 80 ports…

How can I make both of sites work?

Thanks!!

1 Like

On my server, I have apache running on port 80. This is through a standard LAMP installation. This contains a few sites, including some running wordpress. Port 80 and 443 are therefore reserved for sites hosted by apache.

When I set up ERPNext, it set up on port 8800.

If you want to insist on using ErpNext on port 80, then I suggest the following.

  1. Create a site using apache
  2. Set up ErpNext to run on a different port (for example 8000)
  3. On the site root, create an .htaccess file with redirect all requests to port 80 of the site, to the other site (with port 8000)

Thanks! I’m using Nginx only… Figuring out how it could be possible, using just nginx…

@xickomesquita Could you share what you did?

I am interested on this

I couldn’t… sorry… If you discover it, please share!

@xickomesquita

Hi all,

I’ve cracked it at last!

Installing ERPNext configures Nginx to look for configs in /etc/nginx/conf.d/ rather than /etc/nginx/sites-enabled. See the last line in etc/nginx/nginx.conf

   proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=web-cache:8m max_size=1000m inactive=600m;

   include /etc/nginx/conf.d/*.conf;
}

So simply put your site configuration files in the /etc/nginx/conf.d/ directory, and ensure they end with .conf or allow other extensions in /etc/nginx/nginx.conf like so:

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=web-cache:8m max_size=1000m inactive=600m;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/conf.d/*.com; #this will include all .com site configs

}

2 Likes