- This topic is empty.
-
AuthorPosts
-
October 1, 2014 at 11:06 am #185221
chrisburton
Participant@traq Perhaps you know what I’m doing wrong here. Let me give you the steps I took.
- Installed Nginx on my VPS (Centos 6)
- Quit Apache to avoid conflict of Nginx running on port 80
- Started up Nginx
I checked my website (domain.com) and I received a 404 error.
- Edited nginx.conf (location portion) to
index index.html index.htm index.php;
to allow php scripts to be executed - Edited default.conf (server portion) to reflect the location of my public html folder
Checked website again and still get a 404 error but this time my index.php file was trying to download. To avoid vulnerabilities (database stuff) from being seen, I took it down.
Could you help me to configure Nginx for Centos 6? The following are my config files:
October 1, 2014 at 12:43 pm #185232Alen
ParticipantYou need to pass on the request to the socket. I’m on mobile now, but something like
location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # With php5-cgi alone: # fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; }
October 1, 2014 at 1:04 pm #185235nixnerd
ParticipantSee @chrisburton? That block you had commented out is what is needed. Pretty sure php-fpm is a package you’ll have to install separately though. It’s been a minute since I configured mine. Digital Ocean has great tuts and they should be no different on any other VPS provider for the most part.
October 1, 2014 at 1:06 pm #185236chrisburton
ParticipantThanks, Alen!
@joe_temp Yeah, I tried installingphp-fpm
but keep getting conflicts. I’ll try to figure it out.October 1, 2014 at 3:20 pm #185249nixnerd
ParticipantHmmm. Feel free to post the conflicts you’re getting if you get stuck. That way, we can help out as we can.
Sorry this is such a pain. I found the Nginx setup to be much easier than Apache.
October 1, 2014 at 3:28 pm #185250chrisburton
ParticipantI really screwed things up with the command line so I have to start over.
October 1, 2014 at 3:37 pm #185254October 1, 2014 at 5:06 pm #185256chrisburton
Participant@traq I’m going with Ubuntu this time around. They have better and more tutorials. I really want to use HHVM but haven’t found a suitable tutorial to follow for Centos 6.
October 1, 2014 at 5:14 pm #185258__
Participantthe guide I linked to has an Ubuntu version. basically the same, but with apt-get instead of yum.
October 1, 2014 at 8:33 pm #185267Alen
ParticipantI learned so much about provisioning by visiting Vaprobash on GitHub and looking at various install scripts. Visit servers for hackers as well. Lots of good info.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.