Welcome! Log In Create A New Profile

Advanced

Apache 2 Nginx didn't go as seemless as I wanted it [n00b alert]

Posted by peejaygee 
Apache 2 Nginx didn't go as seemless as I wanted it [n00b alert]
February 05, 2017 01:50PM
Hey All,

I'm in a pickle and I'm turning here first, as this is what I've moved to from Apache.

So, I had my apache all setup, running nicely, they I started seeing my 'database connection error', which turned out it was mariadb falling over, a while back, all I had to do was restart it, problem solved... Then it started becoming regular, a friend of mine told me to check my plugins within WordPress, as it could be those, so I disabled, and slowly put them on, one by one (to the point, where I left off the really unneeded ones). All seemed to be ok, until recenlty, the mariadb fail was happening on an hourly basis, and I didn't know why (I've not changed anything since it was running smoothly, except maybe a plugin update, or WP update itself)

So, I looked at my processes, using Webmin, and using Top from a shell, and my apache processes were taking up about 500 to 600 mb, each, so there was a memory leak somewhere, so I first looked into pre-forks and workers, etc, and that just didn't help and more and more research started point me towards Nginx.

So, I found various articles online, all showing me how to migrate from apache to Nginx and I followed them to the letter, alas, my site configuration is not as straight forward as one site, and I used to call on a good friend of mine (who in my eyes is a Linux Guru) to help me get issues fixed, but his 'real life' is in a pickle at the moment, so I don't want to lean on him, so I turned here.

So, I tried messing with Nginx, I tried getting it all working with PHP, I tried server blocks (or as I know them as Virtual Hosts), and it all started failing, I was getting times were I was getting 403 forbidden, so I thought it was a permissions error, as previous folders were belonging to apache:apache, so I changed them with chown to nginx:nginx, I had them at 777 and 755 with chmod. I have a domain pointed to cloudflare, and then that pointed to my IP address.

I have the HTML folders in my VPS set at /var/www/html

then I have subfolders inside

america-trip <------ subsites called from http://america-trip.pjg-developments.com/
littletvmen <------ subsites called from http://littletvmen .pjg-developments.com/
owncloud <------ subsites called from http://owncloud.pjg-developments.com/
phpmyadmin <------ subsites called from http://phpmyadmin pjg-developments.com/
pjg-developments <--------- main site that I wanted calling from my http://www.pjg-developments.com/
rgb <------ subsites called from http://rgb.pjg-developments.com/
ts3admin <------ subsites called from http://ts3admin.pjg-developments.com/

The only files I've messed with are nginx.conf, www.conf and php.ini, which I've included into links via pastebin

nginx.conf - http://pastebin.com/Dqnj0QpA
www.conf - http://pastebin.com/WR73KKKQ
php.ini - http://pastebin.com/VDcKaey7

I don't know were I'm going wrong, I've had times were the php will try to download the php, other times it works (based on setup) as I've had the info.php working. I've got a base html page loading up at the moment, as I'm having issues, saying i'm under maintence, so I know nginx is working, but when it comes to subdomains, and php I'm having issues.

I've tried removing and re-installing both nginx and php-frm, with no avail.

Can anybody help me here?
Regards
Paul.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready