hgweb server abort: HTTP Error 404: Condition Intercepted - linux

I have set up an http server with the hgweb.cgi cgi script in a Linux server.
I put up a mercurial repository in the server. I can clone the repository from a windows machine without any problems. I can view the server in any browser. I can clone the repository from my localhost: (the server)
hg clone http:// localhost /hg/proj
works perfectly.
But when I tried to access the server on another Linux machine I got this error message:
hg clone http://myhgserver/hg/proj
abort: HTTP Error 404: Condition Intercepted
I could not find any error message in the error_log file on the apache2 web server.
First I suspected that I am using an older version of hg on my client side (1.4).
My server side is hg 2.6.3.
Then I tied to install the latest mercurial in my home directory (I have no permission the system directories)
I used the "make local" command to install the mercurial package locally.
./hg --version
Mercurial Distributed SCM (version 3.0+4-75aaae8ad660+20140613)
The clonning command gave the same error:
abort: HTTP Error 404: Condition Intercepted
I have spend almost the whole day, and now it is mid night, still could not find any answer.
Anyone else has seen such a problem?
Kemin

After a night of sleep, I got my problem resolved.
Basically, the hg program is missing the ability to resolve hostname into IP addresses.
Since my server and client computers are on the same LAN, there is no connection or firewall problems.
I can PING from my client to my server without any problems. I can run the host command:
host myhgserver it will give you the whole IP address and the fully qualified domain names. If I used the IP address instead of the host short name, then hg works fine.
What I think is needed is to add a few lines of code to hg client program so that it can find the server from an alias.

Related

how to see client's ip address instead of hostname in remote syslogs

my client machine has syslog-ng and my remote machine has rsyslog configuration.
my server/remote machine manages many clients and I need to differentiate which machine is sending which logs.
normally I would use syslog-ng on the server side but these machines aren't meant to have them.
Also would like to mention it isn't for apache or web servers just physical machines.
On the client's side
Tried altering and adding different options or changing them to yes/no respectively.
options {
keep_hostname(yes);
create_dirs(no);
use_dns(no);
};
for eg:keep_hostname to no, it worked but only when I changed the hostname to the machine's ip address. which is not what I want.
Using a template
template("$(ISODATE) $(FULLHOST_FROM) $(SOURCEIP) $(HOST) $(HOSTNAME) ${PROGRAM}: ${MESSAGE}\n")
output:
day time localhost abc[ID] .source.s_local SourceIP=127.0.0.1 localhost localhost (root) CMD (xyz.conf)#ID
this isn't the output I want, it is printing in the message section when I want it in the place of the "host" and I don't understand how the source ip is the loopback address.
Using structured logging
rewrite r_sourceip{
set('${SOURCEIP}' value(HOST));
};
log { source(s_local); rewrite(r_sourceip);destination(d_syslog_tcp); };
output:
and the ip is displayed in the logs as the loopback address instead of the machine ip.
day date time 127.0.0.1 syslog-ng.service: Succeeded.
Tried installing rsyslog on my client but it doesn't work
sudo add-apt-repository ppa:adiscon/v8-stable
sudo apt-get update
sudo apt-get install rsyslog
I kept running into many errors, fixing them was impossible due to the difference in OS version or type maybe.
add apt repository command not found
wget command not found
On the server's side
Using a template
which creates a folder with the client's hostname and stores the logs in that particular folder.
not the solution I want.
$template DynaFile,"/var/log/%FROMHOST-IP%/%syslogfacility-text%.log"
*.* -?DynaFile
I want the logs to appear as such
day date time `client's ip address` syslog-ng.service: Succeeded.
Can someone suggest me a solution and why I keep getting the loopback address as my client's ip?

How can I access my nodejs web server from my local computer using the server domain name?

I installed nodejs and created a sample app. When I run npm start I get a message saying that I can open my web browser to http://localhost:3000 to see the app in action, but this installation is on a web server - not my local computer, so, instead of localhost:3000 I want to get there using something like mydomain.com:3000
I can't find the answer, it's very likely I just don't know how to search for it... any ideas?
I'm following the tutorial here: https://facebook.github.io/react/tutorial/tutorial.html
I think I only needed to get away from this for a while. I got it working using ssh local forwarding.
I already used an ssh config file to log in to my server without having to remember the password, so I just added this line to my config file:
LocalForward localhost:3000 xxx.xxx.xxx.xxx:3000
where xxx.xxx.xxx.xxx is my server IP address.
Then, I connected to my server via ssh:
ssh -f -N mysite
Once connected, I open up the browser and go to localhost:3000 and there it is now.
I used my ssh config file, but it should also work without it.
ssh -f -N -R 3000:localhost:3000 mydomain.com
I found this command that eventually led me to solve my problem in this link: http://stuff-things.net/2016/01/20/tunneling-to-localhost/

Teamcity server url returns 404

I installed TeamCity on a windows server 2016 machine and I assigned the ci.mydomain.com to the serverUrl. I have IIS also on that machine that hosts my nuget server.
When I type in ci.mydomain.com it returns a 404. nuget.mydomain.com works fine
Does anyone knows why?
Thanks in advance
"Server URL" in TeamCity administration settings does not affect how TeamCity server can be accessed.
You can start by opening 127.0.0.1:PORT on the server machine to check that the TeamCity is running OK, where PORT is where TeamCity is configured to run on (e.g. check \logs\teamcity-server.log file, line with "Web server ports")
If that works, make sure SERVER:PORT works from other machines, where SERVER is the machine IP and the same PORT. If you'd rather use IIS as a reverse proxy, check related TeamCity instructions.
Finally, you will need to make sure ci.mydomain.com resolves to the IP and use due port in the URL.

Does vagrant share with https still work?

I have the guest's HTTPS port set to 443 on it's Apache 2 installation.
In Vagrantfile
I have vm.forwarded_port set to forward from 443 to 8443
I have vm.hostname set to actualdomain.org
I've also installed the vagrant plugin install vagrant-hostsupdater so that actualdomain.org is written to my hosts file, so it pulls up the developer environment and not the actual site when it is requested.
List item
I ran vagrant connect...
I ran vagrant share --https 443 --domain actualdomain.org but it reports the following:
==> default: Detecting network information for machine...
default: Local machine address: 192.168.xx.10
default: Local HTTPS port: 443
==> default: Checking authentication and authorization...
==> default: Creating Vagrant Share session...
There was an error returned by the Vagrant Cloud server. The
error message is shown below:
Domain cannot be used with this account
But if I run vagrant share without the --domain parameter, I end up with the following in my logs when I try to contact the site remotely:
Hostname XXXXX-YYY-ZZZZ provided via SNI and hostname XXXXX-YYY-ZZZZ.vagrantshare.com provided via HTTP are different
And in the browser I am returned an HTTP 400 Bad Request.
Is there any easy way around this? It seems to me that this didn't happen the last time I used vagrant, and it seems as though there was something added to TLS that causes it to balk about the SNI error since then.
I even tried adding a server alias that was the same as the XXXXX-YYY-ZZZ.vagrantshare.com, and it still is giving me an issue; does that mean that I have to rebuild the certificate everytime the hashicorp URL changes if I want to show it off to somebody via their browser?

GitHub, Linux Server and Ownership Issues

I've got a private Git repo on GitHub and I have setup SSH connections between my server and github.com. I can pull my app from GitHub successfully on to the server but when I visit my app URL I get a '500 Internal Server Error'. My host suggests that this is to do with ownership problems.
So my question is this, if I am logged in to my server via SSH as root, and I do a pull request, how can I make sure that the ownership of the files on the server are correct.
Thanks

Resources