setting archlinux hostname (Amazon EC2) [closed] - amazon-ec2

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 10 years ago.
Improve this question
Setting the hostname on an archlinux machine is relatively trivial according to this - https://wiki.archlinux.org/index.php/HOSTNAME#Set_the_hostname
So on my /etc/rc.conf, I have
LOCALE="en_US.UTF-8"
TIMEZONE="UTC"
MOD_AUTOLOAD="no"
USECOLOR="yes"
USELVM="no"
DAEMONS=(syslog-ng sshd crond ec2 httpd)
HOSTNAME="archlinux"
And corresponding on my /etc/hosts, I have
127.0.0.1 archlinux.domain.org localhost.localdomain localhost archlinux
Following the docs to the tee.
But unfortunately, restarting httpd fails with the error in the error_log:
[Tue Sep 06 04:26:06 2011] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "ip-10-130-57-114"
Configuration Failed
And yes, I am aware that from https://wiki.archlinux.org/index.php/Apache#Apache - it is possible to solve this problem by commenting
LoadModule unique_id_module modules/mod_unique_id.so
But I would much prefer to solve this problem by keeping this module loaded and resolving it by making sure that I have set my hostname correctly in /etc/hosts instead.

It looks like Apache is using "ip-10-130-57-114" hostname instead of "archlinux". Have you tried adding this entry into your /etc/hosts file?
10.130.57.114 ip-10-130-57-114
* I am guessing 10.130.57.114 is the internal host ip address of you instance.

What does hostname -f say?
What is reverse DNS name for your IP?
Can you try to set host name to archlinux.<valid_domain> instead of archlinux so it is globally resolved?

Related

Can't connect to server with SSH, Showing " ssh: connect to host 178.128.60.26 port 22: Connection timed out" in Windows 10 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
When I am trying to connect to a server via ssh it is throwing an error "ssh: connect to host 178.128.60.26 port 22: Connection timed out". My operating system is windows 10. And I am using Git bash for connecting via ssh. Checked the blocked ports in the firewall. Port number 22 is open for all networks. I already connected to the server via ssh but now I can't.
Check first if you can ping the server.
But if you do:
either the server itself is not running the ssh daemon service (but then the error woudl more likely be "connection refused")
or it is, but on a non-conventional port (your ssh call would need to be ssh -p <another_port> ...) (again, the error would more likely be "connection refused")
or its firewall rules prevents any incoming ssh request: that would actually generate a time out.
If the remote machine is a Linux one: sudo service ufw status (assuming you have access to said server, or you can ask an administrator to check)

Setup PPTP to access home network transparently [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Setup PPTP to access home network transparently
I have Raspberry Pi box connected to home WiFi-router and running pptpd. The local addresses is 192.168.1.32 (eth0) and 192.168.2.1 (ppp0) and local name raspberry.local.
I have iMac connected to the same router with local IP 192.168.1.27 and local name imac.local
I have Macbook somewhere in the Internet connected to Raspberry’s PPTP with 192.168.2.10 on ppp0
This picture shows more clearly.
pptpd configuration
PPTP on Raspberry was installed from this simple script.
/etc/pptpd.conf
option /etc/ppp/options.pptpd
logwtmp
localip 192.168.2.1
remoteip 192.168.2.10-100
/etc/ppp/options.pptpd
name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8
ms-dns 8.8.4.4
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
/etc/rc.local
…
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -I INPUT -p tcp --dport 1723 -j ACCEPT
iptables -I INPUT --protocol 47 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -d 0.0.0.0/0 -o eth0 -j MASQUERADE
iptables -I FORWARD -s 192.168.2.0/24 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j TCPMSS --set-mss 1356
…
Curent connectivity
Macbook
can connect to home PPTP and connect to Internet through the home router
can connect to iMac and Raspberry via local IPs 192.168.1.27 and 192.168.1.32
can NOT resolve raspberry.local and imac.local
Raspberry
can connect to iMac and Macbook via local IPs 192.168.1.27 and 192.168.2.10
can resolve imac.local
can NOT resolve macbook.local
iMac
can connect to Raspberry via local IP 192.168.1.32
can resolve raspberry.local
can NOT connect to Macbook via local IP 192.168.2.10 (upd: Solved by adding static route to the router)
can NOT resolve macbook.local
The goal
The goal is to connect and resolve local names from any to any. But I have no idea how to configure this: iptables, avahi, netatalk or somewhere else?
These are 2 separate goals and you have to solve them separately.
For resolution to work: You need to set up a DNS server somewhere (iMac?) and designate it as a resolver in all your devices/computers.
Or go with an easier setup, put the name <-> ip address relations into the /etc/hosts file on all your devices/computers
For connectivity: Your iMac simply "does not know" (i.e. no route) how to connect to what is behind the raspberry. However, it DOES work vice-verse since your raspberry is doing NAT for the macbook.
Do you have access to your WiFi router's routing table? If yes, you need to add a route to the PPP network (192.168.2.0/25) via raspberry's external IP address (192.168.1.32).
The exact command or configuration steps, however, depend on the vendor/model of your WiFi router, so I cannot give you a more detailed answer here.

Mac OS Mountain Lion - Apache running but localhost not working [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 10 years ago.
Improve this question
I loaded Apache Web server on Mac OS Mountain Lion with the command
sudo apachectl start
However, when I try to open localhost in Firefox, I get the message
Not Found: The requested URL / was not found on this server. Apache/2.2.21 (Unix) DAV/2 Server at localhost Port 80
I edited both httpd.conf and httpd.conf.default to change
#ServerName www.website.com
to
ServerName localhost
It still doesn't work. Any suggestions?
To verify that a process is listening on port 80, you can use lsof in a terminal window:
$ sudo lsof -iTCP:80 -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 88 root 4u IPv6 0xffffff8018804600 0t0 TCP *:http (LISTEN)
httpd 90 _www 4u IPv6 0xffffff8018804600 0t0 TCP *:http (LISTEN)
httpd 14843 _www 4u IPv6 0xffffff8018804600 0t0 TCP *:http (LISTEN)
This will verify that you successfully enabled apache.
(I have xcode installed, but I think lsof is part of the normal install)
ADDED:
That confirms that apache is listening on port 80. The next step I would take is to look at the access logs, to see what apache logged when you requested '/' as shown in the error apache returned to your browser. This is what mine shows. Note that the http GET request is shown with the return code 200 (success):
bash-3.2# grep 'GET / ' /private/var/log/apache2/access_log
127.0.0.1 - - [12/Sep/2012:16:46:45 -0400] "GET / HTTP/1.1" 200 44
127.0.0.1 - - [12/Sep/2012:16:49:44 -0400] "GET / HTTP/1.1" 200 44
You can also confirm what url your browser is requesting by refreshing your browser window, then confirming that apache logs that new request to the access_log.
You should check the permissions on the folder specified as the "DocumentRoot" in your "httpd.conf", and allow at least read access for the Apache user (which should by "_www" by default).
Otherwise you could do a "sudo chmod 755" on the "DocumentRoot" folder.
By the way, you should only modify the "httpd.conf" file, since the "httpd.conf.default" is a default configuration that you can use if you want to restore the Apache original configuration, by simply overwriting the "httpd.conf" file with the "httpd.conf.default" file.
I suppose that you've not enabled name-based virtual hosts, since when you enable name-based virtual hosts, the document root in the main config is ignored; instead, the root for the matching hostname will be used, and if none match it will default to the first virtual host.
Finally, when you have problems, the first thing to check is always the Apache error log file.
The location of the the error log can be found by looking at the "ErrorLog" directive in the Apache configuration file.
Comment out all of the IfDefine !WEBSERVICE_ON tags, keeping the content within -- there is no WEBSERVICE on Mountain Lion.

cannot resolve localhost [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 11 years ago.
Improve this question
When I do a ping on localhost, I get "ping: cannot resolve localhost: Unknown host". A ping on 127.0.0.1 does work. So I checked my hosts file and everything looks so far correctly:
##
# 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
fe80::1%lo0 localhost
#Added by XAMPP Control
127.0.0.1 mkn.local
#Added by XAMPP Control
127.0.0.1 mkn.local
I also did a "dscacheutil -flushcache" but I still can't ping "localhost". The problem is that right now I can't debug anymore in eclipse because eclipse contacts localhost (and right now localhost cannot be resolved to 127.0.0.1).
Many thanks for any help in advance!
P.S. I have OSX 10.7.2 (Lion OS)
I restored the hosts file from an older backup. I don't see any differences between my backuped hosts file and the current file. However, it works now .... magic

openvpn - unable to browse internet after connect to openVPN [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have set up a openVPN tunnel using the following server side configuration:
port 1194
proto udp
dev tun
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
client-to-client
log-append /var/log/openvpn
group daemon
daemon
verb 3
and client configuration file as following:
client
remote ******* 1194
dev tun
comp-lzo
ca ca.crt
cert client1.crt
key client1.key
route-delay 2
route-method exe
redirect-gateway def1
verb 3
However, upon connection, I can ping 10.8.0.1 with no problem, but I can not even visit Google.
I am running Open VPN 2.1.4, in Windows 7 Ultimate with admin rights. The server is a Ubuntu 10.04 installation with TUN enabled by default.
The only suspicious part I can find in the log is like this:
Mon Feb 21 20:44:33 2011 C:\WINDOWS\system32\route.exe ADD ********* MASK 255.255.255.255 192.168.1.1
OK!
Mon Feb 21 20:44:33 2011 C:\WINDOWS\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 10.8.0.5
OK!
Mon Feb 21 20:44:34 2011 C:\WINDOWS\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 10.8.0.5
OK!
Mon Feb 21 20:44:34 2011 C:\WINDOWS\system32\route.exe ADD 10.8.0.0 MASK 255.255.255.0 10.8.0.5
OK!
Mon Feb 21 20:44:34 2011 C:\WINDOWS\system32\route.exe ADD 10.8.0.0 MASK 255.255.255.0 10.8.0.5
The route addition failed: The object already exists.
Mon Feb 21 20:44:34 2011 Initialization Sequence Completed
Not sure if that would help.
Please help!
Thanks!
You are using the flag redirect-gateway def1 and since are redirecting all your traffic through the VPN.
I can't see from your post if you have configured NAT or any other adresse translation on your server, but my guess is, that the packets are just being routed through your VPN and then have no way to get back to your client.
If your VPN client is 10.8.0.2 and your server is 10.8.0.1 and has an internet ip that is 12.12.12.12:
your call to google will be send from 10.8.0.2 routed through the VPN and then send from there to Google. The problem is, that the originating adress will stay as 10.8.0.2 and therefore the answer packets never can find back to you. You must add some means of translation that takes the packets and translates the origin from 10.8.0.2 to 12.12.12.12 and back:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
This is also explained in OpenVPN Manual. I hope this solves your problem, but from the description I could not be sure if you have any NAT translation enabled, so maybe this is isn't helpfull at all :-)

Resources