Mac OS X ignoring hosts file [closed] - osx-lion

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Mac seems to be ignoring new changes to my hosts file. Older changes work without a problem. I've spent the past 4 hours trying to figure this one out. Help!
I have folders for each site that I develop in my /Sites folder. For example, several folders are named:
wp.dev
daf.dev
test.dev
I run MAMP, set the Apache Port to 80 and the MySQL Port to 3306 (so that I don't have to add the port to the address bar in a browser).
I have edited my /private/etc/hosts file as follows:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 wp.dev
127.0.0.1 daf.dev
127.0.0.1 test.dev
fe80::1%lo0 localhost
Here's the kicker: wp.dev and daf.dev have been around for over a month. They resolve without a problem in my browser. I added test.dev this morning. When I type it into a browser it simply searches "test.dev" as opposed to resolving a domain.
I can ping any of the above domains and they go to 127.0.0.1, including test.dev.
For what it's worth, I've tried virtualhostsx with the same problem. I also run dscacheutil --flushcache and restart MAMP when making changes.
I need to kick off development on a new site, and this is driving me crazy.

Try putting all your entries at the top of the file.
Not really logical, but worth a try.

Related

Trying to connect remote (linux) server from vscode in windows 11 but showing xhr failed [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 months ago.
Improve this question
enter image description here
please help me out
It might be a problem downloading configuration file from az764295.vo.msecnd.net . For that you can download it externally and copy paste it to your linux server. Also, vs code automatically download this file while trying to connect with ssh, for that request your network administrator to open 443 port to open az764295.vo.msecnd.net on your linux server. To know whether the port is open or not ping az764295.vo.msecnd.net and telnet az764295.vo.msecnd.net 443. It is one time fixation.
try copying vs code configuration files to you server or you can download from https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz

unkillable process id on macOS port 5432- [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I am to re-install postgresql as something I was not able to log in anymore(lost password). However, every time I am trying to kill the process on corresponding port (5432), the PID changes and the port is still does not get freed. I am getting frustrated, this is taking over 2 weeks now.
Here is what I am doung:
#find the PID on 5432
sudo lsof -i: 5432 # this gives me a line where I can identify the process ID
sudo kill -9 <PID> # I use the PID given by the previous function
The last command gives a prompt asking me whether I want postgres to accept incoming network connections. Whichever option I choose (deny or allow) leads to the same thing. When I try to start postgres is still tells me that port 5432 is busy and indeed it is busy. When I re-use the first command above I notice that postgres is still there and the PID has changed.
I sorted the problem. I had other instances of postgres(9.5 I believe running in the background). I found it in my Library. now that port is completely free.

BOSH module not started: Ejabberd / Strophe setup issue [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Am trying to setup Strophe with Ejabberd on Ubuntu 12 (Linode latest version) using the internal Ejabberd webserver to serve the chat.
The test urls (http-bind and admin) both work.
JWChat works.
Strophe throws an error:
In Strophe:
RECV: <body xmlns='http://jabber.org/protocol/httpbind' type='terminate' condition='internal-server-error'>BOSH module not started</body>
In ejabberd.log:
E(<0.468.0>:ejabberd_http_bind:1236) :
You are trying to use BOSH (HTTP Bind) in host "admin", but the module mod_http_bind is not started in that host.
Configure your BOSH client to connect to the correct host, or add your desired host`
Setup has been straightforward (though it took quite a while to work this out):
Installed using sudo apt-get
Running under sudo
Using the internal server, to avoid messing with proxies or setting up PunJab.
In ejabberd.cfg made changes.
Changes to ejabberd.cfg:
%% In listening ports, amended the following lines:
{ request_handlers, [
{["pub"], mod_http_fileserver},
{["http-bind"], mod_http_bind}
]},
%% In modules, added the following:
{ mod_http_fileserver, [
{docroot, "/var/lib/ejabberd/www"},
{accesslog, "/var/log/ejabberd/access.log"}
]},
{mod_http_bind, []},
Any help would be much appreciated.
The answer is rather obvious.
Strophe requires the username in the following format:
username#host
eg. admin#example.com
It otherwise assumes that the username is really the host, and since such a host doesn't exist, it throws an error that mod_http_bind is not started in that host
This error is misleading at best, but it does technically explain the issue.
I was trying to login with just the username [which worked fine in JWChat], hence the issue.
In case this doesn't work, a checklist of some of the other things to verify:
Make sure that your domain is added to /etc/hosts
127.0.0.1 localhost.localdomain localhost
12.34.56.78 squire.example.com squire
Make sure that your domain is added to /etc/ejabberd/ejabberd.cfg
%% Hostname
Hostname {hosts, ["example.com","98.765.43.21","localhost"]}.
Ensure that your username exists and is registered:
ejabberdctl register username example.com password
And if user is an admin, is included in ejabberd.cfg [Note: it must also be registered!]
%% Admin user
{acl, admin, {user, "", "localhost"}}.
{acl, admin, {user, "admin", "example.com"}}.
Check that the server is running:
a. sudo ejabberdctl status
b. http://example.com:5280/admin
c. http://example.com:5280/http-bind
If there are issues, restart using both (I know you don't need both in theory. In practice, sometimes using one or the other would not work right.)
sudo /etc/init.d/ejabberd restart
sudo ejabberdctl restart
Check the logs - /var/log/ejabberd/ejabberd.log (see here).
Install JWChat and try that (or, if you have JWChat, install Strophe).
The following short tutorial is invaluable, follow it exactly: http://www.ejabberd.im/jwchat-localserver

ssh-agent across ssh sessions on shared host [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I ssh into a shared host (WebFaction) and then use ssh-agent to establish a connection to a mercurial repository (BitBucket). I call the agent like so:
eval `ssh-agent`
This then spews out the pid of the agent and sets its relevant environment variables. I then use ssh-add as follows to add my identity (after typing my passphrase):
ssh-add /path/to/a/key
My ssh connection eventually times out and I'm disconnected from the server. When I log back in, I can no longer connect to the Hg server and so I do this:
ps aux | grep 1234.*ssh-agent`
kill -SIGHUP 43210
And then repeat the two commands at the top of the post (ie. invoke the agent using eval and call ssh-add).
I'm sure that there's a well established idiom for avoiding this process and maintaining a "reference" to the agent that was spawned initially. I've tried redirecting I/O of the first command to a file (in the hope of sourcing it in my .bashrc), but I only get the agent's pid.
How can I avoid having to go through this process each time I ssh into the host?
My *NIX skills are weak, so constructive criticism on any aspect of the post is welcome, not just my use of ssh-agent.
Short answer:
With ssh-agent running locally and identities added, ssh -A user#host.webfaction.com provides the secure shell on the remote host with the local agent's identities.
Long answer:
As Charles suggested, agent forwarding is the solution.
At first, I thought that I could just issue an ssh user#host.webfaction.com and then, from within the secure session on the remote host, connect to the BitBucket repository using hg+ssh. But that failed, and so I investigated the ForwardAgent and AgentForwardingEnabled flags.
Thinking that I'd have to settle for a workaround in .bashrc that involved keeping my private key on the remote host, I went looking for a shell-script solution but was spared from this kludge by this answer in SuperUser, which is perfect and works without any client configuration (I'm not sure how the sshd server is configured on WebFaction).
Aside: in my question, I posted the following:
ps aux | grep 1234.*ssh-agent`
kill -SIGHUP 43210
but this is actually inefficient and requires the user to know his/her uid (available via /etc/passwd). pgrep is much easier:
pgrep -u username process-name

Using "http://localhost" instead of "http://xx.xx.xx.xx" on iPod on WAMP

I am running Windows 7 and use my iPod Touch to access my localhost sites for testing purposes on WAMP.
I can browse my localhost sites by navigating to my machine IP in Safari on my iPod like so: http://10.0.0.100
I would like to know if it is at all possible to use http://localhost instead, and how I can accomplish that.
Thank you very much!!
Basically, localhost refers to 127.0.0.1 refers to the loop back ip which is the ipod itself so it's not possible unless you change [localhost to resolve to machine IP which is in this case 10.0.0.100] in the (DNS / hosts file) your ipod is using to resolve domain names in your connection settings and I don't recommend that.
Following are the steps needed to change the hosts file in your ipod (I warned you already this is not a good thing unless you know what are you doing)
source: https://discussions.apple.com/thread/2801892?start=0&tstart=0
Simple solution:
the hostfile is located at: /etc/hosts
To edit this file you need to SSH into your device, If you know how to do this directly just use vi, or nano to edit the file. From windows use WinSCP to access the file system via FTP(SSH). Then simply navigate to /etc/hosts download the file to your desktop, right click and open it with note pad, add your resolver to the last line "192.168.0.100 testserver", save, and replace the original file with the new one.
/etc/host -- example config
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.0.100 testserver
*To SSH into an ipod it must have OpenSSH installed, usually this requires a jailbreak.