Webinoly is just the perfect tool for NGINX experts. Give it a try!
0 votes
793 views
by Rookie

Hi, I want to add extra config code in the wordpress installation when it is first created using this command... sudo site example.com -wp=default

I want to add the following lines below in all sites wp-config... I'm trying to keep my server space low from using the same resources. How can I do this?

define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/wp-content/mydir/plugins' );
define( 'WP_PLUGIN_URL', 'http://example.com/wp-content/mydir/plugins' );

1 Answer

0 votes
by Expert

Hi Mike,

I don't understand, just add it. You are free to add whatever you want, just edit the wp-config file and add it.

Regards.

by Rookie
I want to edit it automatically when a site is created. Are there any scripts that you know of that can edit it quickly? I know 'sudo nano wp-config' can edit the file but I need to add it in a specific line in the file. I also need to change the mysql hostname in wp-config file from 'localhost' to '12.0.0.1'. I use a cloud sql database from Google.
by Expert

Ok. Interesting!

To change the DB host since the beginning you can pass all the custom data in the site command instead of using the "default" option. Check the site command docs.

To automatically add lines when creating the site, this feature is actually in our roadmap  and will be available in January when version 1.7.1 is scheduled to be released. Right now exist and it is called "internal API" and just works with the "stack command", it will be extended soon.

Regards.

by Rookie
Sounds good! Thanks! I'm trying to keep this server resources as low as possible. I think Google charges by how much space is used on a server.. I was looking at a certain video on youtube to see how to keep costs low on Google infrastructure.
by Expert

Hi Mike,

In the latest Webinoly update I have extended the Internal-API, check this out:

https://webinoly.com/en/api/internal-api-events/

I'm pretty sure it will work like a charm for what you need.

Regards.

Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

To report a bug, please create a new issue on GitHub or ask a question here with the bug tag.
Webinoly Support Paypal Donations

PayPal · GitHub Sponsors · Bitcoin

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...