I know this is a common questions asked by many people, but since I am really really a newbie in this area, I really need a very detailed steps on what I have to do.
This is my situations:
I set up a clean local server at my university using Ubuntu server, set up OpenSSH and LAMP server(Apache2, PHP, MySQL) - nothing else, and created a simple drupal website in the /var/www and then I could take a look at my website in the local network at my university through this ip, the ip is 172.21.45.108. Certainly, I think this IP is not usable at all if users accessed outside the network, and through many googling, people have suggested that we need to get some "static IP" and "A domain". Through my newbie effort, I got a domain name registered and paid through Enom via Google, in addition, I ask my university to provide me a static IP which they did, however, I have no idea at all what these information is for, the information includes:
- Network name
- IP address
- Subnet Mask
- DNS Server (primary)
- DNS Server (secondary)
Again, through my newbie effort through crazy googling, i was found that I need to change the local network interfaces to this IP, so what I did is:
sudo vi /etc/network/interfaces
and change it to
auto eth0 iface eth0 inet static address xxx.xxx.x.xxx (provided by the university) netmask 255.255.255.0 ('---') gateway xxx.xxx.x.x ('---')
and then restart
sudo /etc/init.d/networking restart
After that, i use ifconfig to confirm that my eth0 change to that IP, then I first try to access it from the local network, but it can't not be accessed anymore! The chrome says the connection to xxx.xxx.x.xxx is interrupted.
Now I am guessing I need to set the dns server somewhere, after my newbie effort once again, I found that I need to add my dns server into the /etc/resolv.conf, so i did
nameserver xxx.xxx.x.xxx nameserver xxx.xxx.x.xxx search web-server
also, I went to /etc/hosts and fix it to
127.0.0.1 localhost my-static-ip web-server
and i save it and restart the whole networking. Still, I can't even access the Ip via my local network, and when I try to ping google from the server, it can't reach, it's as if the server has no internet. I can confirm there is internet because when switch back to dhcp, the google ping works just fine. so I guess I must miss something important, but I feel the university has already given me enough information to set up, maybe I need to direct the domain name to this IP? which i think it's not necessary because even the IP cannot be accessed.
Please enligten me! anyone! :) Thank you in advance.
I call them and they give me a new IP which works now...(so frustrated with them), using the static IP,
- now I can ping the gateway and get responses
- I try ping google using its IP 126.96.36.199 and it works too
- next I try ping www.google.com and its say "unknown hosts"
- I try access the static IP via browser in the local network, and it works too, but when I try browser in the internet, it does not work.
I guess my DNS server is not set right, what you guys think?
Oh right, everyone, I just notice that the /etc/resolv.conf is wiped after restart, so after filling in, now the pinging www.google.com works fine. However, the webpage still cannot be access via internet.
Also, I make sure my university did not block port 80 by changing the /etc/apache2/ports.conf to 8080, and as well as in the virtualhost file, still it can't be accessed through the internet, but only via local network. I found one good website for testing the internet visibility http://canyouseeme.org/. OH noo...I must miss something very little....