Two problems- one solution i.e. 10.0.2.2
Sometime back, I faced an issue that I had installed a virtual machine on mu linux machine. I had a server/ website running which I wanted to access from virtual machine. http://localhost/site simply refused to work. A little googling helped with an answer to use http://10.0.2.2/site
Again faced similar issue. Was trying to access local website from within android emulator. Again localhost refused to work. And guess who was the rescuer? yep 10.0.2.2 again 🙂
There can be many cases in your projects where you would like to add a browser authentication for your project. But there will be a few where you will actually need to remove that. That’s what happen to me today. Checked out code for a project and tried to run on local tomcat instance, everything worked fine. When tried to open up the app like localhost:8080/myapp, browser asked for username and password. I had no idea about username and password.
So started by googling about removing browser authentication in tomcat, that was a mistake. Could not find a single site talking about removal of authentication. After spending 20 minutes, I got the idea to actually look for- how to set the browser authentication. And bam- that worked.
In your apps web.xml, there will be setting for <security-constraint> where you can set up the <login-config> as basic (or actually remove in my case).
Define the Members-only area, by defining
a “Security Constraint” on this Application, and
mapping it to the subdirectory (URL) that we want
<!– Define the Login Configuration for this Application –>
<realm-name>My Club Members-only Area</realm-name>
Source point 5 of http://oreilly.com/java/archive/tomcat-tips.html
Had a requirement today to restrict emails from our postfix server to only to some specific domains/ email addresses. It turned out to be pretty simple
At the end of /etc/postfix/main.cf just add
and at the end of /etc/postfix/access add the domain names/ email addresses which can accept emails
Now update postfix db
and finally restart service
service postfix restart