Using 'msdeploy' to sync a folder on a local IIS server with a remote IIS webserver - iis

I am trying to sync a folder on a local IIS server with a folder on a remote IIS server using msdeploy.exe.
I found some instructions at https://devblogs.microsoft.com/dotnet/web-deploy-msdeploy-how-to-sync-a-folder/ which demonstrated how to do this with the command in the attached image. example msdeploy command to sync folders
My question is what is the 'ComputerName' value referring to? How do I find the 'ComputerName' of the destination server (or any server for that matter).
I tried following the instructions at https://devblogs.microsoft.com/dotnet/web-deploy-msdeploy-how-to-sync-a-folder/ but was not sure how to determine the 'ComputerName' of my destination server.

In the official documentation, there is a detailed description of this parameter, like this:
If you're deploying to the remote agent service on the destination web server, you can specify the target computer name (for example, TESTWEB1 or TESTWEB1.fabrikam.net), or you can specify the remote agent endpoint (for example, http://TESTWEB1/MSDEPLOYAGENTSERVICE). The deployment works the same way in each case. If you're deploying to the Web Deploy Handler on the destination web server, you should specify the service endpoint and include the name of the IIS website as a query string parameter (for example, https://STAGEWEB1:8172/MSDeploy.axd?site=DemoSite).
Can you understand the explanation in this paragraph, or do you not know what remote server you are using?

Related

How to access a gitlab-ce running on a machine behind a router?

I have installed gitlab on my ubuntu server and as far as I can tell its up and running. I'm trying to configure it so that I can access it via my static IP from anywhere. What should I put in the external_url in gitlab.rb ? Should be the local static ip of the server followed by the port number? Basically I want to be able to type http://staticIp:portNum and acces the web interface.
Also if I reconfigure will I loose the root password that was generated for me? I know that the file will be deleted so I copied the pass over just to be safe.
As illustrated by gitlab-org/omnibus-gitlab issue 4932, you would need to:
use a static IP of a FQDN (fully qualified name) of your server, as explained in "Configure the external URL for GitLab"
Configure your NGiNX
Reconfiguring GitLab should not reset the initial root password set on installation.

How do I put WSO2 Identity Server on my site? Remove localhost and make it public

I want to make my identity server public so that all users who visit it can access the identity server but right now only I can access it since it's hosted locally. How can I deploy this so that it runs on my IIS? Will copying and pasting the WSO2 IS folder into my inetpub\wwwroot folder work? (And after configuring the .xml files so that it shares my public domain)
I tried reading the WSO2 IS documentation but it's not very clear to me how I can make it public. I was hoping for a systematic tutorial/way to do this but it chains from one step to multiple.
https://docs.wso2.com/display/IS530/Deployment+Guidelines+in+Production
https://docs.wso2.com/display/IS550/Changing+the+hostname
I believe there are a few misconceptions (no, copying the installation into inetpub\wwwroot won't work, it's not php)
chains from one step to multiple
well - the documentation is related only to a product, it assumes some knowledge of the network and systems it runs on
1 - you should run the WSO2IS as a service ( so this is Windows guide may be helpful and this here is how to run the WSO2IS as as service for Linux)
2 - change the repository/conf/carbon.xml
(this step is optional, but increases security)
HostName - to the public hostname
MgtHostName - to internal hostname, so the administrative console is not accessible from internet
3 - The best practice to expose the WSO2IS would be a reverse proxy (depending you are using IIS, nginx or httpd) so you don't expose the default port 9443 to the outside directly (I assume you want to use your own SSL certificate on 443 and TLS termination in the web server)
For the default WSO2IS applications you need to create a reverse proxy from `HTTPS:443 -> HTTP:9763
update /repository/conf/tomcat/catalina-server.xml and on the Connector listening on 9763 add attribtue proxyPort="443"
(Note: now I am not sure if it will work, what will work for sure is TLS bridging HTTPS:443->HTTPS:9443, it means adding proxyPort="443" to the Connector for port 9443)
Every WSO2 product already has an application server shipped with a TomCat.
This way you do not need, nor should, place the fonts on another separate application server. Use what's in the product.
By its description it seems to me that you do not have much familiarity with infrastructure, servers and etc, I will try to help you and clarify some points.
As I mentioned above, you should use the TomCat that already comes with the product and put it in some VM (Server) that has Internet output, that is, it has ports 80, 443 and also ports 9443 and 8243 (which are the default product ports) released for access beyond the internal network (LAN).
If you get the Public IP of that VM where the WSO2 Identity Server product is running, and access it from outside your local area network (LAN), the service should work.
Making an analogy to a Web site is the same concept. When you want to put a Web Site publicly for the internet, as you said put the fonts inside apache's WWW folder or something, it's the same concept, so people outside of your local network can access this website, this Apache would have to be with a Public IP, It's the same concept, but WSO2 already has its "Apache" TomCat internally, just leave your Public IP.

How to create web based terminal using xterm.js to ssh into a system on local network

I came across this awesome library xterm.js which is also the base for Visual Studio Code's terminal. I have a very general question.
I want to access a machine(ssh into a machine ) on a local network through a web based terminal(which is out of network, may be on a aws server). I was able to do this in a local network successfully but I could not reach to a conclusion to do it from Internet-->local network .
As an example - An aws server running the application on ip 54.123.11.98 which has a GUI with a button to open terminal. I want to open terminal of a local machine which is in a local network somewhere behind some public ip on local ip 192.168.1.7.
Can the above example be achieved using some sort of solutions where i can use xterm.js so that I don't have to go for building a web based terminal? What are the major security concerns I should keep in mind while exposing the terminals this way ?
I was thinking in line with using a fixed intermediate server between AWS and local network ip and use some sort of reverse ssh tunnel process to do this but I am not sure if this is the right way or could there be a more simple/better way to achieve this.
I know digital ocean, google cloud , they all do this but they have to connect to a computer which has public ip while I have a machine in a local network. I don't really want to configure router to do any kind of setup .
After a bit of research here is working code.
Libraries:
1) https://socket.io/
This library is used for transmit package from client to server.
2) https://github.com/staltz/xstream
This library is used for terminal view.
3) https://github.com/mscdex/ssh2
This is the main library which is used for establishing a connection with your remote server.
Step 1: Install Library 3 into your project folder
Step 2: Start from node side create a server.js file for open socket
Step 3:
Connection client socket to node server (both are in local machine)
The tricky logic is how to use socket and ssh2.
On emission of socket you need to trigger an SSH command using the ssh2 library. On response of the ssh2 library (from server) you need to transmit the socket package to the client. That's it.
Click here to find an example.
That example will have these files & folders:
Type Name
------------
FILE server.js
FILE package.json
FOLDER src
FOLDER xtream
First you need to configure your server IP, user and password or cert file on server.js and just run node server.js.
P.S.: Don't forget to run npm install
Let me know if you have any questions!
After some research later I came across this service : https://tmate.io/ which does the job perfectly. Though if you need a web-based terminal of tmate you have to use their ssh servers as a reverse proxy which ideally I was not comfortable with. However, they provide tmate-server which can be used to host your own reverse proxy server but lacks web UI. But to build a system where you have to access a client behind NAT over ssh on web, below are the steps.
Install and configure tmate-server on some cloud machine.
Install tmate on the client side and configure to connect to a cloud machine.
Create a nodejs application using xterm.js(easy because of WebSocket based communication) which connects to your tmate-server and pass commands to the respective client. (Beware of security issues of exposing this application, since you will be passing Linux commands ).
Depending on your use case you might need a small wrapper around tmate client on client-side to start/stop it automatically or via some UI/manual action.
Note: I wrote a small wrapper on client-side as well to start/stop and pass on the required information to an API server (written in nodejs) which then pass on the information to another API which connects the browser to the respective client session. Since we had written this application it included authentication as well as command restrictions of what can be run on terminal. You can customize it a lot.

Getting server information with only FTP access

I'm in the process of re-installing a backup of a PHP script on a new server.
The previous web developer has gone missing in action and he has yet to release the domain in that's under his management.
So for the new server they only provided me with mySQL details and FTP access. They say they don't have temporary testing url so I can only upload the backup without testing it.
I changed the mySQL server variables but in the script there are also some server side specifics. For example the full path has to be defined in the config file. I only have FTP access so I can't run a simple phpinfo().
Is there any other way to get this specific server information with only FTP access? I basically need the full server path where the script will be installed.
Thanks!
Well, IF apache (or whichever webserver) on that IP is already configured for your FQDN (which you couldn't set to the new IP yet), then you could upload a PHP file with a phpinfo() call. Afterwards you could telnet onto the known IP port 80 and send
GET /[PHP-File] HTTP/1.1
Host: [Your FQDN]
So e.g., if your FQDN was www.example.com:
GET /info.php HTTP/1.1
Host: www.example.com
The web server should then send the output of your PHP script.
Note that your lines have to end with a <CR><LF> and that there is a blank line after your Host:-line.

MVC4 Website/Web Application Recommended IIS Directory Structure

I have an MVC4 web application
In setting it up on IIS7.5 I added the application to the "Default Website" and set up a virtual directory under http://localhost/myApplication
However, this forced me to change many of my controller calls (specifically js ajax calls) which I previously called in Cassini like "/Home/Index", I now had to change them to "/myApplication/Home/Index" for them to work on my local IIS.
NOW, when I publish it to a remote hosting server I have to change it BACK to "/Home/Index" for it to work.
This cannot be the most productive way to traverse the development -> testing -> production cycle.. What step am I missing?
I tried to create the applications virtual directory on on just http://localhost/ without appending the application name so that I can call "/Home/Index" at all three stages but it complains that http://localhost/ is already mapped to inetpub/wwwroot.
Thanks for your time.
The steps are like this:
Publish your website to a new folder in inetpub/wwwroot (or the place where your applications are kept) like "inetpub/wwwroot/myapp"
Go to IIS management, create a new web-site, assign it any free port (like 11001 or something, > 1024 at least) and point it to a folder from the step 1. Bind it to all IP addresses available or to 127.0.0.1
Start the web-site.
Access it using http://localhost:11001/ (or any other port you've set)
Problem is that by default any browser uses port 80 to request a web page, and that port is taken by the default web-site. You have to manually override it or create a site on another port. IIS usually warns you about port collisions.
If you don't want to have port number in the address, alternatively you can work with host header on port 80. You may have to make local host entry for the host header given to the site.

Resources