Welcome! Log In Create A New Profile

Advanced

How to setup a website with nginx, centos and a domain registed on cloudflare?

Posted by loint 
How to setup a website with nginx, centos and a domain registed on cloudflare?
August 21, 2017 12:45PM
I'm a newbie on setup a website on a vps hired, centos os , nginx and a domain registed on cloudflare. I have done setup enviroment on my centos such as LEMP ( Linux , nginx, mysql, php) but I have no idea what i'm doing next step. I look for some tutorials on internet but this solutions are unclear because of too simple. Such as https://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration.

So let give me a enough guide to configure a website with domain , dns register.

recource :
- ip address of my vps server is 155.94.xxx.15x
- my domain registed on cloudflare is domain.tk with A row " Name " : domain.tk points to address 155.94.xxx.15x. CNAME row is www.domain.tk is alias of domain.tk

thank you!!!!
Re: How to setup a website with nginx, centos and a domain registed on cloudflare?
October 30, 2017 11:38PM
Here is many questions not answered to make this easy, but i'll understand it like you would run your .php on the slow apache and then use the nginx as reversed frontend for apache..... but since you don't know about how to do this, you properly don't have a lot of visitors, so I'll suggest you skip the apache and go directly into nginx with php-fpm and reverse into that

guide for that part is here https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html

Next you'll have to simply fullow the https://nginx.org/en/docs/ to set it up

but..

make a /etc/nginx/conf.d/mysite.conf

make it listen to your ip

open port :80 on the vps and you are close

the most very basic ex. of a conf file looks somewhat like this

server (
listen 155.94.xxx.15x:80;
listen 155.94.xxx.15x:443;
server_name yourdomain.tld www.yourdomain.tld;
root /full/path/to/your/html/files;
index index.php index.html;
}

thi will now serve static *.html files from /full/path/to/your/html/files/ starting with the index.html



Edited 1 time(s). Last edit at 10/30/2017 11:38PM by JoakimR.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready