Problems running ServiceStack as daemon on Linux (Ubuntu 13) as described on the wiki page - apache

I have a problem running ServiceStack as daemon on Linux.
I just started to work into creating a REST API with C# on Mono. I studied your Wiki about it and yesterday I tried to run ServiceStack as daemon on Linux (Ubuntu 13) exactly as described on the wiki page:
https://github.com/ServiceStack/ServiceStack/wiki/Run-ServiceStack-as-a-daemon-on-Linux
But I encountered a problem, tried every possible solution I found in the web, but nothing helped.. The problem:
If I access http://127.0.0.1:8080 on the Ubuntu System everything is fine and I am beeing redirected to http://127.0.0.1:8080/metadata and get the Service Metadata.
If I access http://127.0.0.1:80 I get the static content. Also fine.
BUT if I access http://127.0.0.1/api I'm being redirected to http://127.0.0.1/metadata and get a 404. Which is absolutely understandable because there is no such thing on Port 80.
You know I'm not that good in apache, but after reading the configuration mentioned in the wiki I thought this should work normally. Am I wrong? Or do you have any idea how I can solve this?
Another problem is that if i access the service on my ubuntu system from another system, e.g. Windows through http://ubuntu-dev:8080, I get Bad Request (invalid host).
I also get the 404 there if I accesshttp://ubuntu-dev/api.
I think the Bad Request Thing must have something to do with servicestack because apache only listens on port 80 (as it should I think). Do you have any suggestions about this?
It would be really nice if someone could help me because I really don't know what to do with these problems.
Greetings, daily

It might be a problem that only occurs when it runs on a different port than 80.
Probably it's not redirecting properly when a port is set.
Try running it on nginx with fastcgi (fastcgi-mono-server4), there you can run it on port 80.

Related

Why tomcat does'nt work with proxy set in a network with netbeans(8.2)?

so i have been working on apache tomcat in netbeans and i faced one issue due to which tomcat was not starting in my organization's network, but with same settings it was running perfectly on my home wifi.
Later, i figured out if i set proxy to "No proxy" in the netbeans settings it will work and the solution worked. But, i still do not understand why this happened.
I researched a little but answers were not satisfactory. Basically, i want to understand how apache tomcat startup was affected and in what cases i may need a proxy.
You can consider me as a beginner if you are answering to this... Thanks!

how can i see my ip:8080 externaly in apache server?

i installed laravel and vue.js in an apache server. When i run vue from my terminal it works at http://localhost:8080. When i try to check it externally like http://138.68.xxx.xxx:8080/, i see only This site can’t be reached.
I visited http://portquiz.net:8080/ and the result is that:
You have reached this page on port 8080. Your network allows you to use this port.
I haven't done anything yet because i am not experienced with servers. I read about vhosts etc, but a guidance or help from someone more experienced would be more than welcome.
Thank you

Apache 2.4 Being a Complete Jerk and Not Allowing non-localhost Traffic Under Any Circumstances

I'm super frustrated and created an account just to get this solved. I've tried everything under the sun and nothing is doing any good whatsoever. Please give me the benefit of the doubt.
I have 2 configurations of Apache, one that's working perfectly fine and another that isn't. I want to make the one that isn't working work like the one that is working. The one that isn't working isn't allowing any non-localhost traffic yet came installed with wamp which I'm trying to leverage, and the one that is working is an independent install that I've configured to allow all traffic. Configuring the wamp Apache in a way that seems to me to be exactly the same is still not allowing any non-localhost traffic through
Here is the configuration file from the working Apache server:
http://pastebin.com/dQDVDA53
And here is the non-working configuration from the wamp apache server:
http://pastebin.com/geF0aLRF
Any help would be greatly appreciated. Thanks...

EC2 Ubuntu Apache keeps Connecting

I'm trying to setup an Apache server on an Ubuntu EC2 instance. I'm using 12.04 LTS, and I've tried with 14.04 LTS, but haven't reached a solution. I've scoured the internet looking for a solution but haven't found anything. My Apache settings are default and I've created a Security Group for HTTP. I also have an elastic IP associated with the instance.
When I load localhost using Lynx, I'm getting the Apache page. I cannot access it from my browser externally. The page keeps trying to connect and is waiting for it. When I nmap port 80 internally from the server, it says open. The weird thing is when I try to nmap the server from outside. It sometimes shows it's open and sometimes it shows it's down. I cannot determine the situation that causes this. It seems arbitrary to me at the moment. I've tried to launch different instances and I'm getting the same behavior. I've turned off ufw, and cleared iptables.
I am able to SSH and FTP to the server without any problems. I'm stumped, and very confused why something so simple can not work. Apache error logs are normal. I also tried with nginx and I'm getting the same problem.
Any help is appreciated!

What would happen if I made a HTTP request to a server without Apache installed?

Doesn't have to be Apache, but that's just the only HTTP server I know of (Actually could you guys recommend alternatives that I could look into as well?)
Anyways, so I have been messing around with Amazon Web Services and I created an EC2 server instance with an Amazon Linux Image. On that, (Following guides and examples) I installed Apache and now when I make a GET request to my public IP, it returns to me the HTML files I created on my server.
My question is, what if I never installed Apache, and then made an HTTP request to my public IP? For no reason really, the question just came up in my head and I'm curious. I'd rather not figure out how to uninstall Apache or create a new instance to figure it out, so I was wondering if somebody could weigh in as well as tell me a little more about what it is exactly apache does on a server. My understanding is that it is a layer you can install on your server OS that will create a socket listener to port 80 (HTTP), and when a request is made on that port, Apache will return web pages? Also I think I read somewhere you could configure Apache to forward a port to something like a python server script?
Thanks in advance for your time!
could you guys recommend alternatives that I could look into as well?)
nginx is a popular alternative to apache. It's much more efficient.
what if I never installed Apache, and then made an HTTP request to my public IP?
Your browser would get a "connection reset" because there is nothing on port 80. Your browser would display a message (Chrome says "This webpage is not available"). You would NOT get a "404" because that requires an HTTP server to send HTTP codes.
If your server was firewalled instead, you'd bet a busy wait for a while, then a message about the server not responding.
Also I think I read somewhere you could configure Apache to forward a port to something like a python server script?
Yes, that is called "reverse proxy" mode. It's essential to any application website if you want to scale. The web server(s) can distribute traffic to one or more backends running the application. The web server is useful for filtering bad requests (since your backend in Ruby/Python will be 1000's of times slower than the reverse proxy.)
Well, if you want to test what will happen if Apache isn't installed, you can always just stop the Apache service by typing:
sudo service apache2 stop
or
sudo service httpd stop
depending on your version. Then if you visit your site's webpage you'll get a 404 error or something similar.
There are ways to use python scripts to run simple servers, but in general it's easier to just let Apache handle that and use a framework like Ruby on Rails or Django to control the display and creation of content for your server.