I was wondering, I regularly set up a new Drupal site in Nginx, I download the files, get the database in place and then.... I wait... for the DNS to resolve because I have no idea how to access the site without going through the domain name as stated behind "server_name".
Does anybody know how to access all the sites in sites-enabled without using a proper domain name?
The simplest way is to resolve domain name to IP locally. You can use hosts file for it. Just edit /etc/hosts file if your home OS is Linux, or C:\Windows\system32\drivers\etc\hosts if Windows.
Add ip.of.ur.sever domain.name.com line, save file and restart browser.
Related
I'm developing a new website that will have the same domain name as the current old one, but a different host. The new one doesn't have DNS nameservers pointed to it yet, but I edited the hosts file on my computer to be able to access it. Is there a way I can now still access the old current one on the same computer, since it would help me with development, without changing the hosts file everytime?
Thanks :)
You can check the old site by using the temporary URL
http://server_ip/~cpanelusername/
but many of host block ip preview. You also can use archive.org. You can save the old site before starting new.
For this type scenario, I use a subdomain to built a new site.
www.mysite.com >> www.dev.mysite.com
If possible, it can be helpful to set up an alias and then create an A record for that alias that points to the new site. This allows you to reach the new site via a different name but it will still look at all the files and database(s) as it would normally.
This is helpful for when you want to test the new site before it goes live without having to comment and uncomment the hosts file continuously.
One thing to watch out for is that any URLs that are the full URL such as example.com/whatever instead of /whatever won't work. However, as it is generally bad practise to do the full URL in case the domain ever changes; this can be a good way of finding and corrected any.
Recently I have started using vagrant for Wordpress development.
The installation process and everything else went well. But when i try to access the page I get to see this:
enter image description here
It also loads really slow. Any ideas?
To be able to resolve salesacademie.dev, you will need to add the name to your hosts file. The line you need should look something like
salesacademie.dev 127.0.0.1
With that change, you should be able to download the assets (and the site) using that name assuming that vagrant's port forward is for port 80 (the standard http port).
Alternatively, you can reconfigure your Wordpress to not use the name salesacademie.dev but 127.0.0.1 instead. Then, you don;t need to edit your hosts file. However, you will not be able to run several websites concurrently on your vagrant server then.
I'm new to IIS and I'm trying to use a local hostname to differentiate my web projects. Basically, what I want is to do something like:
http://myproject.dev
and access it directly via the web.
Normally, with an Apache server, I would create a virtualhost and I would add an entry in my hosts file.
So, I tried to do the same with IIS. I created a a website as follows:
In my hostfile, I then added an entry:
127.0.0.1 myproject.dev
However, when I type the address, I'm redirected to my IP Address and I can't see the website.
Am I missing something?
Edit 1:
aha, I got it, it is host file issue, just remove:
127.0.0.1 localhost
or comment it because it make everything go back to 127.0.0.1
and write yours like this:
127.0.0.1 myproject.dev
You just have to create a folder in c: --> inetpub --> wwwroot than just type localhost/yourprojectfolder..
I have a big solution that contains a lot of .aspx file, basically it's a big sln file for my whole server
I wanted to add a website in my IIS server that contains inside a child directory within the root site folder, for example:
my-tools.com physical path is D:/MyWeb <-- Working well
I added a secondary sites, with no relation to the upper site called mysite which is like that:
mysite.my-tools.com which its path it D:/MyWeb/MySite/
If I try to reach mysite.my-tools.com/M_Index.aspx file it give me an error tells me it's not found, however, when I try to view a .jps file from the same directory (e.g mysite.my-tools.com/test.jpg) it returns just find.
it's important to tell that all the pages share the same solution, what do I do here and why it is not working? can anyone tell me?
thanks a lot
having the folder separated like you do is a step in the right direction. next step is to configure IIS to point to that separate folder. then you would need to create a DNS entry for your sub-domain at your DNS host. "subdomain.domain.com". You would be creating a new site, so you could use the same IP address, as long as you add the proper host headers for each site.
I need to put a file at this address: http://localhost:51547/file.txt
What folder would I put it in on C:/?
Tony
If I understand your question correctly and you're trying to expose a file via the ASP.NET development server at that location (http://localhost:51547/file.txt) I'm afraid the answer is not quite to your liking.
Basically I don't think you can serve files from the root of the ASP.NET development server (i.e right after the localhost:port/ part - the port is automatically selected by ASP but you can also manually configure it). ASP.NET automatically creates a virtual application path right after localhost:por> and so you're most likely going to be limited to serving files from the virtual application folder. So, assuming you web application name is: "testApp", if you put a file called file.txt in the directory where you're storing the source code for "testApp" it will also become available when you're testing at: http://localhost:port/testApp/file.txt (note the testApp in between the host-name & port, and the file-name)
UPDATE
In light of you comment, here's something you could do. You could try to get a simple HTTP server installed on your development computer and have it serve files on a different port (say port 8000). In that case you would serve file.txt using this secondary HTTP server and it would be accessible at: http://localhost:8000/file.txt.
You could try to install Apache or use IIS which comes with Windows. For Apache, the quickest way to get it going would be to install a WAMP environment. You may also try Lighttpd, and also note that MySQL or PHP are not required at all if you're only serving static files.
Any folder you want. The port designator is specified in IIS itself.
http://support.microsoft.com/kb/149605
I suggest you that if you want to do a site(HTTP) is better to use the port 80 or to do a redirection for another port, remember too that localhoost is a loop back and also take a look at PortForward to check some ports that are used by specific applications and types of servers, and please improve your question.
Regards.