NGINX set-up server-block on existing domain names/sites - nginx

Good day!
Due intense desire to learn new things, I have tried setting up my very own new server which is in Linux and a hosting using Centos Web Panel at home. After the installation process, I then proceeded with the common installation of the necessary configurations including the WebServer. I chose NGINX because I've read that it is lighter and more scalable than Apache, and can be used as a web server or as a reverse proxy. After that I then proceeded with the creation of my new website with the domain I have. After creating my website, it was only then that I have read about Server Blocks in NGINX (Site I read).
My question is how can I implement the Server Block method to my existing website? Or should I simply remove my site and create a new one using the server block method?
Thanks in advance
UPDATE
I created my website by creating an account in User Accounts category on CWP where I declared my domain name and ip address. Then I was given prompted to User Account dashboard(IP:2082).
Uploading of files is through FTP using my ip/username/password/port which is usually located on /home/user_account/public_html. But after seeing the tutorials, everything is set to to /var/www/domain/public_html

Related

Host ASP.Net MVC Site

I've created a site using ASP.Net MVC that is meant to be stored on a local machine at my place of work. The intention is to have the site stored on this machine, but then accessible by all the other machines within this building.
I've followed Microsoft's tutorial as well as Code Project's tutorial, but I am not having very much luck. The binding is just the localhost, port 80, with * for the IP address. The URL is localhost/GrantTracker.
I've opened the ports within the firewall, checked the permissions on the directory (which is just within wwwroot), tried having the site take the place of the default IIS site (as Microsoft tutorial has you do) and tried having the site stand on its own with its own port (per Code Projects tutorial).
On the host machine I am receiving the standard "This site can't be reached, localhost refused to connect" which feels like either a port or permissions problem. I must be missing a step, but I can't seem to find what it would be. I am new to hosting sites through IIS so forgive me if I am just missing something basic.
I find it a bit strange too because my project uses Windows Authentication and when the site is first visited it performs that initial check with the user, authenticates, but then throws me the error.
Anyone have any ideas? Thanks in advance.
start simple,
create a simple html page, create an IIS application for it, on port 80.
Check and make sure you can see that page from another computer using the internal IP address of the the host machine so something like:
http:\\192.168.0.3\hostapp\test.html .
You can see the proper URL by running it from IIS, this will give you the entire URL you need, with localhost then just replace localhost with the IP address of the host machine to see it on other machines.
Do this in the original IIS folder so you don't encounter any folder permission issues. If you choose another folder you'll have to give access to the Network Service user ( i think, can't remember now, but there is a specific user that needs access to the folder where the website is deployed )
if you can see the page then deploy a proper website and do the same thing. Make sure the app pool is created correctly and it's up and running, then access it again on other computers and it should work.
Port 80 should be open by default so that should not be an issue.

How to make subdomain from ip using a php form

I want to have a form on my website so users can make a subdomain for their game server so like if the ip for the server is
192.168.1.132 then they put it into a form and they make a name for the subdomain
and then they can use this to join their server name.domain.com:76651
I'm Mitch from Shockbyte - and the creator of the subdomain creation tool you linked to.
The subdomain creation tool on Shockbyte uses an API that can be purchased at: https://shockbyte.com/billing/cart.php?a=add&pid=34
This includes the PHP files to add the subdomain creator to your own website. This is the system that Shockbyte uses, as well as pretty much every host that has a subdomain creator tool on their website.
If you wish to create your own tool with PHP instead of using the system above, you will need more than just a PHP script.
You will need to be running a DNS server to create the records on. The most popular is probably BIND.
Once you have a DNS server running, then you can write a PHP script to manipulate the records. It will depend on which DNS server you use, but there may be an API available or if you're using a database such as MySQL, then you may be able to directly query the database.

How to get SSL using Let's Encrypt! when my hostname is hosted by wordpress?

I have a site www.testsite.com that is hosted by wordpress.com, I'm trying to issue a certificate so I can have https.
Is there any good methods to use when I cannot really install letsEncrypt's ACME client on my wordpress.com's account?
One way to issue your certificate for your wordpress (and actually, for any other website type), is to install (clone) Let's encrypt to your machine.
The main and very basic idea is that Let's Encrypt (LE) wants you to prove that you do have access control to your domain. This is achieved through a challenge. You have to output a string they provide you inside a folder. For example, at yourwordpress.com/.well-known/acme-challenge/
the (LE) authority wants to read a long string it provides you.
So, inside your wordpress site folder, create those directories.
Once this is successfully checked, LE, saves your ssl certificates in your local machine with root privileges.
Now you have to upload those certificates *.pem to your server. This last step is different depending on the company server.
Here is a nice tutorial that worked for me to get the LE certificates.

Setting up asp.net test server

I am creating a website in asp.net MVC 4 and am wondering the best way to set up a test server?
I am doing this from home and would like a way for my friend to test my code from a different location (his home). What would the best way to go about this? Build a local server that he only has access to? VMWare? Online web hosting?
One solution would be to use a VM and set up a server.
NOTE! that this would require your friend to redirect your IP Adress to the host name you will set for your website on the IIS of your VM.
He can easily do that by changing his Hosts at C:\Windows\System32\drivers\etc
Another option would be actually to purchase a domain (that you will need anyway eventually)
The purchase a hosting package (that you will also need anyway eventually).
Then setup your website on a sub domain in that hosting server e.g. dev.myDomain.com

How can I get two SSL certs to work on a two domain, shared IP configuration

I have two web site that are 99% similar. They share all of the same pages except the difference being that the logos change, a few of the links change, and the products that show up on either web site are flagged to show up on either or, or both. They use the same database.
I have written a utility method that essentially injects a where clause into any database access code I write throughout the app to determine which products to display depending on the current URL.
Problem: Website B gives the user a warning message that the site they are trying to go to is in fact Website A. I've read that the SSL cert needs a distinct IP.
Right now how I have everything set up is very clean on a maintenance perspective. I can update files in one place. Any suggestions on how to make the SSL behave, or am I looking at seperate IP's for the hosting(I really don't want to have to do this)?
If the latter, what do you suggest?
Site runs ASP.NET 4.0. Precompiled DLL.
UPDATE: Thanks to #GregS comment
If the sites share the same domain you can use a wildcard certificate
site1 - site1.somedomain.com
site2 - site2.somedomain.com
Otherwise you will need to get a UCC (United communications certificate) that will be for both domains.
You will need to configure IIS 7 from the command line because the GUI doesn't support setting different host headers for the same certificate. This tutorial shows how it can be done.
I setup another website in IIS that points to the same files as the first web site, got another SSL cert for the new site.

Resources